@burnt-labs/xion-types 0.0.1-test.1762962136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jest.config.js +18 -0
- package/package.json +56 -0
- package/scripts/aminos.ts +29 -0
- package/scripts/codegen.ts +94 -0
- package/scripts/download-protos.ts +248 -0
- package/telescope.config.json +84 -0
- package/tsconfig.esm.json +9 -0
- package/tsconfig.json +18 -0
- package/types/abstractaccount/bundle.ts +35 -0
- package/types/abstractaccount/client.ts +48 -0
- package/types/abstractaccount/lcd.ts +130 -0
- package/types/abstractaccount/rpc.query.ts +93 -0
- package/types/abstractaccount/rpc.tx.ts +74 -0
- package/types/abstractaccount/v1/account.ts +250 -0
- package/types/abstractaccount/v1/events.ts +135 -0
- package/types/abstractaccount/v1/genesis.ts +106 -0
- package/types/abstractaccount/v1/params.ts +192 -0
- package/types/abstractaccount/v1/query.lcd.ts +19 -0
- package/types/abstractaccount/v1/query.rpc.Query.ts +31 -0
- package/types/abstractaccount/v1/query.ts +160 -0
- package/types/abstractaccount/v1/tx.amino.ts +14 -0
- package/types/abstractaccount/v1/tx.registry.ts +53 -0
- package/types/abstractaccount/v1/tx.rpc.msg.ts +29 -0
- package/types/abstractaccount/v1/tx.ts +454 -0
- package/types/amino/amino.ts +1 -0
- package/types/amino/bundle.ts +5 -0
- package/types/binary.ts +535 -0
- package/types/cosmos/app/runtime/v1alpha1/module.ts +492 -0
- package/types/cosmos/app/v1alpha1/config.ts +437 -0
- package/types/cosmos/app/v1alpha1/module.ts +466 -0
- package/types/cosmos/app/v1alpha1/query.rpc.Query.ts +31 -0
- package/types/cosmos/app/v1alpha1/query.ts +176 -0
- package/types/cosmos/auth/module/v1/module.ts +288 -0
- package/types/cosmos/auth/v1beta1/auth.ts +562 -0
- package/types/cosmos/auth/v1beta1/genesis.ts +123 -0
- package/types/cosmos/auth/v1beta1/query.lcd.ts +91 -0
- package/types/cosmos/auth/v1beta1/query.rpc.Query.ts +137 -0
- package/types/cosmos/auth/v1beta1/query.ts +2005 -0
- package/types/cosmos/auth/v1beta1/tx.amino.ts +9 -0
- package/types/cosmos/auth/v1beta1/tx.registry.ts +35 -0
- package/types/cosmos/auth/v1beta1/tx.rpc.msg.ts +24 -0
- package/types/cosmos/auth/v1beta1/tx.ts +208 -0
- package/types/cosmos/authz/module/v1/module.ts +77 -0
- package/types/cosmos/authz/v1beta1/authz.ts +599 -0
- package/types/cosmos/authz/v1beta1/event.ts +274 -0
- package/types/cosmos/authz/v1beta1/genesis.ts +99 -0
- package/types/cosmos/authz/v1beta1/query.lcd.ts +59 -0
- package/types/cosmos/authz/v1beta1/query.rpc.Query.ts +53 -0
- package/types/cosmos/authz/v1beta1/query.ts +734 -0
- package/types/cosmos/authz/v1beta1/tx.amino.ts +19 -0
- package/types/cosmos/authz/v1beta1/tx.registry.ts +71 -0
- package/types/cosmos/authz/v1beta1/tx.rpc.msg.ts +49 -0
- package/types/cosmos/authz/v1beta1/tx.ts +666 -0
- package/types/cosmos/autocli/v1/options.ts +1317 -0
- package/types/cosmos/autocli/v1/query.rpc.Query.ts +32 -0
- package/types/cosmos/autocli/v1/query.ts +298 -0
- package/types/cosmos/bank/module/v1/module.ts +156 -0
- package/types/cosmos/bank/v1beta1/authz.ts +134 -0
- package/types/cosmos/bank/v1beta1/bank.ts +984 -0
- package/types/cosmos/bank/v1beta1/genesis.ts +316 -0
- package/types/cosmos/bank/v1beta1/query.lcd.ts +207 -0
- package/types/cosmos/bank/v1beta1/query.rpc.Query.ts +212 -0
- package/types/cosmos/bank/v1beta1/query.ts +3051 -0
- package/types/cosmos/bank/v1beta1/tx.amino.ts +24 -0
- package/types/cosmos/bank/v1beta1/tx.registry.ts +89 -0
- package/types/cosmos/bank/v1beta1/tx.rpc.msg.ts +53 -0
- package/types/cosmos/bank/v1beta1/tx.ts +845 -0
- package/types/cosmos/base/abci/v1beta1/abci.ts +1776 -0
- package/types/cosmos/base/node/v1beta1/query.lcd.ts +25 -0
- package/types/cosmos/base/node/v1beta1/query.rpc.Service.ts +42 -0
- package/types/cosmos/base/node/v1beta1/query.ts +467 -0
- package/types/cosmos/base/query/v1beta1/pagination.ts +372 -0
- package/types/cosmos/base/reflection/v1beta1/reflection.ts +385 -0
- package/types/cosmos/base/reflection/v2alpha1/reflection.ts +2790 -0
- package/types/cosmos/base/tendermint/v1beta1/query.lcd.ts +87 -0
- package/types/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts +103 -0
- package/types/cosmos/base/tendermint/v1beta1/query.ts +2358 -0
- package/types/cosmos/base/tendermint/v1beta1/types.ts +492 -0
- package/types/cosmos/base/v1beta1/coin.ts +449 -0
- package/types/cosmos/benchmark/module/v1/module.ts +384 -0
- package/types/cosmos/benchmark/v1/benchmark.ts +186 -0
- package/types/cosmos/benchmark/v1/tx.amino.ts +9 -0
- package/types/cosmos/benchmark/v1/tx.registry.ts +35 -0
- package/types/cosmos/benchmark/v1/tx.rpc.msg.ts +21 -0
- package/types/cosmos/benchmark/v1/tx.ts +224 -0
- package/types/cosmos/bundle.ts +807 -0
- package/types/cosmos/circuit/module/v1/module.ts +100 -0
- package/types/cosmos/circuit/v1/query.lcd.ts +40 -0
- package/types/cosmos/circuit/v1/query.rpc.Query.ts +55 -0
- package/types/cosmos/circuit/v1/query.ts +576 -0
- package/types/cosmos/circuit/v1/tx.amino.ts +19 -0
- package/types/cosmos/circuit/v1/tx.registry.ts +71 -0
- package/types/cosmos/circuit/v1/tx.rpc.msg.ts +43 -0
- package/types/cosmos/circuit/v1/tx.ts +685 -0
- package/types/cosmos/circuit/v1/types.ts +419 -0
- package/types/cosmos/client.ts +100 -0
- package/types/cosmos/consensus/module/v1/module.ts +100 -0
- package/types/cosmos/consensus/v1/query.lcd.ts +19 -0
- package/types/cosmos/consensus/v1/query.rpc.Query.ts +31 -0
- package/types/cosmos/consensus/v1/query.ts +182 -0
- package/types/cosmos/consensus/v1/tx.amino.ts +9 -0
- package/types/cosmos/consensus/v1/tx.registry.ts +35 -0
- package/types/cosmos/consensus/v1/tx.rpc.msg.ts +24 -0
- package/types/cosmos/consensus/v1/tx.ts +257 -0
- package/types/cosmos/counter/module/v1/module.ts +100 -0
- package/types/cosmos/counter/v1/query.rpc.Query.ts +31 -0
- package/types/cosmos/counter/v1/query.ts +171 -0
- package/types/cosmos/counter/v1/tx.amino.ts +9 -0
- package/types/cosmos/counter/v1/tx.registry.ts +35 -0
- package/types/cosmos/counter/v1/tx.rpc.msg.ts +21 -0
- package/types/cosmos/counter/v1/tx.ts +217 -0
- package/types/cosmos/crisis/module/v1/module.ts +119 -0
- package/types/cosmos/crisis/v1beta1/genesis.ts +105 -0
- package/types/cosmos/crisis/v1beta1/tx.amino.ts +14 -0
- package/types/cosmos/crisis/v1beta1/tx.registry.ts +53 -0
- package/types/cosmos/crisis/v1beta1/tx.rpc.msg.ts +32 -0
- package/types/cosmos/crisis/v1beta1/tx.ts +413 -0
- package/types/cosmos/crypto/bls12_381/keys.ts +207 -0
- package/types/cosmos/crypto/ed25519/keys.ts +214 -0
- package/types/cosmos/crypto/hd/v1/hd.ts +180 -0
- package/types/cosmos/crypto/keyring/v1/record.ts +542 -0
- package/types/cosmos/crypto/multisig/keys.ts +124 -0
- package/types/cosmos/crypto/multisig/v1beta1/multisig.ts +231 -0
- package/types/cosmos/crypto/secp256k1/keys.ts +207 -0
- package/types/cosmos/crypto/secp256r1/keys.ts +203 -0
- package/types/cosmos/distribution/module/v1/module.ts +115 -0
- package/types/cosmos/distribution/v1beta1/distribution.ts +1551 -0
- package/types/cosmos/distribution/v1beta1/genesis.ts +1208 -0
- package/types/cosmos/distribution/v1beta1/query.lcd.ts +89 -0
- package/types/cosmos/distribution/v1beta1/query.rpc.Query.ts +137 -0
- package/types/cosmos/distribution/v1beta1/query.ts +2195 -0
- package/types/cosmos/distribution/v1beta1/tx.amino.ts +39 -0
- package/types/cosmos/distribution/v1beta1/tx.registry.ts +143 -0
- package/types/cosmos/distribution/v1beta1/tx.rpc.msg.ts +96 -0
- package/types/cosmos/distribution/v1beta1/tx.ts +1460 -0
- package/types/cosmos/epochs/module/v1/module.ts +77 -0
- package/types/cosmos/epochs/v1beta1/events.ts +205 -0
- package/types/cosmos/epochs/v1beta1/genesis.ts +384 -0
- package/types/cosmos/epochs/v1beta1/query.lcd.ts +31 -0
- package/types/cosmos/epochs/v1beta1/query.rpc.Query.ts +42 -0
- package/types/cosmos/epochs/v1beta1/query.ts +390 -0
- package/types/cosmos/evidence/module/v1/module.ts +77 -0
- package/types/cosmos/evidence/v1beta1/evidence.ts +166 -0
- package/types/cosmos/evidence/v1beta1/genesis.ts +103 -0
- package/types/cosmos/evidence/v1beta1/query.lcd.ts +40 -0
- package/types/cosmos/evidence/v1beta1/query.rpc.Query.ts +44 -0
- package/types/cosmos/evidence/v1beta1/query.ts +458 -0
- package/types/cosmos/evidence/v1beta1/tx.amino.ts +9 -0
- package/types/cosmos/evidence/v1beta1/tx.registry.ts +35 -0
- package/types/cosmos/evidence/v1beta1/tx.rpc.msg.ts +24 -0
- package/types/cosmos/evidence/v1beta1/tx.ts +243 -0
- package/types/cosmos/feegrant/module/v1/module.ts +77 -0
- package/types/cosmos/feegrant/v1beta1/feegrant.ts +701 -0
- package/types/cosmos/feegrant/v1beta1/genesis.ts +99 -0
- package/types/cosmos/feegrant/v1beta1/query.lcd.ts +44 -0
- package/types/cosmos/feegrant/v1beta1/query.rpc.Query.ts +53 -0
- package/types/cosmos/feegrant/v1beta1/query.ts +683 -0
- package/types/cosmos/feegrant/v1beta1/tx.amino.ts +19 -0
- package/types/cosmos/feegrant/v1beta1/tx.registry.ts +71 -0
- package/types/cosmos/feegrant/v1beta1/tx.rpc.msg.ts +43 -0
- package/types/cosmos/feegrant/v1beta1/tx.ts +683 -0
- package/types/cosmos/genutil/module/v1/module.ts +77 -0
- package/types/cosmos/genutil/v1beta1/genesis.ts +103 -0
- package/types/cosmos/gov/module/v1/module.ts +123 -0
- package/types/cosmos/gov/v1/genesis.ts +288 -0
- package/types/cosmos/gov/v1/gov.ts +1889 -0
- package/types/cosmos/gov/v1/query.lcd.ts +95 -0
- package/types/cosmos/gov/v1/query.rpc.Query.ts +119 -0
- package/types/cosmos/gov/v1/query.ts +2026 -0
- package/types/cosmos/gov/v1/tx.amino.ts +39 -0
- package/types/cosmos/gov/v1/tx.registry.ts +143 -0
- package/types/cosmos/gov/v1/tx.rpc.msg.ts +75 -0
- package/types/cosmos/gov/v1/tx.ts +1911 -0
- package/types/cosmos/gov/v1beta1/genesis.ts +221 -0
- package/types/cosmos/gov/v1beta1/gov.ts +1725 -0
- package/types/cosmos/gov/v1beta1/query.lcd.ts +89 -0
- package/types/cosmos/gov/v1beta1/query.rpc.Query.ts +108 -0
- package/types/cosmos/gov/v1beta1/query.ts +1813 -0
- package/types/cosmos/gov/v1beta1/tx.amino.ts +24 -0
- package/types/cosmos/gov/v1beta1/tx.registry.ts +89 -0
- package/types/cosmos/gov/v1beta1/tx.rpc.msg.ts +45 -0
- package/types/cosmos/gov/v1beta1/tx.ts +1128 -0
- package/types/cosmos/group/module/v1/module.ts +128 -0
- package/types/cosmos/group/v1/events.ts +1195 -0
- package/types/cosmos/group/v1/genesis.ts +256 -0
- package/types/cosmos/group/v1/query.lcd.ts +158 -0
- package/types/cosmos/group/v1/query.rpc.Query.ts +182 -0
- package/types/cosmos/group/v1/query.ts +3108 -0
- package/types/cosmos/group/v1/tx.amino.ts +74 -0
- package/types/cosmos/group/v1/tx.registry.ts +269 -0
- package/types/cosmos/group/v1/tx.rpc.msg.ts +125 -0
- package/types/cosmos/group/v1/tx.ts +3353 -0
- package/types/cosmos/group/v1/types.ts +2248 -0
- package/types/cosmos/ics23/v1/proofs.ts +2167 -0
- package/types/cosmos/lcd.ts +125 -0
- package/types/cosmos/mint/module/v1/module.ts +115 -0
- package/types/cosmos/mint/v1beta1/genesis.ts +120 -0
- package/types/cosmos/mint/v1beta1/mint.ts +313 -0
- package/types/cosmos/mint/v1beta1/query.lcd.ts +31 -0
- package/types/cosmos/mint/v1beta1/query.rpc.Query.ts +53 -0
- package/types/cosmos/mint/v1beta1/query.ts +544 -0
- package/types/cosmos/mint/v1beta1/tx.amino.ts +9 -0
- package/types/cosmos/mint/v1beta1/tx.registry.ts +35 -0
- package/types/cosmos/mint/v1beta1/tx.rpc.msg.ts +24 -0
- package/types/cosmos/mint/v1beta1/tx.ts +208 -0
- package/types/cosmos/msg/textual/v1/textual.ts +1 -0
- package/types/cosmos/msg/v1/msg.ts +1 -0
- package/types/cosmos/nft/module/v1/module.ts +77 -0
- package/types/cosmos/nft/v1beta1/event.ts +429 -0
- package/types/cosmos/nft/v1beta1/genesis.ts +243 -0
- package/types/cosmos/nft/v1beta1/nft.ts +389 -0
- package/types/cosmos/nft/v1beta1/query.lcd.ts +77 -0
- package/types/cosmos/nft/v1beta1/query.rpc.Query.ts +102 -0
- package/types/cosmos/nft/v1beta1/query.ts +1513 -0
- package/types/cosmos/nft/v1beta1/tx.amino.ts +9 -0
- package/types/cosmos/nft/v1beta1/tx.registry.ts +35 -0
- package/types/cosmos/nft/v1beta1/tx.rpc.msg.ts +21 -0
- package/types/cosmos/nft/v1beta1/tx.ts +232 -0
- package/types/cosmos/params/module/v1/module.ts +77 -0
- package/types/cosmos/params/v1beta1/params.ts +262 -0
- package/types/cosmos/params/v1beta1/query.lcd.ts +35 -0
- package/types/cosmos/params/v1beta1/query.rpc.Query.ts +45 -0
- package/types/cosmos/params/v1beta1/query.ts +521 -0
- package/types/cosmos/protocolpool/module/v1/module.ts +100 -0
- package/types/cosmos/protocolpool/v1/genesis.ts +126 -0
- package/types/cosmos/protocolpool/v1/query.lcd.ts +37 -0
- package/types/cosmos/protocolpool/v1/query.rpc.Query.ts +64 -0
- package/types/cosmos/protocolpool/v1/query.ts +761 -0
- package/types/cosmos/protocolpool/v1/tx.amino.ts +29 -0
- package/types/cosmos/protocolpool/v1/tx.registry.ts +107 -0
- package/types/cosmos/protocolpool/v1/tx.rpc.msg.ts +69 -0
- package/types/cosmos/protocolpool/v1/tx.ts +1124 -0
- package/types/cosmos/protocolpool/v1/types.ts +268 -0
- package/types/cosmos/query/v1/query.ts +1 -0
- package/types/cosmos/reflection/v1/reflection.ts +178 -0
- package/types/cosmos/rpc.query.ts +90 -0
- package/types/cosmos/rpc.tx.ts +71 -0
- package/types/cosmos/slashing/module/v1/module.ts +100 -0
- package/types/cosmos/slashing/v1beta1/genesis.ts +511 -0
- package/types/cosmos/slashing/v1beta1/query.lcd.ts +40 -0
- package/types/cosmos/slashing/v1beta1/query.rpc.Query.ts +55 -0
- package/types/cosmos/slashing/v1beta1/query.ts +606 -0
- package/types/cosmos/slashing/v1beta1/slashing.ts +371 -0
- package/types/cosmos/slashing/v1beta1/tx.amino.ts +14 -0
- package/types/cosmos/slashing/v1beta1/tx.registry.ts +53 -0
- package/types/cosmos/slashing/v1beta1/tx.rpc.msg.ts +36 -0
- package/types/cosmos/slashing/v1beta1/tx.ts +377 -0
- package/types/cosmos/staking/module/v1/module.ts +165 -0
- package/types/cosmos/staking/v1beta1/authz.ts +321 -0
- package/types/cosmos/staking/v1beta1/genesis.ts +370 -0
- package/types/cosmos/staking/v1beta1/query.lcd.ts +174 -0
- package/types/cosmos/staking/v1beta1/query.rpc.Query.ts +217 -0
- package/types/cosmos/staking/v1beta1/query.ts +3187 -0
- package/types/cosmos/staking/v1beta1/staking.ts +3193 -0
- package/types/cosmos/staking/v1beta1/tx.amino.ts +39 -0
- package/types/cosmos/staking/v1beta1/tx.registry.ts +143 -0
- package/types/cosmos/staking/v1beta1/tx.rpc.msg.ts +84 -0
- package/types/cosmos/staking/v1beta1/tx.ts +1642 -0
- package/types/cosmos/store/internal/kv/v1beta1/kv.ts +208 -0
- package/types/cosmos/store/snapshots/v1/snapshot.ts +840 -0
- package/types/cosmos/store/streaming/abci/grpc.ts +393 -0
- package/types/cosmos/store/v1beta1/commit_info.ts +369 -0
- package/types/cosmos/store/v1beta1/listening.ts +296 -0
- package/types/cosmos/tx/config/v1/config.ts +127 -0
- package/types/cosmos/tx/signing/v1beta1/signing.ts +713 -0
- package/types/cosmos/tx/v1beta1/service.lcd.ts +59 -0
- package/types/cosmos/tx/v1beta1/service.rpc.Service.ts +119 -0
- package/types/cosmos/tx/v1beta1/service.ts +2319 -0
- package/types/cosmos/tx/v1beta1/tx.ts +2168 -0
- package/types/cosmos/upgrade/module/v1/module.ts +100 -0
- package/types/cosmos/upgrade/v1beta1/query.lcd.ts +54 -0
- package/types/cosmos/upgrade/v1beta1/query.rpc.Query.ts +82 -0
- package/types/cosmos/upgrade/v1beta1/query.ts +1004 -0
- package/types/cosmos/upgrade/v1beta1/tx.amino.ts +14 -0
- package/types/cosmos/upgrade/v1beta1/tx.registry.ts +53 -0
- package/types/cosmos/upgrade/v1beta1/tx.rpc.msg.ts +32 -0
- package/types/cosmos/upgrade/v1beta1/tx.ts +368 -0
- package/types/cosmos/upgrade/v1beta1/upgrade.ts +623 -0
- package/types/cosmos/vesting/module/v1/module.ts +77 -0
- package/types/cosmos/vesting/v1beta1/tx.amino.ts +19 -0
- package/types/cosmos/vesting/v1beta1/tx.registry.ts +71 -0
- package/types/cosmos/vesting/v1beta1/tx.rpc.msg.ts +46 -0
- package/types/cosmos/vesting/v1beta1/tx.ts +688 -0
- package/types/cosmos/vesting/v1beta1/vesting.ts +751 -0
- package/types/cosmos_proto/bundle.ts +5 -0
- package/types/cosmos_proto/cosmos.ts +355 -0
- package/types/cosmwasm/bundle.ts +39 -0
- package/types/cosmwasm/client.ts +48 -0
- package/types/cosmwasm/lcd.ts +132 -0
- package/types/cosmwasm/rpc.query.ts +95 -0
- package/types/cosmwasm/rpc.tx.ts +76 -0
- package/types/cosmwasm/wasm/v1/authz.ts +1409 -0
- package/types/cosmwasm/wasm/v1/genesis.ts +544 -0
- package/types/cosmwasm/wasm/v1/ibc.ts +437 -0
- package/types/cosmwasm/wasm/v1/proposal_legacy.ts +2711 -0
- package/types/cosmwasm/wasm/v1/query.lcd.ts +154 -0
- package/types/cosmwasm/wasm/v1/query.rpc.Query.ts +181 -0
- package/types/cosmwasm/wasm/v1/query.ts +3339 -0
- package/types/cosmwasm/wasm/v1/tx.amino.ts +89 -0
- package/types/cosmwasm/wasm/v1/tx.registry.ts +323 -0
- package/types/cosmwasm/wasm/v1/tx.rpc.msg.ts +197 -0
- package/types/cosmwasm/wasm/v1/tx.ts +4403 -0
- package/types/cosmwasm/wasm/v1/types.ts +1193 -0
- package/types/gogoproto/bundle.ts +5 -0
- package/types/gogoproto/gogo.ts +1 -0
- package/types/google/api/annotations.ts +1 -0
- package/types/google/api/apikeys/v2/apikeys.ts +1245 -0
- package/types/google/api/apikeys/v2/resources.ts +1268 -0
- package/types/google/api/auth.ts +1175 -0
- package/types/google/api/backend.ts +691 -0
- package/types/google/api/billing.ts +333 -0
- package/types/google/api/client.ts +3100 -0
- package/types/google/api/cloudquotas/v1/cloudquotas.ts +1196 -0
- package/types/google/api/cloudquotas/v1/resources.ts +2065 -0
- package/types/google/api/cloudquotas/v1beta/cloudquotas.ts +1196 -0
- package/types/google/api/cloudquotas/v1beta/quota_adjuster_settings.ts +509 -0
- package/types/google/api/cloudquotas/v1beta/resources.ts +2069 -0
- package/types/google/api/config_change.ts +385 -0
- package/types/google/api/consumer.ts +362 -0
- package/types/google/api/context.ts +418 -0
- package/types/google/api/control.ts +141 -0
- package/types/google/api/distribution.ts +1253 -0
- package/types/google/api/documentation.ts +738 -0
- package/types/google/api/endpoint.ts +245 -0
- package/types/google/api/error_reason.ts +816 -0
- package/types/google/api/expr/conformance/v1alpha1/conformance_service.ts +1293 -0
- package/types/google/api/expr/v1alpha1/checked.ts +2259 -0
- package/types/google/api/expr/v1alpha1/eval.ts +675 -0
- package/types/google/api/expr/v1alpha1/explain.ts +257 -0
- package/types/google/api/expr/v1alpha1/syntax.ts +2983 -0
- package/types/google/api/expr/v1alpha1/value.ts +771 -0
- package/types/google/api/expr/v1beta1/decl.ts +563 -0
- package/types/google/api/expr/v1beta1/eval.ts +758 -0
- package/types/google/api/expr/v1beta1/expr.ts +1750 -0
- package/types/google/api/expr/v1beta1/source.ts +446 -0
- package/types/google/api/expr/v1beta1/value.ts +771 -0
- package/types/google/api/field_behavior.ts +136 -0
- package/types/google/api/field_info.ts +319 -0
- package/types/google/api/http.ts +1362 -0
- package/types/google/api/httpbody.ts +270 -0
- package/types/google/api/label.ts +174 -0
- package/types/google/api/launch_stage.ts +112 -0
- package/types/google/api/log.ts +201 -0
- package/types/google/api/logging.ts +355 -0
- package/types/google/api/metric.ts +1174 -0
- package/types/google/api/monitored_resource.ts +841 -0
- package/types/google/api/monitoring.ts +430 -0
- package/types/google/api/policy.ts +314 -0
- package/types/google/api/quota.ts +1040 -0
- package/types/google/api/resource.ts +769 -0
- package/types/google/api/routing.ts +1405 -0
- package/types/google/api/service.ts +790 -0
- package/types/google/api/servicecontrol/v1/check_error.ts +366 -0
- package/types/google/api/servicecontrol/v1/distribution.ts +773 -0
- package/types/google/api/servicecontrol/v1/http_request.ts +427 -0
- package/types/google/api/servicecontrol/v1/log_entry.ts +804 -0
- package/types/google/api/servicecontrol/v1/metric_value.ts +499 -0
- package/types/google/api/servicecontrol/v1/operation.ts +544 -0
- package/types/google/api/servicecontrol/v1/quota_controller.ts +1041 -0
- package/types/google/api/servicecontrol/v1/service_controller.ts +1164 -0
- package/types/google/api/servicecontrol/v2/service_controller.ts +949 -0
- package/types/google/api/servicemanagement/v1/resources.ts +1888 -0
- package/types/google/api/servicemanagement/v1/servicemanager.ts +2444 -0
- package/types/google/api/serviceusage/v1/resources.ts +629 -0
- package/types/google/api/serviceusage/v1/serviceusage.ts +1530 -0
- package/types/google/api/serviceusage/v1beta1/resources.ts +2972 -0
- package/types/google/api/serviceusage/v1beta1/serviceusage.ts +4567 -0
- package/types/google/api/source_info.ts +97 -0
- package/types/google/api/system_parameter.ts +461 -0
- package/types/google/api/usage.ts +404 -0
- package/types/google/api/visibility.ts +328 -0
- package/types/google/bundle.ts +115 -0
- package/types/google/logging/type/log_severity.ts +104 -0
- package/types/google/longrunning/operations.ts +1153 -0
- package/types/google/protobuf/any.ts +424 -0
- package/types/google/protobuf/api.ts +942 -0
- package/types/google/protobuf/descriptor.ts +7801 -0
- package/types/google/protobuf/duration.ts +284 -0
- package/types/google/protobuf/empty.ts +93 -0
- package/types/google/protobuf/field_mask.ts +694 -0
- package/types/google/protobuf/source_context.ts +105 -0
- package/types/google/protobuf/struct.ts +584 -0
- package/types/google/protobuf/timestamp.ts +373 -0
- package/types/google/protobuf/type.ts +1279 -0
- package/types/google/protobuf/wrappers.ts +1002 -0
- package/types/google/rpc/code.ts +286 -0
- package/types/google/rpc/context/attribute_context.ts +2517 -0
- package/types/google/rpc/context/audit_context.ts +188 -0
- package/types/google/rpc/error_details.ts +2467 -0
- package/types/google/rpc/http.ts +424 -0
- package/types/google/rpc/status.ts +173 -0
- package/types/helpers.ts +259 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/controller.ts +107 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/query.lcd.ts +25 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/query.rpc.Query.ts +42 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/query.ts +379 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts +19 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts +71 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts +37 -0
- package/types/ibc/applications/interchain_accounts/controller/v1/tx.ts +692 -0
- package/types/ibc/applications/interchain_accounts/genesis/v1/genesis.ts +675 -0
- package/types/ibc/applications/interchain_accounts/host/v1/host.ts +261 -0
- package/types/ibc/applications/interchain_accounts/host/v1/query.lcd.ts +19 -0
- package/types/ibc/applications/interchain_accounts/host/v1/query.rpc.Query.ts +31 -0
- package/types/ibc/applications/interchain_accounts/host/v1/query.ts +176 -0
- package/types/ibc/applications/interchain_accounts/host/v1/tx.amino.ts +14 -0
- package/types/ibc/applications/interchain_accounts/host/v1/tx.registry.ts +53 -0
- package/types/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts +29 -0
- package/types/ibc/applications/interchain_accounts/host/v1/tx.ts +440 -0
- package/types/ibc/applications/interchain_accounts/v1/account.ts +115 -0
- package/types/ibc/applications/interchain_accounts/v1/metadata.ts +206 -0
- package/types/ibc/applications/interchain_accounts/v1/packet.ts +262 -0
- package/types/ibc/applications/transfer/v1/authz.ts +297 -0
- package/types/ibc/applications/transfer/v1/denomtrace.ts +133 -0
- package/types/ibc/applications/transfer/v1/genesis.ts +156 -0
- package/types/ibc/applications/transfer/v1/packet.ts +186 -0
- package/types/ibc/applications/transfer/v1/query.lcd.ts +76 -0
- package/types/ibc/applications/transfer/v1/query.rpc.Query.ts +88 -0
- package/types/ibc/applications/transfer/v1/query.ts +1233 -0
- package/types/ibc/applications/transfer/v1/token.ts +347 -0
- package/types/ibc/applications/transfer/v1/transfer.ts +140 -0
- package/types/ibc/applications/transfer/v1/tx.amino.ts +14 -0
- package/types/ibc/applications/transfer/v1/tx.registry.ts +53 -0
- package/types/ibc/applications/transfer/v1/tx.rpc.msg.ts +29 -0
- package/types/ibc/applications/transfer/v1/tx.ts +579 -0
- package/types/ibc/bundle.ts +265 -0
- package/types/ibc/client.ts +72 -0
- package/types/ibc/core/channel/v1/channel.ts +1455 -0
- package/types/ibc/core/channel/v1/genesis.ts +351 -0
- package/types/ibc/core/channel/v1/query.lcd.ts +135 -0
- package/types/ibc/core/channel/v1/query.rpc.Query.ts +200 -0
- package/types/ibc/core/channel/v1/query.ts +3943 -0
- package/types/ibc/core/channel/v1/tx.amino.ts +54 -0
- package/types/ibc/core/channel/v1/tx.registry.ts +197 -0
- package/types/ibc/core/channel/v1/tx.rpc.msg.ts +96 -0
- package/types/ibc/core/channel/v1/tx.ts +2558 -0
- package/types/ibc/core/channel/v2/genesis.ts +433 -0
- package/types/ibc/core/channel/v2/packet.ts +640 -0
- package/types/ibc/core/channel/v2/query.lcd.ts +77 -0
- package/types/ibc/core/channel/v2/query.rpc.Query.ts +108 -0
- package/types/ibc/core/channel/v2/query.ts +2075 -0
- package/types/ibc/core/channel/v2/tx.amino.ts +24 -0
- package/types/ibc/core/channel/v2/tx.registry.ts +89 -0
- package/types/ibc/core/channel/v2/tx.rpc.msg.ts +45 -0
- package/types/ibc/core/channel/v2/tx.ts +1003 -0
- package/types/ibc/core/client/v1/client.ts +636 -0
- package/types/ibc/core/client/v1/genesis.ts +448 -0
- package/types/ibc/core/client/v1/query.lcd.ts +102 -0
- package/types/ibc/core/client/v1/query.rpc.Query.ts +149 -0
- package/types/ibc/core/client/v1/query.ts +2588 -0
- package/types/ibc/core/client/v1/tx.amino.ts +44 -0
- package/types/ibc/core/client/v1/tx.registry.ts +161 -0
- package/types/ibc/core/client/v1/tx.rpc.msg.ts +77 -0
- package/types/ibc/core/client/v1/tx.ts +1796 -0
- package/types/ibc/core/client/v2/config.ts +115 -0
- package/types/ibc/core/client/v2/counterparty.ts +122 -0
- package/types/ibc/core/client/v2/genesis.ts +220 -0
- package/types/ibc/core/client/v2/query.lcd.ts +25 -0
- package/types/ibc/core/client/v2/query.rpc.Query.ts +42 -0
- package/types/ibc/core/client/v2/query.ts +402 -0
- package/types/ibc/core/client/v2/tx.amino.ts +14 -0
- package/types/ibc/core/client/v2/tx.registry.ts +53 -0
- package/types/ibc/core/client/v2/tx.rpc.msg.ts +29 -0
- package/types/ibc/core/client/v2/tx.ts +453 -0
- package/types/ibc/core/commitment/v1/commitment.ts +321 -0
- package/types/ibc/core/commitment/v2/commitment.ts +193 -0
- package/types/ibc/core/connection/v1/connection.ts +1056 -0
- package/types/ibc/core/connection/v1/genesis.ts +150 -0
- package/types/ibc/core/connection/v1/query.lcd.ts +61 -0
- package/types/ibc/core/connection/v1/query.rpc.Query.ts +97 -0
- package/types/ibc/core/connection/v1/query.ts +1472 -0
- package/types/ibc/core/connection/v1/tx.amino.ts +29 -0
- package/types/ibc/core/connection/v1/tx.registry.ts +107 -0
- package/types/ibc/core/connection/v1/tx.rpc.msg.ts +59 -0
- package/types/ibc/core/connection/v1/tx.ts +1456 -0
- package/types/ibc/core/types/v1/genesis.ts +191 -0
- package/types/ibc/lcd.ts +176 -0
- package/types/ibc/lightclients/solomachine/v2/solomachine.ts +2161 -0
- package/types/ibc/lightclients/solomachine/v3/solomachine.ts +1114 -0
- package/types/ibc/lightclients/tendermint/v1/tendermint.ts +891 -0
- package/types/ibc/lightclients/wasm/v1/genesis.ts +201 -0
- package/types/ibc/lightclients/wasm/v1/query.lcd.ts +34 -0
- package/types/ibc/lightclients/wasm/v1/query.rpc.Query.ts +44 -0
- package/types/ibc/lightclients/wasm/v1/query.ts +413 -0
- package/types/ibc/lightclients/wasm/v1/tx.amino.ts +19 -0
- package/types/ibc/lightclients/wasm/v1/tx.registry.ts +71 -0
- package/types/ibc/lightclients/wasm/v1/tx.rpc.msg.ts +37 -0
- package/types/ibc/lightclients/wasm/v1/tx.ts +640 -0
- package/types/ibc/lightclients/wasm/v1/wasm.ts +444 -0
- package/types/ibc/rpc.query.ts +123 -0
- package/types/ibc/rpc.tx.ts +104 -0
- package/types/index.ts +25 -0
- package/types/tendermint/abci/types.ts +6565 -0
- package/types/tendermint/bundle.ts +33 -0
- package/types/tendermint/crypto/keys.ts +106 -0
- package/types/tendermint/crypto/proof.ts +576 -0
- package/types/tendermint/p2p/types.ts +523 -0
- package/types/tendermint/types/block.ts +134 -0
- package/types/tendermint/types/evidence.ts +491 -0
- package/types/tendermint/types/params.ts +839 -0
- package/types/tendermint/types/types.ts +2266 -0
- package/types/tendermint/types/validator.ts +399 -0
- package/types/tendermint/version/types.ts +228 -0
- package/types/utf8.ts +149 -0
- package/types/varint.ts +489 -0
- package/types/xion/bundle.ts +117 -0
- package/types/xion/client.ts +57 -0
- package/types/xion/feeabs/v1beta1/epoch.ts +386 -0
- package/types/xion/feeabs/v1beta1/genesis.ts +136 -0
- package/types/xion/feeabs/v1beta1/osmosisibc.ts +868 -0
- package/types/xion/feeabs/v1beta1/params.ts +189 -0
- package/types/xion/feeabs/v1beta1/proposal.ts +593 -0
- package/types/xion/feeabs/v1beta1/query.lcd.ts +37 -0
- package/types/xion/feeabs/v1beta1/query.rpc.Query.ts +64 -0
- package/types/xion/feeabs/v1beta1/query.ts +732 -0
- package/types/xion/feeabs/v1beta1/tx.amino.ts +39 -0
- package/types/xion/feeabs/v1beta1/tx.registry.ts +143 -0
- package/types/xion/feeabs/v1beta1/tx.rpc.msg.ts +72 -0
- package/types/xion/feeabs/v1beta1/tx.ts +1261 -0
- package/types/xion/globalfee/v1/genesis.ts +249 -0
- package/types/xion/globalfee/v1/query.lcd.ts +19 -0
- package/types/xion/globalfee/v1/query.rpc.Query.ts +31 -0
- package/types/xion/globalfee/v1/query.ts +178 -0
- package/types/xion/jwk/v1/audience.ts +224 -0
- package/types/xion/jwk/v1/genesis.ts +117 -0
- package/types/xion/jwk/v1/params.ts +113 -0
- package/types/xion/jwk/v1/query.lcd.ts +52 -0
- package/types/xion/jwk/v1/query.rpc.Query.ts +77 -0
- package/types/xion/jwk/v1/query.ts +1697 -0
- package/types/xion/jwk/v1/tx.amino.ts +29 -0
- package/types/xion/jwk/v1/tx.registry.ts +107 -0
- package/types/xion/jwk/v1/tx.rpc.msg.ts +53 -0
- package/types/xion/jwk/v1/tx.ts +1040 -0
- package/types/xion/lcd.ts +147 -0
- package/types/xion/mint/v1/event.ts +216 -0
- package/types/xion/mint/v1/genesis.ts +114 -0
- package/types/xion/mint/v1/mint.ts +307 -0
- package/types/xion/mint/v1/query.lcd.ts +31 -0
- package/types/xion/mint/v1/query.rpc.Query.ts +53 -0
- package/types/xion/mint/v1/query.ts +508 -0
- package/types/xion/mint/v1/tx.amino.ts +9 -0
- package/types/xion/mint/v1/tx.registry.ts +35 -0
- package/types/xion/mint/v1/tx.rpc.msg.ts +26 -0
- package/types/xion/mint/v1/tx.ts +222 -0
- package/types/xion/rpc.query.ts +105 -0
- package/types/xion/rpc.tx.ts +83 -0
- package/types/xion/v1/feegrant.ts +457 -0
- package/types/xion/v1/genesis.ts +116 -0
- package/types/xion/v1/query.rpc.Query.ts +64 -0
- package/types/xion/v1/query.ts +862 -0
- package/types/xion/v1/tx.amino.ts +24 -0
- package/types/xion/v1/tx.registry.ts +89 -0
- package/types/xion/v1/tx.rpc.msg.ts +57 -0
- package/types/xion/v1/tx.ts +793 -0
package/types/binary.ts
ADDED
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* This file and any referenced files were automatically generated by @cosmology/telescope@1.12.20
|
|
4
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
5
|
+
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
|
10
|
+
|
|
11
|
+
// Redistribution and use in source and binary forms, with or without
|
|
12
|
+
// modification, are permitted provided that the following conditions are
|
|
13
|
+
// met:
|
|
14
|
+
|
|
15
|
+
// * Redistributions of source code must retain the above copyright
|
|
16
|
+
// notice, this list of conditions and the following disclaimer.
|
|
17
|
+
// * Redistributions in binary form must reproduce the above copyright
|
|
18
|
+
// notice, this list of conditions and the following disclaimer in the
|
|
19
|
+
// documentation and/or other materials provided with the distribution.
|
|
20
|
+
// * Neither the name of its author, nor the names of its contributors
|
|
21
|
+
// may be used to endorse or promote products derived from this software
|
|
22
|
+
// without specific prior written permission.
|
|
23
|
+
|
|
24
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
25
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
26
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
27
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
28
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
29
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
30
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
31
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
32
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
33
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
34
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
|
+
|
|
36
|
+
// ---
|
|
37
|
+
|
|
38
|
+
// Code generated by the command line utilities is owned by the owner
|
|
39
|
+
// of the input file used when generating it. This code is not
|
|
40
|
+
// standalone and requires a support library to be linked with it. This
|
|
41
|
+
// support library is itself covered by the above license.
|
|
42
|
+
|
|
43
|
+
import { utf8Length, utf8Read, utf8Write } from "./utf8";
|
|
44
|
+
import {
|
|
45
|
+
int64ToString,
|
|
46
|
+
readInt32,
|
|
47
|
+
readUInt32,
|
|
48
|
+
uInt64ToString,
|
|
49
|
+
varint32read,
|
|
50
|
+
varint64read,
|
|
51
|
+
writeVarint32,
|
|
52
|
+
writeVarint64,
|
|
53
|
+
int64FromString,
|
|
54
|
+
int64Length,
|
|
55
|
+
writeFixed32,
|
|
56
|
+
writeByte,
|
|
57
|
+
zzDecode,
|
|
58
|
+
zzEncode,
|
|
59
|
+
} from "./varint";
|
|
60
|
+
|
|
61
|
+
export enum WireType {
|
|
62
|
+
Varint = 0,
|
|
63
|
+
|
|
64
|
+
Fixed64 = 1,
|
|
65
|
+
|
|
66
|
+
Bytes = 2,
|
|
67
|
+
|
|
68
|
+
Fixed32 = 5,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Reader
|
|
72
|
+
export interface IBinaryReader {
|
|
73
|
+
buf: Uint8Array;
|
|
74
|
+
pos: number;
|
|
75
|
+
type: number;
|
|
76
|
+
len: number;
|
|
77
|
+
tag(): [number, WireType, number];
|
|
78
|
+
skip(length?: number): this;
|
|
79
|
+
skipType(wireType: number): this;
|
|
80
|
+
uint32(): number;
|
|
81
|
+
int32(): number;
|
|
82
|
+
sint32(): number;
|
|
83
|
+
fixed32(): number;
|
|
84
|
+
sfixed32(): number;
|
|
85
|
+
int64(): bigint;
|
|
86
|
+
uint64(): bigint;
|
|
87
|
+
sint64(): bigint;
|
|
88
|
+
fixed64(): bigint;
|
|
89
|
+
sfixed64(): bigint;
|
|
90
|
+
float(): number;
|
|
91
|
+
double(): number;
|
|
92
|
+
bool(): boolean;
|
|
93
|
+
bytes(): Uint8Array;
|
|
94
|
+
string(): string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export class BinaryReader implements IBinaryReader {
|
|
98
|
+
buf: Uint8Array;
|
|
99
|
+
pos: number;
|
|
100
|
+
type: number;
|
|
101
|
+
len: number;
|
|
102
|
+
|
|
103
|
+
assertBounds(): void {
|
|
104
|
+
if (this.pos > this.len) throw new RangeError("premature EOF");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
constructor(buf?: ArrayLike<number>) {
|
|
108
|
+
this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0);
|
|
109
|
+
this.pos = 0;
|
|
110
|
+
this.type = 0;
|
|
111
|
+
this.len = this.buf.length;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
tag(): [number, WireType, number] {
|
|
115
|
+
const tag = this.uint32(),
|
|
116
|
+
fieldNo = tag >>> 3,
|
|
117
|
+
wireType = tag & 7;
|
|
118
|
+
if (fieldNo <= 0 || wireType < 0 || wireType > 5)
|
|
119
|
+
throw new Error(
|
|
120
|
+
"illegal tag: field no " + fieldNo + " wire type " + wireType
|
|
121
|
+
);
|
|
122
|
+
return [fieldNo, wireType, tag];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
skip(length?: number) {
|
|
126
|
+
if (typeof length === "number") {
|
|
127
|
+
if (this.pos + length > this.len) throw indexOutOfRange(this, length);
|
|
128
|
+
this.pos += length;
|
|
129
|
+
} else {
|
|
130
|
+
do {
|
|
131
|
+
if (this.pos >= this.len) throw indexOutOfRange(this);
|
|
132
|
+
} while (this.buf[this.pos++] & 128);
|
|
133
|
+
}
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
skipType(wireType: number) {
|
|
138
|
+
switch (wireType) {
|
|
139
|
+
case WireType.Varint:
|
|
140
|
+
this.skip();
|
|
141
|
+
break;
|
|
142
|
+
case WireType.Fixed64:
|
|
143
|
+
this.skip(8);
|
|
144
|
+
break;
|
|
145
|
+
case WireType.Bytes:
|
|
146
|
+
this.skip(this.uint32());
|
|
147
|
+
break;
|
|
148
|
+
case 3:
|
|
149
|
+
while ((wireType = this.uint32() & 7) !== 4) {
|
|
150
|
+
this.skipType(wireType);
|
|
151
|
+
}
|
|
152
|
+
break;
|
|
153
|
+
case WireType.Fixed32:
|
|
154
|
+
this.skip(4);
|
|
155
|
+
break;
|
|
156
|
+
|
|
157
|
+
/* istanbul ignore next */
|
|
158
|
+
default:
|
|
159
|
+
throw Error("invalid wire type " + wireType + " at offset " + this.pos);
|
|
160
|
+
}
|
|
161
|
+
return this;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
uint32(): number {
|
|
165
|
+
return varint32read.bind(this)();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
int32(): number {
|
|
169
|
+
return this.uint32() | 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
sint32(): number {
|
|
173
|
+
const num = this.uint32();
|
|
174
|
+
return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
fixed32(): number {
|
|
178
|
+
const val = readUInt32(this.buf, this.pos);
|
|
179
|
+
this.pos += 4;
|
|
180
|
+
return val;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
sfixed32(): number {
|
|
184
|
+
const val = readInt32(this.buf, this.pos);
|
|
185
|
+
this.pos += 4;
|
|
186
|
+
return val;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
int64(): bigint {
|
|
190
|
+
const [lo, hi] = varint64read.bind(this)();
|
|
191
|
+
return BigInt(int64ToString(lo, hi));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
uint64(): bigint {
|
|
195
|
+
const [lo, hi] = varint64read.bind(this)();
|
|
196
|
+
return BigInt(uInt64ToString(lo, hi));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
sint64(): bigint {
|
|
200
|
+
let [lo, hi] = varint64read.bind(this)();
|
|
201
|
+
// zig zag
|
|
202
|
+
[lo, hi] = zzDecode(lo, hi);
|
|
203
|
+
return BigInt(int64ToString(lo, hi));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
fixed64(): bigint {
|
|
207
|
+
const lo = this.sfixed32();
|
|
208
|
+
const hi = this.sfixed32();
|
|
209
|
+
return BigInt(uInt64ToString(lo, hi));
|
|
210
|
+
}
|
|
211
|
+
sfixed64(): bigint {
|
|
212
|
+
const lo = this.sfixed32();
|
|
213
|
+
const hi = this.sfixed32();
|
|
214
|
+
return BigInt(int64ToString(lo, hi));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
float(): number {
|
|
218
|
+
throw new Error("float not supported");
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
double(): number {
|
|
222
|
+
throw new Error("double not supported");
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
bool(): boolean {
|
|
226
|
+
const [lo, hi] = varint64read.bind(this)();
|
|
227
|
+
return lo !== 0 || hi !== 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
bytes(): Uint8Array {
|
|
231
|
+
const len = this.uint32(),
|
|
232
|
+
start = this.pos;
|
|
233
|
+
this.pos += len;
|
|
234
|
+
this.assertBounds();
|
|
235
|
+
return this.buf.subarray(start, start + len);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
string(): string {
|
|
239
|
+
const bytes = this.bytes();
|
|
240
|
+
return utf8Read(bytes, 0, bytes.length);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Writer
|
|
245
|
+
export interface IBinaryWriter {
|
|
246
|
+
len: number;
|
|
247
|
+
head: IOp;
|
|
248
|
+
tail: IOp;
|
|
249
|
+
states: State | null;
|
|
250
|
+
finish(): Uint8Array;
|
|
251
|
+
fork(): IBinaryWriter;
|
|
252
|
+
reset(): IBinaryWriter;
|
|
253
|
+
ldelim(): IBinaryWriter;
|
|
254
|
+
tag(fieldNo: number, type: WireType): IBinaryWriter;
|
|
255
|
+
uint32(value: number): IBinaryWriter;
|
|
256
|
+
int32(value: number): IBinaryWriter;
|
|
257
|
+
sint32(value: number): IBinaryWriter;
|
|
258
|
+
int64(value: string | number | bigint): IBinaryWriter;
|
|
259
|
+
uint64: (value: string | number | bigint) => IBinaryWriter;
|
|
260
|
+
sint64(value: string | number | bigint): IBinaryWriter;
|
|
261
|
+
fixed64(value: string | number | bigint): IBinaryWriter;
|
|
262
|
+
sfixed64: (value: string | number | bigint) => IBinaryWriter;
|
|
263
|
+
bool(value: boolean): IBinaryWriter;
|
|
264
|
+
fixed32(value: number): IBinaryWriter;
|
|
265
|
+
sfixed32: (value: number) => IBinaryWriter;
|
|
266
|
+
float(value: number): IBinaryWriter;
|
|
267
|
+
double(value: number): IBinaryWriter;
|
|
268
|
+
bytes(value: Uint8Array): IBinaryWriter;
|
|
269
|
+
string(value: string): IBinaryWriter;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
interface IOp {
|
|
273
|
+
len: number;
|
|
274
|
+
next?: IOp;
|
|
275
|
+
proceed(buf: Uint8Array | number[], pos: number): void;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
class Op<T> implements IOp {
|
|
279
|
+
fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null;
|
|
280
|
+
len: number;
|
|
281
|
+
val: T;
|
|
282
|
+
next?: IOp;
|
|
283
|
+
|
|
284
|
+
constructor(
|
|
285
|
+
fn:
|
|
286
|
+
| ((
|
|
287
|
+
val: T,
|
|
288
|
+
buf: Uint8Array | number[],
|
|
289
|
+
pos: number
|
|
290
|
+
) => void | undefined | null)
|
|
291
|
+
| null,
|
|
292
|
+
len: number,
|
|
293
|
+
val: T
|
|
294
|
+
) {
|
|
295
|
+
this.fn = fn;
|
|
296
|
+
this.len = len;
|
|
297
|
+
this.val = val;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
proceed(buf: Uint8Array | number[], pos: number) {
|
|
301
|
+
if (this.fn) {
|
|
302
|
+
this.fn(this.val, buf, pos);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
class State {
|
|
308
|
+
head: IOp;
|
|
309
|
+
tail: IOp;
|
|
310
|
+
len: number;
|
|
311
|
+
next: State | null;
|
|
312
|
+
|
|
313
|
+
constructor(writer: BinaryWriter) {
|
|
314
|
+
this.head = writer.head;
|
|
315
|
+
this.tail = writer.tail;
|
|
316
|
+
this.len = writer.len;
|
|
317
|
+
this.next = writer.states;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export class BinaryWriter implements IBinaryWriter {
|
|
322
|
+
len = 0;
|
|
323
|
+
head: IOp;
|
|
324
|
+
tail: IOp;
|
|
325
|
+
states: State | null;
|
|
326
|
+
|
|
327
|
+
constructor() {
|
|
328
|
+
this.head = new Op(null, 0, 0);
|
|
329
|
+
this.tail = this.head;
|
|
330
|
+
this.states = null;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
static create() {
|
|
334
|
+
return new BinaryWriter();
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
static alloc(size: number): Uint8Array | number[] {
|
|
338
|
+
if (typeof Uint8Array !== "undefined") {
|
|
339
|
+
return pool(
|
|
340
|
+
(size) => new Uint8Array(size),
|
|
341
|
+
Uint8Array.prototype.subarray
|
|
342
|
+
)(size);
|
|
343
|
+
} else {
|
|
344
|
+
return new Array(size);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
private _push<T>(
|
|
349
|
+
fn: (val: T, buf: Uint8Array | number[], pos: number) => void,
|
|
350
|
+
len: number,
|
|
351
|
+
val: T
|
|
352
|
+
) {
|
|
353
|
+
this.tail = this.tail.next = new Op(fn, len, val);
|
|
354
|
+
this.len += len;
|
|
355
|
+
return this;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
finish(): Uint8Array {
|
|
359
|
+
let head = this.head.next,
|
|
360
|
+
pos = 0;
|
|
361
|
+
const buf = BinaryWriter.alloc(this.len);
|
|
362
|
+
while (head) {
|
|
363
|
+
head.proceed(buf, pos);
|
|
364
|
+
pos += head.len;
|
|
365
|
+
head = head.next;
|
|
366
|
+
}
|
|
367
|
+
return buf as Uint8Array;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
fork(): BinaryWriter {
|
|
371
|
+
this.states = new State(this);
|
|
372
|
+
this.head = this.tail = new Op(null, 0, 0);
|
|
373
|
+
this.len = 0;
|
|
374
|
+
return this;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
reset(): BinaryWriter {
|
|
378
|
+
if (this.states) {
|
|
379
|
+
this.head = this.states.head;
|
|
380
|
+
this.tail = this.states.tail;
|
|
381
|
+
this.len = this.states.len;
|
|
382
|
+
this.states = this.states.next;
|
|
383
|
+
} else {
|
|
384
|
+
this.head = this.tail = new Op(null, 0, 0);
|
|
385
|
+
this.len = 0;
|
|
386
|
+
}
|
|
387
|
+
return this;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
ldelim(): BinaryWriter {
|
|
391
|
+
const head = this.head,
|
|
392
|
+
tail = this.tail,
|
|
393
|
+
len = this.len;
|
|
394
|
+
this.reset().uint32(len);
|
|
395
|
+
if (len) {
|
|
396
|
+
this.tail.next = head.next; // skip noop
|
|
397
|
+
this.tail = tail;
|
|
398
|
+
this.len += len;
|
|
399
|
+
}
|
|
400
|
+
return this;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
tag(fieldNo: number, type: WireType): BinaryWriter {
|
|
404
|
+
return this.uint32(((fieldNo << 3) | type) >>> 0);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
uint32(value: number): BinaryWriter {
|
|
408
|
+
this.len += (this.tail = this.tail.next =
|
|
409
|
+
new Op(
|
|
410
|
+
writeVarint32,
|
|
411
|
+
(value = value >>> 0) < 128
|
|
412
|
+
? 1
|
|
413
|
+
: value < 16384
|
|
414
|
+
? 2
|
|
415
|
+
: value < 2097152
|
|
416
|
+
? 3
|
|
417
|
+
: value < 268435456
|
|
418
|
+
? 4
|
|
419
|
+
: 5,
|
|
420
|
+
value
|
|
421
|
+
)).len;
|
|
422
|
+
return this;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
int32(value: number): BinaryWriter {
|
|
426
|
+
return value < 0
|
|
427
|
+
? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec
|
|
428
|
+
: this.uint32(value);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
sint32(value: number): BinaryWriter {
|
|
432
|
+
return this.uint32(((value << 1) ^ (value >> 31)) >>> 0);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
int64(value: string | number | bigint): BinaryWriter {
|
|
436
|
+
const { lo, hi } = int64FromString(value.toString());
|
|
437
|
+
return this._push(writeVarint64, int64Length(lo, hi), { lo, hi });
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// uint64 is the same with int64
|
|
441
|
+
uint64 = BinaryWriter.prototype.int64;
|
|
442
|
+
|
|
443
|
+
sint64(value: string | number | bigint): BinaryWriter {
|
|
444
|
+
let { lo, hi } = int64FromString(value.toString());
|
|
445
|
+
// zig zag
|
|
446
|
+
[lo, hi] = zzEncode(lo, hi);
|
|
447
|
+
return this._push(writeVarint64, int64Length(lo, hi), { lo, hi });
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
fixed64(value: string | number | bigint): BinaryWriter {
|
|
451
|
+
const { lo, hi } = int64FromString(value.toString());
|
|
452
|
+
return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// sfixed64 is the same with fixed64
|
|
456
|
+
sfixed64 = BinaryWriter.prototype.fixed64;
|
|
457
|
+
|
|
458
|
+
bool(value: boolean): BinaryWriter {
|
|
459
|
+
return this._push(writeByte, 1, value ? 1 : 0);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
fixed32(value: number): BinaryWriter {
|
|
463
|
+
return this._push(writeFixed32, 4, value >>> 0);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// sfixed32 is the same with fixed32
|
|
467
|
+
sfixed32 = BinaryWriter.prototype.fixed32;
|
|
468
|
+
|
|
469
|
+
float(value: number): BinaryWriter {
|
|
470
|
+
throw new Error("float not supported" + value);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
double(value: number): BinaryWriter {
|
|
474
|
+
throw new Error("double not supported" + value);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
bytes(value: Uint8Array): BinaryWriter {
|
|
478
|
+
const len = value.length >>> 0;
|
|
479
|
+
if (!len) return this._push(writeByte, 1, 0);
|
|
480
|
+
return this.uint32(len)._push(writeBytes, len, value);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
string(value: string): BinaryWriter {
|
|
484
|
+
const len = utf8Length(value);
|
|
485
|
+
return len
|
|
486
|
+
? this.uint32(len)._push(utf8Write, len, value)
|
|
487
|
+
: this._push(writeByte, 1, 0);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function writeBytes(
|
|
492
|
+
val: Uint8Array | number[],
|
|
493
|
+
buf: Uint8Array | number[],
|
|
494
|
+
pos: number
|
|
495
|
+
) {
|
|
496
|
+
if (typeof Uint8Array !== "undefined") {
|
|
497
|
+
(buf as Uint8Array).set(val, pos);
|
|
498
|
+
} else {
|
|
499
|
+
for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i];
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function pool(
|
|
504
|
+
alloc: (size: number) => Uint8Array,
|
|
505
|
+
slice: (begin?: number, end?: number) => Uint8Array,
|
|
506
|
+
size?: number
|
|
507
|
+
): (size: number) => Uint8Array {
|
|
508
|
+
const SIZE = size || 8192;
|
|
509
|
+
const MAX = SIZE >>> 1;
|
|
510
|
+
let slab: Uint8Array | null = null;
|
|
511
|
+
let offset = SIZE;
|
|
512
|
+
return function pool_alloc(size): Uint8Array {
|
|
513
|
+
if (size < 1 || size > MAX) return alloc(size);
|
|
514
|
+
if (offset + size > SIZE) {
|
|
515
|
+
slab = alloc(SIZE);
|
|
516
|
+
offset = 0;
|
|
517
|
+
}
|
|
518
|
+
const buf: Uint8Array = slice.call(slab, offset, (offset += size));
|
|
519
|
+
if (offset & 7)
|
|
520
|
+
// align to 32 bit
|
|
521
|
+
offset = (offset | 7) + 1;
|
|
522
|
+
return buf;
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function indexOutOfRange(reader: BinaryReader, writeLength?: number) {
|
|
527
|
+
return RangeError(
|
|
528
|
+
"index out of range: " +
|
|
529
|
+
reader.pos +
|
|
530
|
+
" + " +
|
|
531
|
+
(writeLength || 1) +
|
|
532
|
+
" > " +
|
|
533
|
+
reader.len
|
|
534
|
+
);
|
|
535
|
+
}
|