From 7e2341c051a76cda5b0dae84b5bb85818f063655 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 27 Jan 2025 07:19:00 +0800 Subject: [PATCH 1/3] upgrade telescope to 1.11.12 and regen --- .telescope.json | 5 +- libs/cosmos-types/src/binary.ts | 2 +- libs/cosmos-types/src/extern.ts | 2 +- libs/cosmos-types/src/helper-func-types.ts | 6 +- libs/cosmos-types/src/helpers.ts | 2 +- libs/cosmos-types/src/types.ts | 3 +- libs/cosmos-types/src/utf8.ts | 2 +- libs/cosmos-types/src/varint.ts | 2 +- libs/injective-react/README.md | 4 +- libs/injective-react/src/binary.ts | 2 +- .../src/cosmos/auth/v1beta1/query.rpc.func.ts | 41 - .../cosmos/auth/v1beta1/query.rpc.react.ts | 43 + .../src/cosmos/authz/v1beta1/tx.rpc.func.ts | 10 - .../src/cosmos/authz/v1beta1/tx.rpc.react.ts | 12 + .../src/cosmos/bank/v1beta1/query.rpc.func.ts | 53 - .../cosmos/bank/v1beta1/query.rpc.react.ts | 55 + .../src/cosmos/bank/v1beta1/tx.rpc.func.ts | 13 - .../src/cosmos/bank/v1beta1/tx.rpc.react.ts | 15 + .../distribution/v1beta1/tx.rpc.func.ts | 22 - .../distribution/v1beta1/tx.rpc.react.ts | 24 + .../cosmos/feegrant/v1beta1/tx.rpc.func.ts | 10 - .../cosmos/feegrant/v1beta1/tx.rpc.react.ts | 12 + .../src/cosmos/gov/v1/tx.rpc.func.ts | 22 - .../src/cosmos/gov/v1/tx.rpc.react.ts | 24 + .../src/cosmos/gov/v1beta1/query.rpc.func.ts | 33 - .../src/cosmos/gov/v1beta1/query.rpc.react.ts | 35 + .../src/cosmos/gov/v1beta1/tx.rpc.func.ts | 13 - .../src/cosmos/gov/v1beta1/tx.rpc.react.ts | 15 + .../src/cosmos/group/v1/tx.rpc.func.ts | 43 - .../src/cosmos/group/v1/tx.rpc.react.ts | 45 + .../cosmos/staking/v1beta1/query.rpc.func.ts | 57 - .../cosmos/staking/v1beta1/query.rpc.react.ts | 59 + .../src/cosmos/staking/v1beta1/tx.rpc.func.ts | 22 - .../cosmos/staking/v1beta1/tx.rpc.react.ts | 24 + .../src/cosmos/tx/v1beta1/service.rpc.func.ts | 37 - .../cosmos/tx/v1beta1/service.rpc.react.ts | 39 + .../src/cosmos/vesting/v1beta1/tx.rpc.func.ts | 10 - .../cosmos/vesting/v1beta1/tx.rpc.react.ts | 12 + .../src/cosmwasm/wasm/v1/query.rpc.func.ts | 57 - .../src/cosmwasm/wasm/v1/query.rpc.react.ts | 59 + .../src/cosmwasm/wasm/v1/tx.rpc.func.ts | 52 - .../src/cosmwasm/wasm/v1/tx.rpc.react.ts | 54 + libs/injective-react/src/extern.ts | 2 +- libs/injective-react/src/helper-func-types.ts | 2 +- libs/injective-react/src/helpers.ts | 2 +- .../applications/transfer/v1/tx.rpc.func.ts | 7 - .../applications/transfer/v1/tx.rpc.react.ts | 9 + .../src/ibc/core/channel/v1/tx.rpc.func.ts | 58 - .../src/ibc/core/channel/v1/tx.rpc.react.ts | 60 + .../src/ibc/core/client/v1/tx.rpc.func.ts | 22 - .../src/ibc/core/client/v1/tx.rpc.react.ts | 24 + .../src/ibc/core/connection/v1/tx.rpc.func.ts | 16 - .../ibc/core/connection/v1/tx.rpc.react.ts | 18 + .../auction/v1beta1/query.rpc.func.ts | 17 - .../auction/v1beta1/query.rpc.react.ts | 19 + .../injective/auction/v1beta1/tx.rpc.func.ts | 7 - .../injective/auction/v1beta1/tx.rpc.react.ts | 9 + .../exchange/v1beta1/query.rpc.func.ts | 241 -- .../exchange/v1beta1/query.rpc.react.ts | 243 ++ .../injective/exchange/v1beta1/tx.rpc.func.ts | 106 - .../exchange/v1beta1/tx.rpc.react.ts | 108 + .../insurance/v1beta1/query.rpc.func.ts | 25 - .../insurance/v1beta1/query.rpc.react.ts | 27 + .../insurance/v1beta1/tx.rpc.func.ts | 13 - .../insurance/v1beta1/tx.rpc.react.ts | 15 + .../injective/ocr/v1beta1/query.rpc.func.ts | 29 - .../injective/ocr/v1beta1/query.rpc.react.ts | 31 + .../src/injective/ocr/v1beta1/tx.rpc.func.ts | 28 - .../src/injective/ocr/v1beta1/tx.rpc.react.ts | 30 + .../oracle/v1beta1/query.rpc.func.ts | 69 - .../oracle/v1beta1/query.rpc.react.ts | 71 + .../injective/oracle/v1beta1/tx.rpc.func.ts | 25 - .../injective/oracle/v1beta1/tx.rpc.react.ts | 27 + .../src/injective/peggy/v1/msgs.rpc.func.ts | 43 - .../src/injective/peggy/v1/msgs.rpc.react.ts | 45 + .../src/injective/peggy/v1/query.rpc.func.ts | 85 - .../src/injective/peggy/v1/query.rpc.react.ts | 87 + .../permissions/v1beta1/query.rpc.func.ts | 25 - .../permissions/v1beta1/query.rpc.react.ts | 27 + .../permissions/v1beta1/tx.rpc.func.ts | 22 - .../permissions/v1beta1/tx.rpc.react.ts | 24 + .../tokenfactory/v1beta1/query.rpc.func.ts | 17 - .../tokenfactory/v1beta1/query.rpc.react.ts | 19 + .../tokenfactory/v1beta1/tx.rpc.func.ts | 19 - .../tokenfactory/v1beta1/tx.rpc.react.ts | 21 + .../src/injective/wasmx/v1/query.rpc.func.ts | 13 - .../src/injective/wasmx/v1/query.rpc.react.ts | 15 + .../src/injective/wasmx/v1/tx.rpc.func.ts | 19 - .../src/injective/wasmx/v1/tx.rpc.react.ts | 21 + libs/injective-react/src/react-query.ts | 2 +- libs/injective-react/src/registry.ts | 2 +- libs/injective-react/src/types.ts | 2 +- libs/injective-react/src/utf8.ts | 2 +- libs/injective-react/src/varint.ts | 2 +- libs/injective-vue/src/binary.ts | 2 +- .../src/cosmos/auth/v1beta1/auth.ts | 23 - .../cosmos/auth/v1beta1/query.rpc.Query.ts | 528 ---- .../src/cosmos/auth/v1beta1/query.rpc.func.ts | 72 + .../src/cosmos/auth/v1beta1/query.rpc.vue.ts | 43 + .../src/cosmos/auth/v1beta1/query.ts | 57 - .../src/cosmos/authz/v1beta1/authz.ts | 17 - .../src/cosmos/authz/v1beta1/tx.amino.ts | 18 - .../src/cosmos/authz/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/authz/v1beta1/tx.rpc.msg.ts | 57 - .../src/cosmos/authz/v1beta1/tx.rpc.vue.ts | 12 + .../src/cosmos/authz/v1beta1/tx.ts | 20 - .../src/cosmos/bank/v1beta1/bank.ts | 35 - .../cosmos/bank/v1beta1/query.rpc.Query.ts | 720 ----- .../src/cosmos/bank/v1beta1/query.rpc.func.ts | 93 + .../src/cosmos/bank/v1beta1/query.rpc.vue.ts | 55 + .../src/cosmos/bank/v1beta1/query.ts | 96 - .../src/cosmos/bank/v1beta1/tx.amino.ts | 23 - .../src/cosmos/bank/v1beta1/tx.rpc.func.ts | 27 + .../src/cosmos/bank/v1beta1/tx.rpc.msg.ts | 67 - .../src/cosmos/bank/v1beta1/tx.rpc.vue.ts | 15 + .../src/cosmos/bank/v1beta1/tx.ts | 23 - .../src/cosmos/base/abci/v1beta1/abci.ts | 67 - .../cosmos/base/query/v1beta1/pagination.ts | 12 - .../src/cosmos/base/v1beta1/coin.ts | 15 - .../src/cosmos/crypto/ed25519/keys.ts | 7 - .../crypto/multisig/v1beta1/multisig.ts | 8 - .../src/cosmos/crypto/secp256k1/keys.ts | 7 - .../src/cosmos/crypto/secp256r1/keys.ts | 7 - .../distribution/v1beta1/distribution.ts | 53 - .../cosmos/distribution/v1beta1/tx.amino.ts | 38 - .../distribution/v1beta1/tx.rpc.func.ts | 45 + .../cosmos/distribution/v1beta1/tx.rpc.msg.ts | 115 - .../cosmos/distribution/v1beta1/tx.rpc.vue.ts | 24 + .../src/cosmos/distribution/v1beta1/tx.ts | 41 - .../src/cosmos/feegrant/v1beta1/tx.amino.ts | 18 - .../cosmos/feegrant/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts | 53 - .../src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts | 12 + .../src/cosmos/feegrant/v1beta1/tx.ts | 16 - libs/injective-vue/src/cosmos/gov/v1/gov.ts | 69 - .../src/cosmos/gov/v1/tx.amino.ts | 38 - .../src/cosmos/gov/v1/tx.rpc.func.ts | 45 + .../src/cosmos/gov/v1/tx.rpc.msg.ts | 89 - .../src/cosmos/gov/v1/tx.rpc.vue.ts | 24 + libs/injective-vue/src/cosmos/gov/v1/tx.ts | 52 - .../src/cosmos/gov/v1beta1/gov.ts | 49 - .../src/cosmos/gov/v1beta1/query.rpc.Query.ts | 360 --- .../src/cosmos/gov/v1beta1/query.rpc.func.ts | 58 + .../src/cosmos/gov/v1beta1/query.rpc.vue.ts | 35 + .../src/cosmos/gov/v1beta1/query.ts | 61 - .../src/cosmos/gov/v1beta1/tx.amino.ts | 23 - .../src/cosmos/gov/v1beta1/tx.rpc.func.ts | 27 + .../src/cosmos/gov/v1beta1/tx.rpc.msg.ts | 53 - .../src/cosmos/gov/v1beta1/tx.rpc.vue.ts | 15 + .../src/cosmos/gov/v1beta1/tx.ts | 27 - .../src/cosmos/group/v1/tx.amino.ts | 73 - .../src/cosmos/group/v1/tx.rpc.func.ts | 87 + .../src/cosmos/group/v1/tx.rpc.msg.ts | 127 - .../src/cosmos/group/v1/tx.rpc.vue.ts | 45 + libs/injective-vue/src/cosmos/group/v1/tx.ts | 103 - .../src/cosmos/group/v1/types.ts | 74 - .../src/cosmos/ics23/v1/proofs.ts | 71 - libs/injective-vue/src/cosmos/rpc.query.ts | 29 - libs/injective-vue/src/cosmos/rpc.tx.ts | 34 - .../cosmos/staking/v1beta1/query.rpc.Query.ts | 720 ----- .../cosmos/staking/v1beta1/query.rpc.func.ts | 100 + .../cosmos/staking/v1beta1/query.rpc.vue.ts | 59 + .../src/cosmos/staking/v1beta1/query.ts | 100 - .../src/cosmos/staking/v1beta1/staking.ts | 113 - .../src/cosmos/staking/v1beta1/tx.amino.ts | 38 - .../src/cosmos/staking/v1beta1/tx.rpc.func.ts | 45 + .../src/cosmos/staking/v1beta1/tx.rpc.msg.ts | 97 - .../src/cosmos/staking/v1beta1/tx.rpc.vue.ts | 24 + .../src/cosmos/staking/v1beta1/tx.ts | 54 - .../src/cosmos/tx/signing/v1beta1/signing.ts | 21 - .../cosmos/tx/v1beta1/service.rpc.Service.ts | 455 --- .../src/cosmos/tx/v1beta1/service.rpc.func.ts | 65 + .../src/cosmos/tx/v1beta1/service.rpc.vue.ts | 39 + .../src/cosmos/tx/v1beta1/service.ts | 71 - .../injective-vue/src/cosmos/tx/v1beta1/tx.ts | 69 - .../src/cosmos/upgrade/v1beta1/upgrade.ts | 21 - .../src/cosmos/vesting/v1beta1/tx.amino.ts | 18 - .../src/cosmos/vesting/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/vesting/v1beta1/tx.rpc.msg.ts | 59 - .../src/cosmos/vesting/v1beta1/tx.rpc.vue.ts | 12 + .../src/cosmos/vesting/v1beta1/tx.ts | 22 - .../src/cosmos/vesting/v1beta1/vesting.ts | 27 - libs/injective-vue/src/cosmos_proto/cosmos.ts | 10 - libs/injective-vue/src/cosmwasm/rpc.query.ts | 34 - libs/injective-vue/src/cosmwasm/rpc.tx.ts | 39 - .../src/cosmwasm/wasm/v1/proposal_legacy.ts | 100 - .../src/cosmwasm/wasm/v1/query.rpc.Query.ts | 612 ---- .../src/cosmwasm/wasm/v1/query.rpc.func.ts | 100 + .../src/cosmwasm/wasm/v1/query.rpc.vue.ts | 59 + .../src/cosmwasm/wasm/v1/query.ts | 107 - .../src/cosmwasm/wasm/v1/tx.amino.ts | 88 - .../src/cosmwasm/wasm/v1/tx.rpc.func.ts | 105 + .../src/cosmwasm/wasm/v1/tx.rpc.msg.ts | 225 -- .../src/cosmwasm/wasm/v1/tx.rpc.vue.ts | 54 + libs/injective-vue/src/cosmwasm/wasm/v1/tx.ts | 139 - .../src/cosmwasm/wasm/v1/types.ts | 40 - libs/injective-vue/src/extern.ts | 21 +- libs/injective-vue/src/google/api/http.ts | 21 - libs/injective-vue/src/google/protobuf/any.ts | 5 - .../src/google/protobuf/descriptor.ts | 237 -- .../src/google/protobuf/duration.ts | 5 - .../src/google/protobuf/timestamp.ts | 5 - libs/injective-vue/src/helper-func-types.ts | 191 ++ libs/injective-vue/src/helpers.ts | 2 +- .../ibc/applications/transfer/v1/transfer.ts | 13 - .../ibc/applications/transfer/v1/tx.amino.ts | 13 - .../applications/transfer/v1/tx.rpc.func.ts | 15 + .../applications/transfer/v1/tx.rpc.msg.ts | 31 - .../applications/transfer/v1/tx.rpc.vue.ts | 9 + .../src/ibc/applications/transfer/v1/tx.ts | 21 - .../src/ibc/core/channel/v1/channel.ts | 55 - .../src/ibc/core/channel/v1/tx.amino.ts | 98 - .../src/ibc/core/channel/v1/tx.rpc.func.ts | 117 + .../src/ibc/core/channel/v1/tx.rpc.msg.ts | 171 -- .../src/ibc/core/channel/v1/tx.rpc.vue.ts | 60 + .../src/ibc/core/channel/v1/tx.ts | 191 -- .../src/ibc/core/channel/v1/upgrade.ts | 15 - .../src/ibc/core/client/v1/client.ts | 20 - .../src/ibc/core/client/v1/tx.amino.ts | 38 - .../src/ibc/core/client/v1/tx.rpc.func.ts | 45 + .../src/ibc/core/client/v1/tx.rpc.msg.ts | 71 - .../src/ibc/core/client/v1/tx.rpc.vue.ts | 24 + .../src/ibc/core/client/v1/tx.ts | 47 - .../src/ibc/core/commitment/v1/commitment.ts | 10 - .../src/ibc/core/connection/v1/connection.ts | 35 - .../src/ibc/core/connection/v1/tx.amino.ts | 28 - .../src/ibc/core/connection/v1/tx.rpc.func.ts | 33 + .../src/ibc/core/connection/v1/tx.rpc.msg.ts | 63 - .../src/ibc/core/connection/v1/tx.rpc.vue.ts | 18 + .../src/ibc/core/connection/v1/tx.ts | 51 - libs/injective-vue/src/ibc/rpc.tx.ts | 52 - .../src/injective/auction/v1beta1/auction.ts | 29 - .../src/injective/auction/v1beta1/genesis.ts | 8 - .../auction/v1beta1/query.rpc.Query.ts | 199 -- .../auction/v1beta1/query.rpc.func.ts | 30 + .../auction/v1beta1/query.rpc.vue.ts | 19 + .../src/injective/auction/v1beta1/query.ts | 21 - .../src/injective/auction/v1beta1/tx.amino.ts | 13 - .../injective/auction/v1beta1/tx.rpc.func.ts | 15 + .../injective/auction/v1beta1/tx.rpc.msg.ts | 30 - .../injective/auction/v1beta1/tx.rpc.vue.ts | 9 + .../src/injective/auction/v1beta1/tx.ts | 12 - .../crypto/v1beta1/ethsecp256k1/keys.ts | 7 - .../src/injective/exchange/v1beta1/authz.ts | 46 - .../src/injective/exchange/v1beta1/events.ts | 176 -- .../injective/exchange/v1beta1/exchange.ts | 336 --- .../src/injective/exchange/v1beta1/genesis.ts | 112 - .../injective/exchange/v1beta1/proposal.ts | 206 -- .../exchange/v1beta1/query.rpc.Query.ts | 2479 ----------------- .../exchange/v1beta1/query.rpc.func.ts | 422 +++ .../exchange/v1beta1/query.rpc.vue.ts | 243 ++ .../src/injective/exchange/v1beta1/query.ts | 483 ---- .../injective/exchange/v1beta1/tx.amino.ts | 178 -- .../injective/exchange/v1beta1/tx.rpc.func.ts | 213 ++ .../injective/exchange/v1beta1/tx.rpc.msg.ts | 376 --- .../injective/exchange/v1beta1/tx.rpc.vue.ts | 108 + .../src/injective/exchange/v1beta1/tx.ts | 352 --- .../src/injective/insurance/v1beta1/events.ts | 22 - .../injective/insurance/v1beta1/genesis.ts | 8 - .../injective/insurance/v1beta1/insurance.ts | 24 - .../insurance/v1beta1/query.rpc.Query.ts | 288 -- .../insurance/v1beta1/query.rpc.func.ts | 44 + .../insurance/v1beta1/query.rpc.vue.ts | 27 + .../src/injective/insurance/v1beta1/query.ts | 33 - .../injective/insurance/v1beta1/tx.amino.ts | 23 - .../insurance/v1beta1/tx.rpc.func.ts | 27 + .../injective/insurance/v1beta1/tx.rpc.msg.ts | 54 - .../injective/insurance/v1beta1/tx.rpc.vue.ts | 15 + .../src/injective/insurance/v1beta1/tx.ts | 29 - .../src/injective/ocr/v1beta1/genesis.ts | 41 - .../src/injective/ocr/v1beta1/ocr.ts | 136 - .../injective/ocr/v1beta1/query.rpc.Query.ts | 327 --- .../injective/ocr/v1beta1/query.rpc.func.ts | 51 + .../injective/ocr/v1beta1/query.rpc.vue.ts | 31 + .../src/injective/ocr/v1beta1/query.ts | 44 - .../src/injective/ocr/v1beta1/tx.amino.ts | 48 - .../src/injective/ocr/v1beta1/tx.rpc.func.ts | 57 + .../src/injective/ocr/v1beta1/tx.rpc.msg.ts | 102 - .../src/injective/ocr/v1beta1/tx.rpc.vue.ts | 30 + .../src/injective/ocr/v1beta1/tx.ts | 66 - .../src/injective/oracle/v1beta1/events.ts | 55 - .../src/injective/oracle/v1beta1/genesis.ts | 24 - .../src/injective/oracle/v1beta1/oracle.ts | 139 - .../src/injective/oracle/v1beta1/proposal.ts | 63 - .../oracle/v1beta1/query.rpc.Query.ts | 716 ----- .../oracle/v1beta1/query.rpc.func.ts | 121 + .../injective/oracle/v1beta1/query.rpc.vue.ts | 71 + .../src/injective/oracle/v1beta1/query.ts | 108 - .../src/injective/oracle/v1beta1/tx.amino.ts | 43 - .../injective/oracle/v1beta1/tx.rpc.func.ts | 51 + .../injective/oracle/v1beta1/tx.rpc.msg.ts | 95 - .../injective/oracle/v1beta1/tx.rpc.vue.ts | 27 + .../src/injective/oracle/v1beta1/tx.ts | 49 - .../src/injective/peggy/v1/attestation.ts | 11 - .../src/injective/peggy/v1/batch.ts | 15 - .../src/injective/peggy/v1/events.ts | 111 - .../src/injective/peggy/v1/genesis.ts | 18 - .../src/injective/peggy/v1/msgs.amino.ts | 73 - .../src/injective/peggy/v1/msgs.rpc.func.ts | 87 + .../src/injective/peggy/v1/msgs.rpc.msg.ts | 118 - .../src/injective/peggy/v1/msgs.rpc.vue.ts | 45 + .../src/injective/peggy/v1/msgs.ts | 100 - .../src/injective/peggy/v1/params.ts | 25 - .../src/injective/peggy/v1/pool.ts | 8 - .../src/injective/peggy/v1/proposal.ts | 11 - .../src/injective/peggy/v1/query.rpc.Query.ts | 864 ------ .../src/injective/peggy/v1/query.rpc.func.ts | 149 + .../src/injective/peggy/v1/query.rpc.vue.ts | 87 + .../src/injective/peggy/v1/query.ts | 122 - .../src/injective/peggy/v1/types.ts | 24 - .../injective/permissions/v1beta1/events.ts | 5 - .../injective/permissions/v1beta1/genesis.ts | 5 - .../injective/permissions/v1beta1/params.ts | 4 - .../permissions/v1beta1/permissions.ts | 28 - .../permissions/v1beta1/query.rpc.Query.ts | 331 --- .../permissions/v1beta1/query.rpc.func.ts | 44 + .../permissions/v1beta1/query.rpc.vue.ts | 27 + .../injective/permissions/v1beta1/query.ts | 36 - .../injective/permissions/v1beta1/tx.amino.ts | 38 - .../permissions/v1beta1/tx.rpc.func.ts | 45 + .../permissions/v1beta1/tx.rpc.msg.ts | 64 - .../permissions/v1beta1/tx.rpc.vue.ts | 24 + .../src/injective/permissions/v1beta1/tx.ts | 55 - libs/injective-vue/src/injective/rpc.query.ts | 58 - libs/injective-vue/src/injective/rpc.tx.ts | 63 - .../src/injective/stream/v1beta1/query.ts | 133 - .../tokenfactory/v1beta1/authorityMetadata.ts | 4 - .../injective/tokenfactory/v1beta1/events.ts | 21 - .../injective/tokenfactory/v1beta1/genesis.ts | 12 - .../injective/tokenfactory/v1beta1/params.ts | 4 - .../tokenfactory/v1beta1/query.rpc.Query.ts | 224 -- .../tokenfactory/v1beta1/query.rpc.func.ts | 30 + .../tokenfactory/v1beta1/query.rpc.vue.ts | 19 + .../injective/tokenfactory/v1beta1/query.ts | 22 - .../tokenfactory/v1beta1/tx.amino.ts | 33 - .../tokenfactory/v1beta1/tx.rpc.func.ts | 39 + .../tokenfactory/v1beta1/tx.rpc.msg.ts | 57 - .../tokenfactory/v1beta1/tx.rpc.vue.ts | 21 + .../src/injective/tokenfactory/v1beta1/tx.ts | 37 - .../src/injective/types/v1beta1/account.ts | 5 - .../src/injective/types/v1beta1/tx_ext.ts | 6 - .../injective/types/v1beta1/tx_response.ts | 8 - .../src/injective/wasmx/v1/events.ts | 20 - .../src/injective/wasmx/v1/genesis.ts | 9 - .../src/injective/wasmx/v1/proposal.ts | 32 - .../src/injective/wasmx/v1/query.rpc.Query.ts | 160 -- .../src/injective/wasmx/v1/query.rpc.func.ts | 23 + .../src/injective/wasmx/v1/query.rpc.vue.ts | 15 + .../src/injective/wasmx/v1/query.ts | 15 - .../src/injective/wasmx/v1/tx.amino.ts | 33 - .../src/injective/wasmx/v1/tx.rpc.func.ts | 39 + .../src/injective/wasmx/v1/tx.rpc.msg.ts | 57 - .../src/injective/wasmx/v1/tx.rpc.vue.ts | 21 + .../src/injective/wasmx/v1/tx.ts | 38 - .../src/injective/wasmx/v1/wasmx.ts | 17 - libs/injective-vue/src/registry.ts | 2 +- .../src/tendermint/abci/types.ts | 269 -- .../src/tendermint/crypto/keys.ts | 5 - .../src/tendermint/crypto/proof.ts | 24 - .../src/tendermint/types/block.ts | 7 - .../src/tendermint/types/evidence.ts | 22 - .../src/tendermint/types/params.ts | 30 - .../src/tendermint/types/types.ts | 99 - .../src/tendermint/types/validator.ts | 16 - .../src/tendermint/version/types.ts | 9 - libs/injective-vue/src/types.ts | 2 +- libs/injective-vue/src/utf8.ts | 2 +- libs/injective-vue/src/varint.ts | 2 +- libs/injective-vue/src/vue-query.ts | 259 +- libs/injectivejs/package.json | 6 - libs/injectivejs/src/binary.ts | 2 +- libs/injectivejs/src/extern.ts | 2 +- libs/injectivejs/src/helper-func-types.ts | 2 +- libs/injectivejs/src/helpers.ts | 2 +- libs/injectivejs/src/registry.ts | 2 +- libs/injectivejs/src/types.ts | 2 +- libs/injectivejs/src/utf8.ts | 2 +- libs/injectivejs/src/varint.ts | 2 +- libs/interchain-react/src/binary.ts | 2 +- .../src/cosmos/app/v1alpha1/query.rpc.func.ts | 5 - .../cosmos/app/v1alpha1/query.rpc.react.ts | 7 + .../src/cosmos/auth/v1beta1/query.rpc.func.ts | 41 - .../cosmos/auth/v1beta1/query.rpc.react.ts | 43 + .../src/cosmos/auth/v1beta1/tx.rpc.func.ts | 4 - .../src/cosmos/auth/v1beta1/tx.rpc.react.ts | 6 + .../cosmos/authz/v1beta1/query.rpc.func.ts | 13 - .../cosmos/authz/v1beta1/query.rpc.react.ts | 15 + .../src/cosmos/authz/v1beta1/tx.rpc.func.ts | 10 - .../src/cosmos/authz/v1beta1/tx.rpc.react.ts | 12 + .../src/cosmos/autocli/v1/query.rpc.func.ts | 5 - .../src/cosmos/autocli/v1/query.rpc.react.ts | 7 + .../src/cosmos/bank/v1beta1/query.rpc.func.ts | 53 - .../cosmos/bank/v1beta1/query.rpc.react.ts | 55 + .../src/cosmos/bank/v1beta1/tx.rpc.func.ts | 13 - .../src/cosmos/bank/v1beta1/tx.rpc.react.ts | 15 + .../cosmos/base/grpc/v2/service.rpc.func.ts | 9 - .../cosmos/base/grpc/v2/service.rpc.react.ts | 11 + .../base/node/v1beta1/query.rpc.func.ts | 9 - .../base/node/v1beta1/query.rpc.react.ts | 11 + .../src/cosmos/base/node/v2/query.rpc.func.ts | 5 - .../cosmos/base/node/v2/query.rpc.react.ts | 7 + .../reflection/v1beta1/reflection.rpc.func.ts | 9 - .../v1beta1/reflection.rpc.react.ts | 11 + .../v2alpha1/reflection.rpc.func.ts | 25 - .../v2alpha1/reflection.rpc.react.ts | 27 + .../base/tendermint/v1beta1/query.rpc.func.ts | 29 - .../tendermint/v1beta1/query.rpc.react.ts | 31 + .../src/cosmos/circuit/v1/query.rpc.func.ts | 13 - .../src/cosmos/circuit/v1/query.rpc.react.ts | 15 + .../src/cosmos/circuit/v1/tx.rpc.func.ts | 10 - .../src/cosmos/circuit/v1/tx.rpc.react.ts | 12 + .../src/cosmos/consensus/v1/query.rpc.func.ts | 5 - .../cosmos/consensus/v1/query.rpc.react.ts | 7 + .../src/cosmos/consensus/v1/tx.rpc.func.ts | 4 - .../src/cosmos/consensus/v1/tx.rpc.react.ts | 6 + .../src/cosmos/crisis/v1beta1/tx.rpc.func.ts | 7 - .../src/cosmos/crisis/v1beta1/tx.rpc.react.ts | 9 + .../distribution/v1beta1/query.rpc.func.ts | 41 - .../distribution/v1beta1/query.rpc.react.ts | 43 + .../distribution/v1beta1/tx.rpc.func.ts | 22 - .../distribution/v1beta1/tx.rpc.react.ts | 24 + .../cosmos/evidence/v1beta1/query.rpc.func.ts | 9 - .../evidence/v1beta1/query.rpc.react.ts | 11 + .../cosmos/evidence/v1beta1/tx.rpc.func.ts | 4 - .../cosmos/evidence/v1beta1/tx.rpc.react.ts | 6 + .../cosmos/feegrant/v1beta1/query.rpc.func.ts | 13 - .../feegrant/v1beta1/query.rpc.react.ts | 15 + .../cosmos/feegrant/v1beta1/tx.rpc.func.ts | 10 - .../cosmos/feegrant/v1beta1/tx.rpc.react.ts | 12 + .../src/cosmos/gov/v1/query.rpc.func.ts | 37 - .../src/cosmos/gov/v1/query.rpc.react.ts | 39 + .../src/cosmos/gov/v1/tx.rpc.func.ts | 22 - .../src/cosmos/gov/v1/tx.rpc.react.ts | 24 + .../src/cosmos/gov/v1beta1/query.rpc.func.ts | 33 - .../src/cosmos/gov/v1beta1/query.rpc.react.ts | 35 + .../src/cosmos/gov/v1beta1/tx.rpc.func.ts | 13 - .../src/cosmos/gov/v1beta1/tx.rpc.react.ts | 15 + .../src/cosmos/group/v1/query.rpc.func.ts | 57 - .../src/cosmos/group/v1/query.rpc.react.ts | 59 + .../src/cosmos/group/v1/tx.rpc.func.ts | 43 - .../src/cosmos/group/v1/tx.rpc.react.ts | 45 + .../src/cosmos/mint/v1beta1/query.rpc.func.ts | 13 - .../cosmos/mint/v1beta1/query.rpc.react.ts | 15 + .../src/cosmos/mint/v1beta1/tx.rpc.func.ts | 4 - .../src/cosmos/mint/v1beta1/tx.rpc.react.ts | 6 + .../src/cosmos/nft/v1beta1/query.rpc.func.ts | 29 - .../src/cosmos/nft/v1beta1/query.rpc.react.ts | 31 + .../src/cosmos/nft/v1beta1/tx.rpc.func.ts | 4 - .../src/cosmos/nft/v1beta1/tx.rpc.react.ts | 6 + .../orm/query/v1alpha1/query.rpc.func.ts | 9 - .../orm/query/v1alpha1/query.rpc.react.ts | 11 + .../cosmos/params/v1beta1/query.rpc.func.ts | 9 - .../cosmos/params/v1beta1/query.rpc.react.ts | 11 + .../reflection/v1/reflection.rpc.func.ts | 5 - .../reflection/v1/reflection.rpc.react.ts | 7 + .../cosmos/slashing/v1beta1/query.rpc.func.ts | 13 - .../slashing/v1beta1/query.rpc.react.ts | 15 + .../cosmos/slashing/v1beta1/tx.rpc.func.ts | 7 - .../cosmos/slashing/v1beta1/tx.rpc.react.ts | 9 + .../cosmos/staking/v1beta1/query.rpc.func.ts | 57 - .../cosmos/staking/v1beta1/query.rpc.react.ts | 59 + .../src/cosmos/staking/v1beta1/tx.rpc.func.ts | 22 - .../cosmos/staking/v1beta1/tx.rpc.react.ts | 24 + .../src/cosmos/tx/v1beta1/service.rpc.func.ts | 37 - .../cosmos/tx/v1beta1/service.rpc.react.ts | 39 + .../cosmos/upgrade/v1beta1/query.rpc.func.ts | 21 - .../cosmos/upgrade/v1beta1/query.rpc.react.ts | 23 + .../src/cosmos/upgrade/v1beta1/tx.rpc.func.ts | 7 - .../cosmos/upgrade/v1beta1/tx.rpc.react.ts | 9 + .../src/cosmos/vesting/v1beta1/tx.rpc.func.ts | 10 - .../cosmos/vesting/v1beta1/tx.rpc.react.ts | 12 + .../src/cosmwasm/wasm/v1/query.rpc.func.ts | 57 - .../src/cosmwasm/wasm/v1/query.rpc.react.ts | 59 + .../src/cosmwasm/wasm/v1/tx.rpc.func.ts | 52 - .../src/cosmwasm/wasm/v1/tx.rpc.react.ts | 54 + libs/interchain-react/src/extern.ts | 2 +- .../interchain-react/src/helper-func-types.ts | 2 +- libs/interchain-react/src/helpers.ts | 2 +- .../applications/transfer/v1/tx.rpc.func.ts | 7 - .../applications/transfer/v1/tx.rpc.react.ts | 9 + .../src/ibc/core/channel/v1/tx.rpc.func.ts | 58 - .../src/ibc/core/channel/v1/tx.rpc.react.ts | 60 + .../src/ibc/core/client/v1/tx.rpc.func.ts | 22 - .../src/ibc/core/client/v1/tx.rpc.react.ts | 24 + .../src/ibc/core/connection/v1/tx.rpc.func.ts | 16 - .../ibc/core/connection/v1/tx.rpc.react.ts | 18 + libs/interchain-react/src/react-query.ts | 2 +- libs/interchain-react/src/registry.ts | 2 +- libs/interchain-react/src/types.ts | 2 +- libs/interchain-react/src/utf8.ts | 2 +- libs/interchain-react/src/varint.ts | 2 +- libs/interchain-vue/src/binary.ts | 2 +- .../src/cosmos/app/runtime/v1alpha1/module.ts | 16 - .../src/cosmos/app/runtime/v2/module.ts | 23 - .../src/cosmos/app/v1alpha1/config.ts | 14 - .../src/cosmos/app/v1alpha1/module.ts | 13 - .../cosmos/app/v1alpha1/query.rpc.Query.ts | 80 - .../src/cosmos/app/v1alpha1/query.rpc.func.ts | 9 + .../src/cosmos/app/v1alpha1/query.rpc.vue.ts | 7 + .../src/cosmos/app/v1alpha1/query.ts | 5 - .../src/cosmos/auth/module/v1/module.ts | 10 - .../src/cosmos/auth/v1beta1/accounts.ts | 6 - .../src/cosmos/auth/v1beta1/auth.ts | 23 - .../src/cosmos/auth/v1beta1/genesis.ts | 5 - .../cosmos/auth/v1beta1/query.rpc.Query.ts | 528 ---- .../src/cosmos/auth/v1beta1/query.rpc.func.ts | 72 + .../src/cosmos/auth/v1beta1/query.rpc.vue.ts | 43 + .../src/cosmos/auth/v1beta1/query.ts | 57 - .../src/cosmos/auth/v1beta1/tx.amino.ts | 8 - .../src/cosmos/auth/v1beta1/tx.rpc.func.ts | 9 + .../src/cosmos/auth/v1beta1/tx.rpc.msg.ts | 31 - .../src/cosmos/auth/v1beta1/tx.rpc.vue.ts | 6 + .../src/cosmos/auth/v1beta1/tx.ts | 6 - .../src/cosmos/authz/module/v1/module.ts | 1 - .../src/cosmos/authz/v1beta1/authz.ts | 17 - .../src/cosmos/authz/v1beta1/event.ts | 11 - .../src/cosmos/authz/v1beta1/genesis.ts | 4 - .../cosmos/authz/v1beta1/query.rpc.Query.ts | 182 -- .../cosmos/authz/v1beta1/query.rpc.func.ts | 23 + .../src/cosmos/authz/v1beta1/query.rpc.vue.ts | 15 + .../src/cosmos/authz/v1beta1/query.ts | 27 - .../src/cosmos/authz/v1beta1/tx.amino.ts | 18 - .../src/cosmos/authz/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/authz/v1beta1/tx.rpc.msg.ts | 57 - .../src/cosmos/authz/v1beta1/tx.rpc.vue.ts | 12 + .../src/cosmos/authz/v1beta1/tx.ts | 20 - .../src/cosmos/autocli/v1/options.ts | 49 - .../src/cosmos/autocli/v1/query.rpc.Query.ts | 81 - .../src/cosmos/autocli/v1/query.rpc.func.ts | 9 + .../src/cosmos/autocli/v1/query.rpc.vue.ts | 7 + .../src/cosmos/autocli/v1/query.ts | 11 - .../src/cosmos/bank/module/v1/module.ts | 6 - .../src/cosmos/bank/v1beta1/authz.ts | 5 - .../src/cosmos/bank/v1beta1/bank.ts | 35 - .../src/cosmos/bank/v1beta1/genesis.ts | 12 - .../cosmos/bank/v1beta1/query.rpc.Query.ts | 720 ----- .../src/cosmos/bank/v1beta1/query.rpc.func.ts | 93 + .../src/cosmos/bank/v1beta1/query.rpc.vue.ts | 55 + .../src/cosmos/bank/v1beta1/query.ts | 96 - .../src/cosmos/bank/v1beta1/tx.amino.ts | 23 - .../src/cosmos/bank/v1beta1/tx.rpc.func.ts | 27 + .../src/cosmos/bank/v1beta1/tx.rpc.msg.ts | 67 - .../src/cosmos/bank/v1beta1/tx.rpc.vue.ts | 15 + .../src/cosmos/bank/v1beta1/tx.ts | 23 - .../src/cosmos/base/abci/v1beta1/abci.ts | 67 - .../base/grpc/v2/service.rpc.Service.ts | 119 - .../cosmos/base/grpc/v2/service.rpc.func.ts | 16 + .../cosmos/base/grpc/v2/service.rpc.vue.ts | 11 + .../src/cosmos/base/grpc/v2/service.ts | 15 - .../base/node/v1beta1/query.rpc.Service.ts | 120 - .../base/node/v1beta1/query.rpc.func.ts | 16 + .../cosmos/base/node/v1beta1/query.rpc.vue.ts | 11 + .../src/cosmos/base/node/v1beta1/query.ts | 16 - .../cosmos/base/node/v2/query.rpc.Service.ts | 80 - .../src/cosmos/base/node/v2/query.rpc.func.ts | 9 + .../src/cosmos/base/node/v2/query.rpc.vue.ts | 7 + .../src/cosmos/base/node/v2/query.ts | 5 - .../cosmos/base/query/v1beta1/pagination.ts | 12 - .../reflection/v1beta1/reflection.rpc.func.ts | 16 + .../reflection/v1beta1/reflection.rpc.vue.ts | 11 + .../base/reflection/v1beta1/reflection.ts | 11 - .../v2alpha1/reflection.rpc.func.ts | 44 + .../reflection/v2alpha1/reflection.rpc.vue.ts | 27 + .../base/reflection/v2alpha1/reflection.ts | 82 - .../tendermint/v1beta1/query.rpc.Service.ts | 339 --- .../base/tendermint/v1beta1/query.rpc.func.ts | 51 + .../base/tendermint/v1beta1/query.rpc.vue.ts | 31 + .../cosmos/base/tendermint/v1beta1/query.ts | 87 - .../cosmos/base/tendermint/v1beta1/types.ts | 23 - .../src/cosmos/base/v1beta1/coin.ts | 15 - .../src/cosmos/circuit/module/v1/module.ts | 4 - .../src/cosmos/circuit/v1/query.rpc.Query.ts | 162 -- .../src/cosmos/circuit/v1/query.rpc.func.ts | 23 + .../src/cosmos/circuit/v1/query.rpc.vue.ts | 15 + .../src/cosmos/circuit/v1/query.ts | 18 - .../src/cosmos/circuit/v1/tx.amino.ts | 18 - .../src/cosmos/circuit/v1/tx.rpc.func.ts | 21 + .../src/cosmos/circuit/v1/tx.rpc.msg.ts | 47 - .../src/cosmos/circuit/v1/tx.rpc.vue.ts | 12 + .../src/cosmos/circuit/v1/tx.ts | 23 - .../src/cosmos/circuit/v1/types.ts | 13 - .../src/cosmos/consensus/module/v1/module.ts | 4 - .../cosmos/consensus/v1/query.rpc.Query.ts | 80 - .../src/cosmos/consensus/v1/query.rpc.func.ts | 9 + .../src/cosmos/consensus/v1/query.rpc.vue.ts | 7 + .../src/cosmos/consensus/v1/query.ts | 5 - .../src/cosmos/consensus/v1/tx.amino.ts | 8 - .../src/cosmos/consensus/v1/tx.rpc.func.ts | 9 + .../src/cosmos/consensus/v1/tx.rpc.msg.ts | 31 - .../src/cosmos/consensus/v1/tx.rpc.vue.ts | 6 + .../src/cosmos/consensus/v1/tx.ts | 9 - .../src/cosmos/crisis/module/v1/module.ts | 5 - .../src/cosmos/crisis/v1beta1/genesis.ts | 4 - .../src/cosmos/crisis/v1beta1/tx.amino.ts | 13 - .../src/cosmos/crisis/v1beta1/tx.rpc.func.ts | 15 + .../src/cosmos/crisis/v1beta1/tx.rpc.msg.ts | 39 - .../src/cosmos/crisis/v1beta1/tx.rpc.vue.ts | 9 + .../src/cosmos/crisis/v1beta1/tx.ts | 12 - .../src/cosmos/crypto/ed25519/keys.ts | 7 - .../src/cosmos/crypto/hd/v1/hd.ts | 8 - .../src/cosmos/crypto/keyring/v1/record.ts | 17 - .../src/cosmos/crypto/multisig/keys.ts | 5 - .../crypto/multisig/v1beta1/multisig.ts | 8 - .../src/cosmos/crypto/secp256k1/keys.ts | 7 - .../src/cosmos/crypto/secp256r1/keys.ts | 7 - .../cosmos/distribution/module/v1/module.ts | 5 - .../distribution/v1beta1/distribution.ts | 53 - .../cosmos/distribution/v1beta1/genesis.ts | 45 - .../distribution/v1beta1/query.rpc.Query.ts | 448 --- .../distribution/v1beta1/query.rpc.func.ts | 72 + .../distribution/v1beta1/query.rpc.vue.ts | 43 + .../src/cosmos/distribution/v1beta1/query.ts | 65 - .../cosmos/distribution/v1beta1/tx.amino.ts | 38 - .../distribution/v1beta1/tx.rpc.func.ts | 45 + .../cosmos/distribution/v1beta1/tx.rpc.msg.ts | 115 - .../cosmos/distribution/v1beta1/tx.rpc.vue.ts | 24 + .../src/cosmos/distribution/v1beta1/tx.ts | 41 - .../src/cosmos/evidence/module/v1/module.ts | 1 - .../src/cosmos/evidence/v1beta1/evidence.ts | 7 - .../src/cosmos/evidence/v1beta1/genesis.ts | 4 - .../evidence/v1beta1/query.rpc.Query.ts | 122 - .../cosmos/evidence/v1beta1/query.rpc.func.ts | 16 + .../cosmos/evidence/v1beta1/query.rpc.vue.ts | 11 + .../src/cosmos/evidence/v1beta1/query.ts | 15 - .../src/cosmos/evidence/v1beta1/tx.amino.ts | 8 - .../cosmos/evidence/v1beta1/tx.rpc.func.ts | 9 + .../src/cosmos/evidence/v1beta1/tx.rpc.msg.ts | 27 - .../src/cosmos/evidence/v1beta1/tx.rpc.vue.ts | 6 + .../src/cosmos/evidence/v1beta1/tx.ts | 8 - .../src/cosmos/feegrant/module/v1/module.ts | 1 - .../src/cosmos/feegrant/v1beta1/feegrant.ts | 21 - .../src/cosmos/feegrant/v1beta1/genesis.ts | 4 - .../feegrant/v1beta1/query.rpc.Query.ts | 171 -- .../cosmos/feegrant/v1beta1/query.rpc.func.ts | 23 + .../cosmos/feegrant/v1beta1/query.rpc.vue.ts | 15 + .../src/cosmos/feegrant/v1beta1/query.ts | 24 - .../src/cosmos/feegrant/v1beta1/tx.amino.ts | 18 - .../cosmos/feegrant/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts | 53 - .../src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts | 12 + .../src/cosmos/feegrant/v1beta1/tx.ts | 16 - .../src/cosmos/genutil/module/v1/module.ts | 1 - .../src/cosmos/genutil/v1beta1/genesis.ts | 4 - .../src/cosmos/gov/module/v1/module.ts | 5 - .../src/cosmos/gov/v1/genesis.ts | 12 - libs/interchain-vue/src/cosmos/gov/v1/gov.ts | 69 - .../src/cosmos/gov/v1/query.rpc.Query.ts | 400 --- .../src/cosmos/gov/v1/query.rpc.func.ts | 65 + .../src/cosmos/gov/v1/query.rpc.vue.ts | 39 + .../interchain-vue/src/cosmos/gov/v1/query.ts | 66 - .../src/cosmos/gov/v1/tx.amino.ts | 38 - .../src/cosmos/gov/v1/tx.rpc.func.ts | 45 + .../src/cosmos/gov/v1/tx.rpc.msg.ts | 89 - .../src/cosmos/gov/v1/tx.rpc.vue.ts | 24 + libs/interchain-vue/src/cosmos/gov/v1/tx.ts | 52 - .../src/cosmos/gov/v1beta1/genesis.ts | 10 - .../src/cosmos/gov/v1beta1/gov.ts | 49 - .../src/cosmos/gov/v1beta1/query.rpc.Query.ts | 360 --- .../src/cosmos/gov/v1beta1/query.rpc.func.ts | 58 + .../src/cosmos/gov/v1beta1/query.rpc.vue.ts | 35 + .../src/cosmos/gov/v1beta1/query.ts | 61 - .../src/cosmos/gov/v1beta1/tx.amino.ts | 23 - .../src/cosmos/gov/v1beta1/tx.rpc.func.ts | 27 + .../src/cosmos/gov/v1beta1/tx.rpc.msg.ts | 53 - .../src/cosmos/gov/v1beta1/tx.rpc.vue.ts | 15 + .../src/cosmos/gov/v1beta1/tx.ts | 27 - .../src/cosmos/group/module/v1/module.ts | 5 - .../src/cosmos/group/v1/events.ts | 36 - .../src/cosmos/group/v1/genesis.ts | 11 - .../src/cosmos/group/v1/query.rpc.Query.ts | 630 ----- .../src/cosmos/group/v1/query.rpc.func.ts | 100 + .../src/cosmos/group/v1/query.rpc.vue.ts | 59 + .../src/cosmos/group/v1/query.ts | 103 - .../src/cosmos/group/v1/tx.amino.ts | 73 - .../src/cosmos/group/v1/tx.rpc.func.ts | 87 + .../src/cosmos/group/v1/tx.rpc.msg.ts | 127 - .../src/cosmos/group/v1/tx.rpc.vue.ts | 45 + libs/interchain-vue/src/cosmos/group/v1/tx.ts | 103 - .../src/cosmos/group/v1/types.ts | 74 - .../src/cosmos/ics23/v1/proofs.ts | 71 - .../src/cosmos/mint/module/v1/module.ts | 5 - .../src/cosmos/mint/v1beta1/genesis.ts | 5 - .../src/cosmos/mint/v1beta1/mint.ts | 13 - .../cosmos/mint/v1beta1/query.rpc.Query.ts | 160 -- .../src/cosmos/mint/v1beta1/query.rpc.func.ts | 23 + .../src/cosmos/mint/v1beta1/query.rpc.vue.ts | 15 + .../src/cosmos/mint/v1beta1/query.ts | 13 - .../src/cosmos/mint/v1beta1/tx.amino.ts | 8 - .../src/cosmos/mint/v1beta1/tx.rpc.func.ts | 9 + .../src/cosmos/mint/v1beta1/tx.rpc.msg.ts | 31 - .../src/cosmos/mint/v1beta1/tx.rpc.vue.ts | 6 + .../src/cosmos/mint/v1beta1/tx.ts | 6 - .../src/cosmos/nft/module/v1/module.ts | 1 - .../src/cosmos/nft/v1beta1/event.ts | 17 - .../src/cosmos/nft/v1beta1/genesis.ts | 9 - .../src/cosmos/nft/v1beta1/nft.ts | 17 - .../src/cosmos/nft/v1beta1/query.rpc.Query.ts | 330 --- .../src/cosmos/nft/v1beta1/query.rpc.func.ts | 51 + .../src/cosmos/nft/v1beta1/query.rpc.vue.ts | 31 + .../src/cosmos/nft/v1beta1/query.ts | 50 - .../src/cosmos/nft/v1beta1/tx.amino.ts | 8 - .../src/cosmos/nft/v1beta1/tx.rpc.func.ts | 9 + .../src/cosmos/nft/v1beta1/tx.rpc.msg.ts | 23 - .../src/cosmos/nft/v1beta1/tx.rpc.vue.ts | 6 + .../src/cosmos/nft/v1beta1/tx.ts | 8 - .../src/cosmos/orm/module/v1alpha1/module.ts | 1 - .../orm/query/v1alpha1/query.rpc.Query.ts | 120 - .../orm/query/v1alpha1/query.rpc.func.ts | 16 + .../orm/query/v1alpha1/query.rpc.vue.ts | 11 + .../src/cosmos/orm/query/v1alpha1/query.ts | 37 - libs/interchain-vue/src/cosmos/orm/v1/orm.ts | 18 - .../src/cosmos/orm/v1alpha1/schema.ts | 10 - .../src/cosmos/params/module/v1/module.ts | 1 - .../src/cosmos/params/v1beta1/params.ts | 11 - .../cosmos/params/v1beta1/query.rpc.Query.ts | 139 - .../cosmos/params/v1beta1/query.rpc.func.ts | 16 + .../cosmos/params/v1beta1/query.rpc.vue.ts | 11 + .../src/cosmos/params/v1beta1/query.ts | 16 - .../reflection/v1/reflection.rpc.func.ts | 9 + .../reflection/v1/reflection.rpc.vue.ts | 7 + .../src/cosmos/reflection/v1/reflection.ts | 5 - libs/interchain-vue/src/cosmos/rpc.query.ts | 89 - libs/interchain-vue/src/cosmos/rpc.tx.ts | 61 - .../src/cosmos/slashing/module/v1/module.ts | 4 - .../src/cosmos/slashing/v1beta1/genesis.ts | 18 - .../slashing/v1beta1/query.rpc.Query.ts | 162 -- .../cosmos/slashing/v1beta1/query.rpc.func.ts | 23 + .../cosmos/slashing/v1beta1/query.rpc.vue.ts | 15 + .../src/cosmos/slashing/v1beta1/query.ts | 18 - .../src/cosmos/slashing/v1beta1/slashing.ts | 16 - .../src/cosmos/slashing/v1beta1/tx.amino.ts | 13 - .../cosmos/slashing/v1beta1/tx.rpc.func.ts | 15 + .../src/cosmos/slashing/v1beta1/tx.rpc.msg.ts | 45 - .../src/cosmos/slashing/v1beta1/tx.rpc.vue.ts | 9 + .../src/cosmos/slashing/v1beta1/tx.ts | 10 - .../src/cosmos/staking/module/v1/module.ts | 7 - .../src/cosmos/staking/v1beta1/authz.ts | 10 - .../src/cosmos/staking/v1beta1/genesis.ts | 15 - .../cosmos/staking/v1beta1/query.rpc.Query.ts | 720 ----- .../cosmos/staking/v1beta1/query.rpc.func.ts | 100 + .../cosmos/staking/v1beta1/query.rpc.vue.ts | 59 + .../src/cosmos/staking/v1beta1/query.ts | 100 - .../src/cosmos/staking/v1beta1/staking.ts | 113 - .../src/cosmos/staking/v1beta1/tx.amino.ts | 38 - .../src/cosmos/staking/v1beta1/tx.rpc.func.ts | 45 + .../src/cosmos/staking/v1beta1/tx.rpc.msg.ts | 97 - .../src/cosmos/staking/v1beta1/tx.rpc.vue.ts | 24 + .../src/cosmos/staking/v1beta1/tx.ts | 54 - .../cosmos/store/internal/kv/v1beta1/kv.ts | 8 - .../src/cosmos/store/snapshots/v1/snapshot.ts | 33 - .../src/cosmos/store/snapshots/v2/snapshot.ts | 33 - .../src/cosmos/store/streaming/abci/grpc.ts | 12 - .../src/cosmos/store/v1beta1/commit_info.ts | 14 - .../src/cosmos/store/v1beta1/listening.ts | 12 - .../src/cosmos/streaming/v1/grpc.ts | 38 - .../src/cosmos/tx/config/v1/config.ts | 5 - .../src/cosmos/tx/signing/v1beta1/signing.ts | 21 - .../cosmos/tx/v1beta1/service.rpc.Service.ts | 455 --- .../src/cosmos/tx/v1beta1/service.rpc.func.ts | 65 + .../src/cosmos/tx/v1beta1/service.rpc.vue.ts | 39 + .../src/cosmos/tx/v1beta1/service.ts | 71 - .../src/cosmos/tx/v1beta1/tx.ts | 69 - .../src/cosmos/upgrade/module/v1/module.ts | 4 - .../cosmos/upgrade/v1beta1/query.rpc.Query.ts | 282 -- .../cosmos/upgrade/v1beta1/query.rpc.func.ts | 37 + .../cosmos/upgrade/v1beta1/query.rpc.vue.ts | 23 + .../src/cosmos/upgrade/v1beta1/query.ts | 27 - .../src/cosmos/upgrade/v1beta1/tx.amino.ts | 13 - .../src/cosmos/upgrade/v1beta1/tx.rpc.func.ts | 15 + .../src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts | 45 - .../src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts | 9 + .../src/cosmos/upgrade/v1beta1/tx.ts | 10 - .../src/cosmos/upgrade/v1beta1/upgrade.ts | 21 - .../src/cosmos/validate/module/v1/module.ts | 1 - .../src/cosmos/vesting/module/v1/module.ts | 1 - .../src/cosmos/vesting/v1beta1/tx.amino.ts | 18 - .../src/cosmos/vesting/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/vesting/v1beta1/tx.rpc.msg.ts | 59 - .../src/cosmos/vesting/v1beta1/tx.rpc.vue.ts | 12 + .../src/cosmos/vesting/v1beta1/tx.ts | 22 - .../src/cosmos/vesting/v1beta1/vesting.ts | 27 - .../interchain-vue/src/cosmos_proto/cosmos.ts | 10 - libs/interchain-vue/src/cosmwasm/rpc.query.ts | 94 - libs/interchain-vue/src/cosmwasm/rpc.tx.ts | 66 - .../src/cosmwasm/wasm/v1/query.rpc.Query.ts | 612 ---- .../src/cosmwasm/wasm/v1/query.rpc.func.ts | 100 + .../src/cosmwasm/wasm/v1/query.rpc.vue.ts | 59 + .../src/cosmwasm/wasm/v1/query.ts | 107 - .../src/cosmwasm/wasm/v1/tx.amino.ts | 88 - .../src/cosmwasm/wasm/v1/tx.rpc.func.ts | 105 + .../src/cosmwasm/wasm/v1/tx.rpc.msg.ts | 225 -- .../src/cosmwasm/wasm/v1/tx.rpc.vue.ts | 54 + .../interchain-vue/src/cosmwasm/wasm/v1/tx.ts | 139 - .../src/cosmwasm/wasm/v1/types.ts | 40 - libs/interchain-vue/src/extern.ts | 21 +- libs/interchain-vue/src/google/api/http.ts | 21 - .../interchain-vue/src/google/protobuf/any.ts | 5 - .../src/google/protobuf/descriptor.ts | 237 -- .../src/google/protobuf/duration.ts | 5 - .../src/google/protobuf/timestamp.ts | 5 - libs/interchain-vue/src/helper-func-types.ts | 191 ++ libs/interchain-vue/src/helpers.ts | 2 +- .../ibc/applications/transfer/v1/transfer.ts | 13 - .../ibc/applications/transfer/v1/tx.amino.ts | 13 - .../applications/transfer/v1/tx.rpc.func.ts | 15 + .../applications/transfer/v1/tx.rpc.msg.ts | 31 - .../applications/transfer/v1/tx.rpc.vue.ts | 9 + .../src/ibc/applications/transfer/v1/tx.ts | 21 - .../src/ibc/core/channel/v1/channel.ts | 55 - .../src/ibc/core/channel/v1/tx.amino.ts | 98 - .../src/ibc/core/channel/v1/tx.rpc.func.ts | 117 + .../src/ibc/core/channel/v1/tx.rpc.msg.ts | 171 -- .../src/ibc/core/channel/v1/tx.rpc.vue.ts | 60 + .../src/ibc/core/channel/v1/tx.ts | 191 -- .../src/ibc/core/channel/v1/upgrade.ts | 15 - .../src/ibc/core/client/v1/client.ts | 20 - .../src/ibc/core/client/v1/tx.amino.ts | 38 - .../src/ibc/core/client/v1/tx.rpc.func.ts | 45 + .../src/ibc/core/client/v1/tx.rpc.msg.ts | 71 - .../src/ibc/core/client/v1/tx.rpc.vue.ts | 24 + .../src/ibc/core/client/v1/tx.ts | 47 - .../src/ibc/core/commitment/v1/commitment.ts | 10 - .../src/ibc/core/connection/v1/connection.ts | 35 - .../src/ibc/core/connection/v1/tx.amino.ts | 28 - .../src/ibc/core/connection/v1/tx.rpc.func.ts | 33 + .../src/ibc/core/connection/v1/tx.rpc.msg.ts | 63 - .../src/ibc/core/connection/v1/tx.rpc.vue.ts | 18 + .../src/ibc/core/connection/v1/tx.ts | 51 - libs/interchain-vue/src/ibc/rpc.tx.ts | 79 - .../src/injective/types/v1beta1/account.ts | 5 - libs/interchain-vue/src/registry.ts | 2 +- .../src/tendermint/abci/types.ts | 269 -- .../src/tendermint/crypto/keys.ts | 5 - .../src/tendermint/crypto/proof.ts | 24 - .../src/tendermint/p2p/types.ts | 25 - .../src/tendermint/types/block.ts | 7 - .../src/tendermint/types/evidence.ts | 22 - .../src/tendermint/types/params.ts | 30 - .../src/tendermint/types/types.ts | 99 - .../src/tendermint/types/validator.ts | 16 - .../src/tendermint/version/types.ts | 9 - libs/interchain-vue/src/types.ts | 2 +- libs/interchain-vue/src/utf8.ts | 2 +- libs/interchain-vue/src/varint.ts | 2 +- libs/interchain-vue/src/vue-query.ts | 259 +- libs/interchainjs/package.json | 6 - libs/interchainjs/src/binary.ts | 2 +- libs/interchainjs/src/extern.ts | 2 +- libs/interchainjs/src/helper-func-types.ts | 2 +- libs/interchainjs/src/helpers.ts | 2 +- libs/interchainjs/src/registry.ts | 2 +- libs/interchainjs/src/types.ts | 2 +- libs/interchainjs/src/utf8.ts | 2 +- libs/interchainjs/src/varint.ts | 2 +- package.json | 5 +- scripts/cosmos-types.telescope.json | 5 +- scripts/inj-react.telescope.json | 7 +- scripts/inj-vue.telescope.json | 10 +- scripts/inj.telescope.json | 7 +- scripts/interchain-react.telescope.json | 7 +- scripts/interchain-vue.telescope.json | 10 +- scripts/interchainjs.telescope.json | 7 +- yarn.lock | 58 +- 863 files changed, 10752 insertions(+), 36783 deletions(-) create mode 100644 libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts create mode 100644 libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts create mode 100644 libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts create mode 100644 libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts create mode 100644 libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts create mode 100644 libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts delete mode 100644 libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/authz/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/bank/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/distribution/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/gov/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/gov/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/gov/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/gov/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/group/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/group/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/group/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/rpc.query.ts delete mode 100644 libs/injective-vue/src/cosmos/rpc.tx.ts delete mode 100644 libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/staking/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts create mode 100644 libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts create mode 100644 libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmos/vesting/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmwasm/rpc.query.ts delete mode 100644 libs/injective-vue/src/cosmwasm/rpc.tx.ts delete mode 100644 libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/cosmwasm/wasm/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts create mode 100644 libs/injective-vue/src/helper-func-types.ts delete mode 100644 libs/injective-vue/src/ibc/applications/transfer/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/ibc/core/channel/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/ibc/core/client/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/ibc/core/client/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/ibc/core/client/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/ibc/core/connection/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/ibc/rpc.tx.ts delete mode 100644 libs/injective-vue/src/injective/auction/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/auction/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/auction/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/exchange/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/insurance/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/ocr/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/oracle/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/peggy/v1/msgs.amino.ts create mode 100644 libs/injective-vue/src/injective/peggy/v1/msgs.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/peggy/v1/msgs.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/peggy/v1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/peggy/v1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/permissions/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/rpc.query.ts delete mode 100644 libs/injective-vue/src/injective/rpc.tx.ts delete mode 100644 libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/wasmx/v1/query.rpc.Query.ts create mode 100644 libs/injective-vue/src/injective/wasmx/v1/query.rpc.func.ts create mode 100644 libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts delete mode 100644 libs/injective-vue/src/injective/wasmx/v1/tx.amino.ts create mode 100644 libs/injective-vue/src/injective/wasmx/v1/tx.rpc.func.ts delete mode 100644 libs/injective-vue/src/injective/wasmx/v1/tx.rpc.msg.ts create mode 100644 libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts create mode 100644 libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts create mode 100644 libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts create mode 100644 libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts delete mode 100644 libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/auth/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/authz/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/bank/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.Service.ts create mode 100644 libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.Service.ts create mode 100644 libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.Service.ts create mode 100644 libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts create mode 100644 libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts create mode 100644 libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts create mode 100644 libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/circuit/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/consensus/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/gov/v1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/gov/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/gov/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/group/v1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/group/v1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/group/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/group/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/group/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/mint/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/nft/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts create mode 100644 libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/rpc.query.ts delete mode 100644 libs/interchain-vue/src/cosmos/rpc.tx.ts delete mode 100644 libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/staking/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts create mode 100644 libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmwasm/rpc.query.ts delete mode 100644 libs/interchain-vue/src/cosmwasm/rpc.tx.ts delete mode 100644 libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts create mode 100644 libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts create mode 100644 libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/cosmwasm/wasm/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts create mode 100644 libs/interchain-vue/src/helper-func-types.ts delete mode 100644 libs/interchain-vue/src/ibc/applications/transfer/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/ibc/core/channel/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/ibc/core/client/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/ibc/core/connection/v1/tx.amino.ts create mode 100644 libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.func.ts delete mode 100644 libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts create mode 100644 libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts delete mode 100644 libs/interchain-vue/src/ibc/rpc.tx.ts diff --git a/.telescope.json b/.telescope.json index 8abd7916..01e97f4e 100644 --- a/.telescope.json +++ b/.telescope.json @@ -58,9 +58,8 @@ "rpcClients": { "enabled": false }, - "helperFuncCreators": { - "enabled": true, - "genCustomHooks": false + "helperFunctions": { + "enabled": true }, "interfaces": { "enabled": true, diff --git a/libs/cosmos-types/src/binary.ts b/libs/cosmos-types/src/binary.ts index 1fd2c7b3..e6922501 100644 --- a/libs/cosmos-types/src/binary.ts +++ b/libs/cosmos-types/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.11 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/extern.ts b/libs/cosmos-types/src/extern.ts index a24584c8..eddf067e 100644 --- a/libs/cosmos-types/src/extern.ts +++ b/libs/cosmos-types/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.11 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/helper-func-types.ts b/libs/cosmos-types/src/helper-func-types.ts index 96148af3..4f82736b 100644 --- a/libs/cosmos-types/src/helper-func-types.ts +++ b/libs/cosmos-types/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.11 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ @@ -38,7 +38,7 @@ export function buildQuery(opts: QueryBuilderOptions) { export interface ITxArgs { signerAddress: string; - message: TMsg; + message: TMsg | TMsg[]; fee: StdFee | 'auto'; memo: string; } @@ -78,7 +78,7 @@ export interface TxBuilderOptions { export function buildTx(opts: TxBuilderOptions) { return async ( signerAddress: string, - message: TMsg, + message: TMsg | TMsg[], fee: StdFee | 'auto', memo: string ): Promise => { diff --git a/libs/cosmos-types/src/helpers.ts b/libs/cosmos-types/src/helpers.ts index 01319f69..ba68bbdb 100644 --- a/libs/cosmos-types/src/helpers.ts +++ b/libs/cosmos-types/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.11 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/types.ts b/libs/cosmos-types/src/types.ts index caaccd6b..cdcfbdf9 100644 --- a/libs/cosmos-types/src/types.ts +++ b/libs/cosmos-types/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.11 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ @@ -48,6 +48,7 @@ export interface TelescopeGeneratedCodec< toProto?: (message: T) => Uint8Array; fromProtoMsg?: (message: ProtoMsg) => T; toProtoMsg?: (message: T) => Any; + registerTypeUrl?: () => void; } export type TelescopeGeneratedType< diff --git a/libs/cosmos-types/src/utf8.ts b/libs/cosmos-types/src/utf8.ts index 813e03b5..c0f5c97c 100644 --- a/libs/cosmos-types/src/utf8.ts +++ b/libs/cosmos-types/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.11 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/varint.ts b/libs/cosmos-types/src/varint.ts index a88d8755..70a851bd 100644 --- a/libs/cosmos-types/src/varint.ts +++ b/libs/cosmos-types/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.11 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/README.md b/libs/injective-react/README.md index f96ca55a..28b44012 100644 --- a/libs/injective-react/README.md +++ b/libs/injective-react/README.md @@ -93,8 +93,8 @@ injective-react provides hooks for sending transactions. These hooks are built o There's also an all in one example of how to use these hooks in the [all in one example](#all-in-one-example) section. ```js -import { useDelegate } from "injective-react/cosmos/staking/v1beta1/tx.rpc.func"; -import { useGetValidators } from "injective-react/cosmos/staking/v1beta1/query.rpc.func"; +import { useDelegate } from "injective-react/cosmos/staking/v1beta1/tx.rpc.react"; +import { useGetValidators } from "injective-react/cosmos/staking/v1beta1/query.rpc.react"; const { data, diff --git a/libs/injective-react/src/binary.ts b/libs/injective-react/src/binary.ts index 2eaa6cb6..e6922501 100644 --- a/libs/injective-react/src/binary.ts +++ b/libs/injective-react/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.func.ts b/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.func.ts index 174472fd..96ab73af 100644 --- a/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountsRequest.encode, @@ -9,10 +8,6 @@ export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAccounts, - queryKeyPrefix: "AccountsQuery" -}); export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountRequest.encode, decode: QueryAccountResponse.decode, @@ -21,10 +16,6 @@ export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAccount, - queryKeyPrefix: "AccountQuery" -}); export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountAddressByIDRequest.encode, decode: QueryAccountAddressByIDResponse.decode, @@ -33,10 +24,6 @@ export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse] }); -export const useGetAccountAddressByID = buildUseQuery({ - builderQueryFn: createGetAccountAddressByID, - queryKeyPrefix: "AccountAddressByIDQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -45,10 +32,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleAccountsRequest.encode, decode: QueryModuleAccountsResponse.decode, @@ -57,10 +40,6 @@ export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryModuleAccountsRequest, QueryModuleAccountsResponse] }); -export const useGetModuleAccounts = buildUseQuery({ - builderQueryFn: createGetModuleAccounts, - queryKeyPrefix: "ModuleAccountsQuery" -}); export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleAccountByNameRequest.encode, decode: QueryModuleAccountByNameResponse.decode, @@ -69,10 +48,6 @@ export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse] }); -export const useGetModuleAccountByName = buildUseQuery({ - builderQueryFn: createGetModuleAccountByName, - queryKeyPrefix: "ModuleAccountByNameQuery" -}); export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuery({ encode: Bech32PrefixRequest.encode, decode: Bech32PrefixResponse.decode, @@ -81,10 +56,6 @@ export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [Bech32PrefixRequest, Bech32PrefixResponse] }); -export const useGetBech32Prefix = buildUseQuery({ - builderQueryFn: createGetBech32Prefix, - queryKeyPrefix: "Bech32PrefixQuery" -}); export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => buildQuery({ encode: AddressBytesToStringRequest.encode, decode: AddressBytesToStringResponse.decode, @@ -93,10 +64,6 @@ export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => b clientResolver, deps: [AddressBytesToStringRequest, AddressBytesToStringResponse] }); -export const useGetAddressBytesToString = buildUseQuery({ - builderQueryFn: createGetAddressBytesToString, - queryKeyPrefix: "AddressBytesToStringQuery" -}); export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => buildQuery({ encode: AddressStringToBytesRequest.encode, decode: AddressStringToBytesResponse.decode, @@ -105,10 +72,6 @@ export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => b clientResolver, deps: [AddressStringToBytesRequest, AddressStringToBytesResponse] }); -export const useGetAddressStringToBytes = buildUseQuery({ - builderQueryFn: createGetAddressStringToBytes, - queryKeyPrefix: "AddressStringToBytesQuery" -}); export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountInfoRequest.encode, decode: QueryAccountInfoResponse.decode, @@ -116,8 +79,4 @@ export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery method: "AccountInfo", clientResolver, deps: [QueryAccountInfoRequest, QueryAccountInfoResponse] -}); -export const useGetAccountInfo = buildUseQuery({ - builderQueryFn: createGetAccountInfo, - queryKeyPrefix: "AccountInfoQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..f1ddc500 --- /dev/null +++ b/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts @@ -0,0 +1,43 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +export const useGetAccounts = buildUseQuery({ + builderQueryFn: createGetAccounts, + queryKeyPrefix: "AccountsQuery" +}); +export const useGetAccount = buildUseQuery({ + builderQueryFn: createGetAccount, + queryKeyPrefix: "AccountQuery" +}); +export const useGetAccountAddressByID = buildUseQuery({ + builderQueryFn: createGetAccountAddressByID, + queryKeyPrefix: "AccountAddressByIDQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetModuleAccounts = buildUseQuery({ + builderQueryFn: createGetModuleAccounts, + queryKeyPrefix: "ModuleAccountsQuery" +}); +export const useGetModuleAccountByName = buildUseQuery({ + builderQueryFn: createGetModuleAccountByName, + queryKeyPrefix: "ModuleAccountByNameQuery" +}); +export const useGetBech32Prefix = buildUseQuery({ + builderQueryFn: createGetBech32Prefix, + queryKeyPrefix: "Bech32PrefixQuery" +}); +export const useGetAddressBytesToString = buildUseQuery({ + builderQueryFn: createGetAddressBytesToString, + queryKeyPrefix: "AddressBytesToStringQuery" +}); +export const useGetAddressStringToBytes = buildUseQuery({ + builderQueryFn: createGetAddressStringToBytes, + queryKeyPrefix: "AddressStringToBytesQuery" +}); +export const useGetAccountInfo = buildUseQuery({ + builderQueryFn: createGetAccountInfo, + queryKeyPrefix: "AccountInfoQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts index 0f34bbad..7c896912 100644 --- a/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createGrant -}); export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExec.typeUrl, @@ -19,16 +15,10 @@ export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createExec -}); export const createRevoke = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRevoke.typeUrl, encoders: toEncoders(MsgRevoke), converters: toConverters(MsgRevoke), deps: [MsgRevoke] -}); -export const useRevoke = buildUseMutation({ - builderMutationFn: createRevoke }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..c94561d2 --- /dev/null +++ b/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts @@ -0,0 +1,12 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +export const useGrant = buildUseMutation({ + builderMutationFn: createGrant +}); +export const useExec = buildUseMutation({ + builderMutationFn: createExec +}); +export const useRevoke = buildUseMutation({ + builderMutationFn: createRevoke +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.func.ts b/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.func.ts index 024880f8..70281597 100644 --- a/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBalanceRequest.encode, @@ -9,10 +8,6 @@ export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetBalance, - queryKeyPrefix: "BalanceQuery" -}); export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllBalancesRequest.encode, decode: QueryAllBalancesResponse.decode, @@ -21,10 +16,6 @@ export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryAllBalancesRequest, QueryAllBalancesResponse] }); -export const useGetAllBalances = buildUseQuery({ - builderQueryFn: createGetAllBalances, - queryKeyPrefix: "AllBalancesQuery" -}); export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpendableBalancesRequest.encode, decode: QuerySpendableBalancesResponse.decode, @@ -33,10 +24,6 @@ export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QuerySpendableBalancesRequest, QuerySpendableBalancesResponse] }); -export const useGetSpendableBalances = buildUseQuery({ - builderQueryFn: createGetSpendableBalances, - queryKeyPrefix: "SpendableBalancesQuery" -}); export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpendableBalanceByDenomRequest.encode, decode: QuerySpendableBalanceByDenomResponse.decode, @@ -45,10 +32,6 @@ export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) = clientResolver, deps: [QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse] }); -export const useGetSpendableBalanceByDenom = buildUseQuery({ - builderQueryFn: createGetSpendableBalanceByDenom, - queryKeyPrefix: "SpendableBalanceByDenomQuery" -}); export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTotalSupplyRequest.encode, decode: QueryTotalSupplyResponse.decode, @@ -57,10 +40,6 @@ export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryTotalSupplyRequest, QueryTotalSupplyResponse] }); -export const useGetTotalSupply = buildUseQuery({ - builderQueryFn: createGetTotalSupply, - queryKeyPrefix: "TotalSupplyQuery" -}); export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySupplyOfRequest.encode, decode: QuerySupplyOfResponse.decode, @@ -69,10 +48,6 @@ export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetSupplyOf, - queryKeyPrefix: "SupplyOfQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -81,10 +56,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomMetadataRequest.encode, decode: QueryDenomMetadataResponse.decode, @@ -93,10 +64,6 @@ export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryDenomMetadataRequest, QueryDenomMetadataResponse] }); -export const useGetDenomMetadata = buildUseQuery({ - builderQueryFn: createGetDenomMetadata, - queryKeyPrefix: "DenomMetadataQuery" -}); export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomMetadataByQueryStringRequest.encode, decode: QueryDenomMetadataByQueryStringResponse.decode, @@ -105,10 +72,6 @@ export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver clientResolver, deps: [QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse] }); -export const useGetDenomMetadataByQueryString = buildUseQuery({ - builderQueryFn: createGetDenomMetadataByQueryString, - queryKeyPrefix: "DenomMetadataByQueryStringQuery" -}); export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomsMetadataRequest.encode, decode: QueryDenomsMetadataResponse.decode, @@ -117,10 +80,6 @@ export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryDenomsMetadataRequest, QueryDenomsMetadataResponse] }); -export const useGetDenomsMetadata = buildUseQuery({ - builderQueryFn: createGetDenomsMetadata, - queryKeyPrefix: "DenomsMetadataQuery" -}); export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomOwnersRequest.encode, decode: QueryDenomOwnersResponse.decode, @@ -129,10 +88,6 @@ export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryDenomOwnersRequest, QueryDenomOwnersResponse] }); -export const useGetDenomOwners = buildUseQuery({ - builderQueryFn: createGetDenomOwners, - queryKeyPrefix: "DenomOwnersQuery" -}); export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomOwnersByQueryRequest.encode, decode: QueryDenomOwnersByQueryResponse.decode, @@ -141,10 +96,6 @@ export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse] }); -export const useGetDenomOwnersByQuery = buildUseQuery({ - builderQueryFn: createGetDenomOwnersByQuery, - queryKeyPrefix: "DenomOwnersByQueryQuery" -}); export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySendEnabledRequest.encode, decode: QuerySendEnabledResponse.decode, @@ -152,8 +103,4 @@ export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery method: "SendEnabled", clientResolver, deps: [QuerySendEnabledRequest, QuerySendEnabledResponse] -}); -export const useGetSendEnabled = buildUseQuery({ - builderQueryFn: createGetSendEnabled, - queryKeyPrefix: "SendEnabledQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..8548218a --- /dev/null +++ b/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts @@ -0,0 +1,55 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +export const useGetBalance = buildUseQuery({ + builderQueryFn: createGetBalance, + queryKeyPrefix: "BalanceQuery" +}); +export const useGetAllBalances = buildUseQuery({ + builderQueryFn: createGetAllBalances, + queryKeyPrefix: "AllBalancesQuery" +}); +export const useGetSpendableBalances = buildUseQuery({ + builderQueryFn: createGetSpendableBalances, + queryKeyPrefix: "SpendableBalancesQuery" +}); +export const useGetSpendableBalanceByDenom = buildUseQuery({ + builderQueryFn: createGetSpendableBalanceByDenom, + queryKeyPrefix: "SpendableBalanceByDenomQuery" +}); +export const useGetTotalSupply = buildUseQuery({ + builderQueryFn: createGetTotalSupply, + queryKeyPrefix: "TotalSupplyQuery" +}); +export const useGetSupplyOf = buildUseQuery({ + builderQueryFn: createGetSupplyOf, + queryKeyPrefix: "SupplyOfQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDenomMetadata = buildUseQuery({ + builderQueryFn: createGetDenomMetadata, + queryKeyPrefix: "DenomMetadataQuery" +}); +export const useGetDenomMetadataByQueryString = buildUseQuery({ + builderQueryFn: createGetDenomMetadataByQueryString, + queryKeyPrefix: "DenomMetadataByQueryStringQuery" +}); +export const useGetDenomsMetadata = buildUseQuery({ + builderQueryFn: createGetDenomsMetadata, + queryKeyPrefix: "DenomsMetadataQuery" +}); +export const useGetDenomOwners = buildUseQuery({ + builderQueryFn: createGetDenomOwners, + queryKeyPrefix: "DenomOwnersQuery" +}); +export const useGetDenomOwnersByQuery = buildUseQuery({ + builderQueryFn: createGetDenomOwnersByQuery, + queryKeyPrefix: "DenomOwnersByQueryQuery" +}); +export const useGetSendEnabled = buildUseQuery({ + builderQueryFn: createGetSendEnabled, + queryKeyPrefix: "SendEnabledQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts index 08715cb8..e63f91ea 100644 --- a/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createSend -}); export const createMultiSend = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgMultiSend.typeUrl, @@ -19,9 +15,6 @@ export const createMultiSend = (clientResolver?: SigningClientResolver) => build converters: toConverters(MsgMultiSend), deps: [MsgMultiSend] }); -export const useMultiSend = buildUseMutation({ - builderMutationFn: createMultiSend -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -29,16 +22,10 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createSetSendEnabled = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSetSendEnabled.typeUrl, encoders: toEncoders(MsgSetSendEnabled), converters: toConverters(MsgSetSendEnabled), deps: [MsgSetSendEnabled] -}); -export const useSetSendEnabled = buildUseMutation({ - builderMutationFn: createSetSendEnabled }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..8162fe19 --- /dev/null +++ b/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +export const useSend = buildUseMutation({ + builderMutationFn: createSend +}); +export const useMultiSend = buildUseMutation({ + builderMutationFn: createMultiSend +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useSetSendEnabled = buildUseMutation({ + builderMutationFn: createSetSendEnabled +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts index 026741df..28bf1510 100644 --- a/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) converters: toConverters(MsgSetWithdrawAddress), deps: [MsgSetWithdrawAddress] }); -export const useSetWithdrawAddress = buildUseMutation({ - builderMutationFn: createSetWithdrawAddress -}); export const createWithdrawDelegatorReward = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawDelegatorReward.typeUrl, @@ -19,9 +15,6 @@ export const createWithdrawDelegatorReward = (clientResolver?: SigningClientReso converters: toConverters(MsgWithdrawDelegatorReward), deps: [MsgWithdrawDelegatorReward] }); -export const useWithdrawDelegatorReward = buildUseMutation({ - builderMutationFn: createWithdrawDelegatorReward -}); export const createWithdrawValidatorCommission = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawValidatorCommission.typeUrl, @@ -29,9 +22,6 @@ export const createWithdrawValidatorCommission = (clientResolver?: SigningClient converters: toConverters(MsgWithdrawValidatorCommission), deps: [MsgWithdrawValidatorCommission] }); -export const useWithdrawValidatorCommission = buildUseMutation({ - builderMutationFn: createWithdrawValidatorCommission -}); export const createFundCommunityPool = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgFundCommunityPool.typeUrl, @@ -39,9 +29,6 @@ export const createFundCommunityPool = (clientResolver?: SigningClientResolver) converters: toConverters(MsgFundCommunityPool), deps: [MsgFundCommunityPool] }); -export const useFundCommunityPool = buildUseMutation({ - builderMutationFn: createFundCommunityPool -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -49,9 +36,6 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCommunityPoolSpend.typeUrl, @@ -59,16 +43,10 @@ export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) converters: toConverters(MsgCommunityPoolSpend), deps: [MsgCommunityPoolSpend] }); -export const useCommunityPoolSpend = buildUseMutation({ - builderMutationFn: createCommunityPoolSpend -}); export const createDepositValidatorRewardsPool = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDepositValidatorRewardsPool.typeUrl, encoders: toEncoders(MsgDepositValidatorRewardsPool), converters: toConverters(MsgDepositValidatorRewardsPool), deps: [MsgDepositValidatorRewardsPool] -}); -export const useDepositValidatorRewardsPool = buildUseMutation({ - builderMutationFn: createDepositValidatorRewardsPool }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..8cbf0e11 --- /dev/null +++ b/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +export const useSetWithdrawAddress = buildUseMutation({ + builderMutationFn: createSetWithdrawAddress +}); +export const useWithdrawDelegatorReward = buildUseMutation({ + builderMutationFn: createWithdrawDelegatorReward +}); +export const useWithdrawValidatorCommission = buildUseMutation({ + builderMutationFn: createWithdrawValidatorCommission +}); +export const useFundCommunityPool = buildUseMutation({ + builderMutationFn: createFundCommunityPool +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useCommunityPoolSpend = buildUseMutation({ + builderMutationFn: createCommunityPoolSpend +}); +export const useDepositValidatorRewardsPool = buildUseMutation({ + builderMutationFn: createDepositValidatorRewardsPool +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts index 70353a74..344d1149 100644 --- a/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; export const createGrantAllowance = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createGrantAllowance = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgGrantAllowance), deps: [MsgGrantAllowance] }); -export const useGrantAllowance = buildUseMutation({ - builderMutationFn: createGrantAllowance -}); export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRevokeAllowance.typeUrl, @@ -19,16 +15,10 @@ export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgRevokeAllowance), deps: [MsgRevokeAllowance] }); -export const useRevokeAllowance = buildUseMutation({ - builderMutationFn: createRevokeAllowance -}); export const createPruneAllowances = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgPruneAllowances.typeUrl, encoders: toEncoders(MsgPruneAllowances), converters: toConverters(MsgPruneAllowances), deps: [MsgPruneAllowances] -}); -export const usePruneAllowances = buildUseMutation({ - builderMutationFn: createPruneAllowances }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..72de88dc --- /dev/null +++ b/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts @@ -0,0 +1,12 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +export const useGrantAllowance = buildUseMutation({ + builderMutationFn: createGrantAllowance +}); +export const useRevokeAllowance = buildUseMutation({ + builderMutationFn: createRevokeAllowance +}); +export const usePruneAllowances = buildUseMutation({ + builderMutationFn: createPruneAllowances +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/gov/v1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/gov/v1/tx.rpc.func.ts index 1e23e126..21c06ac1 100644 --- a/libs/injective-react/src/cosmos/gov/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/gov/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSubmitProposal = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgSubmitProposal), deps: [MsgSubmitProposal] }); -export const useSubmitProposal = buildUseMutation({ - builderMutationFn: createSubmitProposal -}); export const createExecLegacyContent = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExecLegacyContent.typeUrl, @@ -19,9 +15,6 @@ export const createExecLegacyContent = (clientResolver?: SigningClientResolver) converters: toConverters(MsgExecLegacyContent), deps: [MsgExecLegacyContent] }); -export const useExecLegacyContent = buildUseMutation({ - builderMutationFn: createExecLegacyContent -}); export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVote.typeUrl, @@ -29,9 +22,6 @@ export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createVote -}); export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVoteWeighted.typeUrl, @@ -39,9 +29,6 @@ export const createVoteWeighted = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgVoteWeighted), deps: [MsgVoteWeighted] }); -export const useVoteWeighted = buildUseMutation({ - builderMutationFn: createVoteWeighted -}); export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDeposit.typeUrl, @@ -49,9 +36,6 @@ export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx converters: toConverters(MsgDeposit), deps: [MsgDeposit] }); -export const useDeposit = buildUseMutation({ - builderMutationFn: createDeposit -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -59,16 +43,10 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createCancelProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelProposal.typeUrl, encoders: toEncoders(MsgCancelProposal), converters: toConverters(MsgCancelProposal), deps: [MsgCancelProposal] -}); -export const useCancelProposal = buildUseMutation({ - builderMutationFn: createCancelProposal }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts new file mode 100644 index 00000000..45490d6f --- /dev/null +++ b/libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const useExecLegacyContent = buildUseMutation({ + builderMutationFn: createExecLegacyContent +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useCancelProposal = buildUseMutation({ + builderMutationFn: createCancelProposal +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.func.ts b/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.func.ts index fc5de4b2..93896ba8 100644 --- a/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalRequest.encode, @@ -9,10 +8,6 @@ export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetProposal, - queryKeyPrefix: "ProposalQuery" -}); export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalsRequest.encode, decode: QueryProposalsResponse.decode, @@ -21,10 +16,6 @@ export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetProposals, - queryKeyPrefix: "ProposalsQuery" -}); export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVoteRequest.encode, decode: QueryVoteResponse.decode, @@ -33,10 +24,6 @@ export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetVote, - queryKeyPrefix: "VoteQuery" -}); export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVotesRequest.encode, decode: QueryVotesResponse.decode, @@ -45,10 +32,6 @@ export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetVotes, - queryKeyPrefix: "VotesQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -57,10 +40,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDepositRequest.encode, decode: QueryDepositResponse.decode, @@ -69,10 +48,6 @@ export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetDeposit, - queryKeyPrefix: "DepositQuery" -}); export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDepositsRequest.encode, decode: QueryDepositsResponse.decode, @@ -81,10 +56,6 @@ export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetDeposits, - queryKeyPrefix: "DepositsQuery" -}); export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTallyResultRequest.encode, decode: QueryTallyResultResponse.decode, @@ -92,8 +63,4 @@ export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery method: "TallyResult", clientResolver, deps: [QueryTallyResultRequest, QueryTallyResultResponse] -}); -export const useGetTallyResult = buildUseQuery({ - builderQueryFn: createGetTallyResult, - queryKeyPrefix: "TallyResultQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..5f574fba --- /dev/null +++ b/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts @@ -0,0 +1,35 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +export const useGetProposal = buildUseQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposals = buildUseQuery({ + builderQueryFn: createGetProposals, + queryKeyPrefix: "ProposalsQuery" +}); +export const useGetVote = buildUseQuery({ + builderQueryFn: createGetVote, + queryKeyPrefix: "VoteQuery" +}); +export const useGetVotes = buildUseQuery({ + builderQueryFn: createGetVotes, + queryKeyPrefix: "VotesQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDeposit = buildUseQuery({ + builderQueryFn: createGetDeposit, + queryKeyPrefix: "DepositQuery" +}); +export const useGetDeposits = buildUseQuery({ + builderQueryFn: createGetDeposits, + queryKeyPrefix: "DepositsQuery" +}); +export const useGetTallyResult = buildUseQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts index 3dcafe92..aecdfcb7 100644 --- a/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSubmitProposal = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgSubmitProposal), deps: [MsgSubmitProposal] }); -export const useSubmitProposal = buildUseMutation({ - builderMutationFn: createSubmitProposal -}); export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVote.typeUrl, @@ -19,9 +15,6 @@ export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createVote -}); export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVoteWeighted.typeUrl, @@ -29,16 +22,10 @@ export const createVoteWeighted = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgVoteWeighted), deps: [MsgVoteWeighted] }); -export const useVoteWeighted = buildUseMutation({ - builderMutationFn: createVoteWeighted -}); export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDeposit.typeUrl, encoders: toEncoders(MsgDeposit), converters: toConverters(MsgDeposit), deps: [MsgDeposit] -}); -export const useDeposit = buildUseMutation({ - builderMutationFn: createDeposit }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..b2fb7805 --- /dev/null +++ b/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/group/v1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/group/v1/tx.rpc.func.ts index c580c689..b04f9190 100644 --- a/libs/injective-react/src/cosmos/group/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/group/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; export const createCreateGroup = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateGroup = (clientResolver?: SigningClientResolver) => bui converters: toConverters(MsgCreateGroup), deps: [MsgCreateGroup] }); -export const useCreateGroup = buildUseMutation({ - builderMutationFn: createCreateGroup -}); export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupMembers.typeUrl, @@ -19,9 +15,6 @@ export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) converters: toConverters(MsgUpdateGroupMembers), deps: [MsgUpdateGroupMembers] }); -export const useUpdateGroupMembers = buildUseMutation({ - builderMutationFn: createUpdateGroupMembers -}); export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupAdmin.typeUrl, @@ -29,9 +22,6 @@ export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgUpdateGroupAdmin), deps: [MsgUpdateGroupAdmin] }); -export const useUpdateGroupAdmin = buildUseMutation({ - builderMutationFn: createUpdateGroupAdmin -}); export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupMetadata.typeUrl, @@ -39,9 +29,6 @@ export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver converters: toConverters(MsgUpdateGroupMetadata), deps: [MsgUpdateGroupMetadata] }); -export const useUpdateGroupMetadata = buildUseMutation({ - builderMutationFn: createUpdateGroupMetadata -}); export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateGroupPolicy.typeUrl, @@ -49,9 +36,6 @@ export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) converters: toConverters(MsgCreateGroupPolicy), deps: [MsgCreateGroupPolicy] }); -export const useCreateGroupPolicy = buildUseMutation({ - builderMutationFn: createCreateGroupPolicy -}); export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateGroupWithPolicy.typeUrl, @@ -59,9 +43,6 @@ export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolv converters: toConverters(MsgCreateGroupWithPolicy), deps: [MsgCreateGroupWithPolicy] }); -export const useCreateGroupWithPolicy = buildUseMutation({ - builderMutationFn: createCreateGroupWithPolicy -}); export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupPolicyAdmin.typeUrl, @@ -69,9 +50,6 @@ export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResol converters: toConverters(MsgUpdateGroupPolicyAdmin), deps: [MsgUpdateGroupPolicyAdmin] }); -export const useUpdateGroupPolicyAdmin = buildUseMutation({ - builderMutationFn: createUpdateGroupPolicyAdmin -}); export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupPolicyDecisionPolicy.typeUrl, @@ -79,9 +57,6 @@ export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningCl converters: toConverters(MsgUpdateGroupPolicyDecisionPolicy), deps: [MsgUpdateGroupPolicyDecisionPolicy] }); -export const useUpdateGroupPolicyDecisionPolicy = buildUseMutation({ - builderMutationFn: createUpdateGroupPolicyDecisionPolicy -}); export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupPolicyMetadata.typeUrl, @@ -89,9 +64,6 @@ export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientRe converters: toConverters(MsgUpdateGroupPolicyMetadata), deps: [MsgUpdateGroupPolicyMetadata] }); -export const useUpdateGroupPolicyMetadata = buildUseMutation({ - builderMutationFn: createUpdateGroupPolicyMetadata -}); export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSubmitProposal.typeUrl, @@ -99,9 +71,6 @@ export const createSubmitProposal = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgSubmitProposal), deps: [MsgSubmitProposal] }); -export const useSubmitProposal = buildUseMutation({ - builderMutationFn: createSubmitProposal -}); export const createWithdrawProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawProposal.typeUrl, @@ -109,9 +78,6 @@ export const createWithdrawProposal = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgWithdrawProposal), deps: [MsgWithdrawProposal] }); -export const useWithdrawProposal = buildUseMutation({ - builderMutationFn: createWithdrawProposal -}); export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVote.typeUrl, @@ -119,9 +85,6 @@ export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createVote -}); export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExec.typeUrl, @@ -129,16 +92,10 @@ export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createExec -}); export const createLeaveGroup = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgLeaveGroup.typeUrl, encoders: toEncoders(MsgLeaveGroup), converters: toConverters(MsgLeaveGroup), deps: [MsgLeaveGroup] -}); -export const useLeaveGroup = buildUseMutation({ - builderMutationFn: createLeaveGroup }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts new file mode 100644 index 00000000..25f1ac84 --- /dev/null +++ b/libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts @@ -0,0 +1,45 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +export const useCreateGroup = buildUseMutation({ + builderMutationFn: createCreateGroup +}); +export const useUpdateGroupMembers = buildUseMutation({ + builderMutationFn: createUpdateGroupMembers +}); +export const useUpdateGroupAdmin = buildUseMutation({ + builderMutationFn: createUpdateGroupAdmin +}); +export const useUpdateGroupMetadata = buildUseMutation({ + builderMutationFn: createUpdateGroupMetadata +}); +export const useCreateGroupPolicy = buildUseMutation({ + builderMutationFn: createCreateGroupPolicy +}); +export const useCreateGroupWithPolicy = buildUseMutation({ + builderMutationFn: createCreateGroupWithPolicy +}); +export const useUpdateGroupPolicyAdmin = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyAdmin +}); +export const useUpdateGroupPolicyDecisionPolicy = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyDecisionPolicy +}); +export const useUpdateGroupPolicyMetadata = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyMetadata +}); +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const useWithdrawProposal = buildUseMutation({ + builderMutationFn: createWithdrawProposal +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const useExec = buildUseMutation({ + builderMutationFn: createExec +}); +export const useLeaveGroup = buildUseMutation({ + builderMutationFn: createLeaveGroup +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.func.ts b/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.func.ts index 9673c3d2..679c908c 100644 --- a/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorsRequest.encode, @@ -9,10 +8,6 @@ export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QueryValidatorsRequest, QueryValidatorsResponse] }); -export const useGetValidators = buildUseQuery({ - builderQueryFn: createGetValidators, - queryKeyPrefix: "ValidatorsQuery" -}); export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorRequest.encode, decode: QueryValidatorResponse.decode, @@ -21,10 +16,6 @@ export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetValidator, - queryKeyPrefix: "ValidatorQuery" -}); export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorDelegationsRequest.encode, decode: QueryValidatorDelegationsResponse.decode, @@ -33,10 +24,6 @@ export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse] }); -export const useGetValidatorDelegations = buildUseQuery({ - builderQueryFn: createGetValidatorDelegations, - queryKeyPrefix: "ValidatorDelegationsQuery" -}); export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorUnbondingDelegationsRequest.encode, decode: QueryValidatorUnbondingDelegationsResponse.decode, @@ -45,10 +32,6 @@ export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResol clientResolver, deps: [QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse] }); -export const useGetValidatorUnbondingDelegations = buildUseQuery({ - builderQueryFn: createGetValidatorUnbondingDelegations, - queryKeyPrefix: "ValidatorUnbondingDelegationsQuery" -}); export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegationRequest.encode, decode: QueryDelegationResponse.decode, @@ -57,10 +40,6 @@ export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QueryDelegationRequest, QueryDelegationResponse] }); -export const useGetDelegation = buildUseQuery({ - builderQueryFn: createGetDelegation, - queryKeyPrefix: "DelegationQuery" -}); export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryUnbondingDelegationRequest.encode, decode: QueryUnbondingDelegationResponse.decode, @@ -69,10 +48,6 @@ export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse] }); -export const useGetUnbondingDelegation = buildUseQuery({ - builderQueryFn: createGetUnbondingDelegation, - queryKeyPrefix: "UnbondingDelegationQuery" -}); export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorDelegationsRequest.encode, decode: QueryDelegatorDelegationsResponse.decode, @@ -81,10 +56,6 @@ export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse] }); -export const useGetDelegatorDelegations = buildUseQuery({ - builderQueryFn: createGetDelegatorDelegations, - queryKeyPrefix: "DelegatorDelegationsQuery" -}); export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorUnbondingDelegationsRequest.encode, decode: QueryDelegatorUnbondingDelegationsResponse.decode, @@ -93,10 +64,6 @@ export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResol clientResolver, deps: [QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse] }); -export const useGetDelegatorUnbondingDelegations = buildUseQuery({ - builderQueryFn: createGetDelegatorUnbondingDelegations, - queryKeyPrefix: "DelegatorUnbondingDelegationsQuery" -}); export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryRedelegationsRequest.encode, decode: QueryRedelegationsResponse.decode, @@ -105,10 +72,6 @@ export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryRedelegationsRequest, QueryRedelegationsResponse] }); -export const useGetRedelegations = buildUseQuery({ - builderQueryFn: createGetRedelegations, - queryKeyPrefix: "RedelegationsQuery" -}); export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorValidatorsRequest.encode, decode: QueryDelegatorValidatorsResponse.decode, @@ -117,10 +80,6 @@ export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse] }); -export const useGetDelegatorValidators = buildUseQuery({ - builderQueryFn: createGetDelegatorValidators, - queryKeyPrefix: "DelegatorValidatorsQuery" -}); export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorValidatorRequest.encode, decode: QueryDelegatorValidatorResponse.decode, @@ -129,10 +88,6 @@ export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse] }); -export const useGetDelegatorValidator = buildUseQuery({ - builderQueryFn: createGetDelegatorValidator, - queryKeyPrefix: "DelegatorValidatorQuery" -}); export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryHistoricalInfoRequest.encode, decode: QueryHistoricalInfoResponse.decode, @@ -141,10 +96,6 @@ export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryHistoricalInfoRequest, QueryHistoricalInfoResponse] }); -export const useGetHistoricalInfo = buildUseQuery({ - builderQueryFn: createGetHistoricalInfo, - queryKeyPrefix: "HistoricalInfoQuery" -}); export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPoolRequest.encode, decode: QueryPoolResponse.decode, @@ -153,10 +104,6 @@ export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetPool, - queryKeyPrefix: "PoolQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -164,8 +111,4 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..07eb6ea0 --- /dev/null +++ b/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts @@ -0,0 +1,59 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +export const useGetValidators = buildUseQuery({ + builderQueryFn: createGetValidators, + queryKeyPrefix: "ValidatorsQuery" +}); +export const useGetValidator = buildUseQuery({ + builderQueryFn: createGetValidator, + queryKeyPrefix: "ValidatorQuery" +}); +export const useGetValidatorDelegations = buildUseQuery({ + builderQueryFn: createGetValidatorDelegations, + queryKeyPrefix: "ValidatorDelegationsQuery" +}); +export const useGetValidatorUnbondingDelegations = buildUseQuery({ + builderQueryFn: createGetValidatorUnbondingDelegations, + queryKeyPrefix: "ValidatorUnbondingDelegationsQuery" +}); +export const useGetDelegation = buildUseQuery({ + builderQueryFn: createGetDelegation, + queryKeyPrefix: "DelegationQuery" +}); +export const useGetUnbondingDelegation = buildUseQuery({ + builderQueryFn: createGetUnbondingDelegation, + queryKeyPrefix: "UnbondingDelegationQuery" +}); +export const useGetDelegatorDelegations = buildUseQuery({ + builderQueryFn: createGetDelegatorDelegations, + queryKeyPrefix: "DelegatorDelegationsQuery" +}); +export const useGetDelegatorUnbondingDelegations = buildUseQuery({ + builderQueryFn: createGetDelegatorUnbondingDelegations, + queryKeyPrefix: "DelegatorUnbondingDelegationsQuery" +}); +export const useGetRedelegations = buildUseQuery({ + builderQueryFn: createGetRedelegations, + queryKeyPrefix: "RedelegationsQuery" +}); +export const useGetDelegatorValidators = buildUseQuery({ + builderQueryFn: createGetDelegatorValidators, + queryKeyPrefix: "DelegatorValidatorsQuery" +}); +export const useGetDelegatorValidator = buildUseQuery({ + builderQueryFn: createGetDelegatorValidator, + queryKeyPrefix: "DelegatorValidatorQuery" +}); +export const useGetHistoricalInfo = buildUseQuery({ + builderQueryFn: createGetHistoricalInfo, + queryKeyPrefix: "HistoricalInfoQuery" +}); +export const useGetPool = buildUseQuery({ + builderQueryFn: createGetPool, + queryKeyPrefix: "PoolQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts index 85f1b7a8..98ad73ff 100644 --- a/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; export const createCreateValidator = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateValidator = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgCreateValidator), deps: [MsgCreateValidator] }); -export const useCreateValidator = buildUseMutation({ - builderMutationFn: createCreateValidator -}); export const createEditValidator = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgEditValidator.typeUrl, @@ -19,9 +15,6 @@ export const createEditValidator = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgEditValidator), deps: [MsgEditValidator] }); -export const useEditValidator = buildUseMutation({ - builderMutationFn: createEditValidator -}); export const createDelegate = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDelegate.typeUrl, @@ -29,9 +22,6 @@ export const createDelegate = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgDelegate), deps: [MsgDelegate] }); -export const useDelegate = buildUseMutation({ - builderMutationFn: createDelegate -}); export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBeginRedelegate.typeUrl, @@ -39,9 +29,6 @@ export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgBeginRedelegate), deps: [MsgBeginRedelegate] }); -export const useBeginRedelegate = buildUseMutation({ - builderMutationFn: createBeginRedelegate -}); export const createUndelegate = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUndelegate.typeUrl, @@ -49,9 +36,6 @@ export const createUndelegate = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgUndelegate), deps: [MsgUndelegate] }); -export const useUndelegate = buildUseMutation({ - builderMutationFn: createUndelegate -}); export const createCancelUnbondingDelegation = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelUnbondingDelegation.typeUrl, @@ -59,16 +43,10 @@ export const createCancelUnbondingDelegation = (clientResolver?: SigningClientRe converters: toConverters(MsgCancelUnbondingDelegation), deps: [MsgCancelUnbondingDelegation] }); -export const useCancelUnbondingDelegation = buildUseMutation({ - builderMutationFn: createCancelUnbondingDelegation -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..a5acb059 --- /dev/null +++ b/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateValidator = buildUseMutation({ + builderMutationFn: createCreateValidator +}); +export const useEditValidator = buildUseMutation({ + builderMutationFn: createEditValidator +}); +export const useDelegate = buildUseMutation({ + builderMutationFn: createDelegate +}); +export const useBeginRedelegate = buildUseMutation({ + builderMutationFn: createBeginRedelegate +}); +export const useUndelegate = buildUseMutation({ + builderMutationFn: createUndelegate +}); +export const useCancelUnbondingDelegation = buildUseMutation({ + builderMutationFn: createCancelUnbondingDelegation +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.func.ts b/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.func.ts index 685a17ba..096bfb4f 100644 --- a/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.func.ts +++ b/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ encode: SimulateRequest.encode, @@ -9,10 +8,6 @@ export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetSimulate, - queryKeyPrefix: "SimulateQuery" -}); export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ encode: GetTxRequest.encode, decode: GetTxResponse.decode, @@ -21,10 +16,6 @@ export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetGetTx, - queryKeyPrefix: "GetTxQuery" -}); export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery({ encode: BroadcastTxRequest.encode, decode: BroadcastTxResponse.decode, @@ -33,10 +24,6 @@ export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [BroadcastTxRequest, BroadcastTxResponse] }); -export const useGetBroadcastTx = buildUseQuery({ - builderQueryFn: createGetBroadcastTx, - queryKeyPrefix: "BroadcastTxQuery" -}); export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery({ encode: GetTxsEventRequest.encode, decode: GetTxsEventResponse.decode, @@ -45,10 +32,6 @@ export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [GetTxsEventRequest, GetTxsEventResponse] }); -export const useGetGetTxsEvent = buildUseQuery({ - builderQueryFn: createGetGetTxsEvent, - queryKeyPrefix: "GetTxsEventQuery" -}); export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQuery({ encode: GetBlockWithTxsRequest.encode, decode: GetBlockWithTxsResponse.decode, @@ -57,10 +40,6 @@ export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [GetBlockWithTxsRequest, GetBlockWithTxsResponse] }); -export const useGetGetBlockWithTxs = buildUseQuery({ - builderQueryFn: createGetGetBlockWithTxs, - queryKeyPrefix: "GetBlockWithTxsQuery" -}); export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ encode: TxDecodeRequest.encode, decode: TxDecodeResponse.decode, @@ -69,10 +48,6 @@ export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetTxDecode, - queryKeyPrefix: "TxDecodeQuery" -}); export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ encode: TxEncodeRequest.encode, decode: TxEncodeResponse.decode, @@ -81,10 +56,6 @@ export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetTxEncode, - queryKeyPrefix: "TxEncodeQuery" -}); export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQuery({ encode: TxEncodeAminoRequest.encode, decode: TxEncodeAminoResponse.decode, @@ -93,10 +64,6 @@ export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [TxEncodeAminoRequest, TxEncodeAminoResponse] }); -export const useGetTxEncodeAmino = buildUseQuery({ - builderQueryFn: createGetTxEncodeAmino, - queryKeyPrefix: "TxEncodeAminoQuery" -}); export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQuery({ encode: TxDecodeAminoRequest.encode, decode: TxDecodeAminoResponse.decode, @@ -104,8 +71,4 @@ export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQue method: "TxDecodeAmino", clientResolver, deps: [TxDecodeAminoRequest, TxDecodeAminoResponse] -}); -export const useGetTxDecodeAmino = buildUseQuery({ - builderQueryFn: createGetTxDecodeAmino, - queryKeyPrefix: "TxDecodeAminoQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts b/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts new file mode 100644 index 00000000..53085d29 --- /dev/null +++ b/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts @@ -0,0 +1,39 @@ +import { buildUseQuery } from "../../../react-query"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +export const useGetSimulate = buildUseQuery({ + builderQueryFn: createGetSimulate, + queryKeyPrefix: "SimulateQuery" +}); +export const useGetGetTx = buildUseQuery({ + builderQueryFn: createGetGetTx, + queryKeyPrefix: "GetTxQuery" +}); +export const useGetBroadcastTx = buildUseQuery({ + builderQueryFn: createGetBroadcastTx, + queryKeyPrefix: "BroadcastTxQuery" +}); +export const useGetGetTxsEvent = buildUseQuery({ + builderQueryFn: createGetGetTxsEvent, + queryKeyPrefix: "GetTxsEventQuery" +}); +export const useGetGetBlockWithTxs = buildUseQuery({ + builderQueryFn: createGetGetBlockWithTxs, + queryKeyPrefix: "GetBlockWithTxsQuery" +}); +export const useGetTxDecode = buildUseQuery({ + builderQueryFn: createGetTxDecode, + queryKeyPrefix: "TxDecodeQuery" +}); +export const useGetTxEncode = buildUseQuery({ + builderQueryFn: createGetTxEncode, + queryKeyPrefix: "TxEncodeQuery" +}); +export const useGetTxEncodeAmino = buildUseQuery({ + builderQueryFn: createGetTxEncodeAmino, + queryKeyPrefix: "TxEncodeAminoQuery" +}); +export const useGetTxDecodeAmino = buildUseQuery({ + builderQueryFn: createGetTxDecodeAmino, + queryKeyPrefix: "TxDecodeAminoQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts index d73007c6..d693bff4 100644 --- a/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; export const createCreateVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateVestingAccount = (clientResolver?: SigningClientResolve converters: toConverters(MsgCreateVestingAccount), deps: [MsgCreateVestingAccount] }); -export const useCreateVestingAccount = buildUseMutation({ - builderMutationFn: createCreateVestingAccount -}); export const createCreatePermanentLockedAccount = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreatePermanentLockedAccount.typeUrl, @@ -19,16 +15,10 @@ export const createCreatePermanentLockedAccount = (clientResolver?: SigningClien converters: toConverters(MsgCreatePermanentLockedAccount), deps: [MsgCreatePermanentLockedAccount] }); -export const useCreatePermanentLockedAccount = buildUseMutation({ - builderMutationFn: createCreatePermanentLockedAccount -}); export const createCreatePeriodicVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreatePeriodicVestingAccount.typeUrl, encoders: toEncoders(MsgCreatePeriodicVestingAccount), converters: toConverters(MsgCreatePeriodicVestingAccount), deps: [MsgCreatePeriodicVestingAccount] -}); -export const useCreatePeriodicVestingAccount = buildUseMutation({ - builderMutationFn: createCreatePeriodicVestingAccount }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..9c725c4e --- /dev/null +++ b/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts @@ -0,0 +1,12 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +export const useCreateVestingAccount = buildUseMutation({ + builderMutationFn: createCreateVestingAccount +}); +export const useCreatePermanentLockedAccount = buildUseMutation({ + builderMutationFn: createCreatePermanentLockedAccount +}); +export const useCreatePeriodicVestingAccount = buildUseMutation({ + builderMutationFn: createCreatePeriodicVestingAccount +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.func.ts b/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.func.ts index 32e4b695..eff06fce 100644 --- a/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.func.ts +++ b/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractInfoRequest.encode, @@ -9,10 +8,6 @@ export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryContractInfoRequest, QueryContractInfoResponse] }); -export const useGetContractInfo = buildUseQuery({ - builderQueryFn: createGetContractInfo, - queryKeyPrefix: "ContractInfoQuery" -}); export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractHistoryRequest.encode, decode: QueryContractHistoryResponse.decode, @@ -21,10 +16,6 @@ export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryContractHistoryRequest, QueryContractHistoryResponse] }); -export const useGetContractHistory = buildUseQuery({ - builderQueryFn: createGetContractHistory, - queryKeyPrefix: "ContractHistoryQuery" -}); export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractsByCodeRequest.encode, decode: QueryContractsByCodeResponse.decode, @@ -33,10 +24,6 @@ export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryContractsByCodeRequest, QueryContractsByCodeResponse] }); -export const useGetContractsByCode = buildUseQuery({ - builderQueryFn: createGetContractsByCode, - queryKeyPrefix: "ContractsByCodeQuery" -}); export const createGetAllContractState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllContractStateRequest.encode, decode: QueryAllContractStateResponse.decode, @@ -45,10 +32,6 @@ export const createGetAllContractState = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryAllContractStateRequest, QueryAllContractStateResponse] }); -export const useGetAllContractState = buildUseQuery({ - builderQueryFn: createGetAllContractState, - queryKeyPrefix: "AllContractStateQuery" -}); export const createGetRawContractState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryRawContractStateRequest.encode, decode: QueryRawContractStateResponse.decode, @@ -57,10 +40,6 @@ export const createGetRawContractState = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryRawContractStateRequest, QueryRawContractStateResponse] }); -export const useGetRawContractState = buildUseQuery({ - builderQueryFn: createGetRawContractState, - queryKeyPrefix: "RawContractStateQuery" -}); export const createGetSmartContractState = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySmartContractStateRequest.encode, decode: QuerySmartContractStateResponse.decode, @@ -69,10 +48,6 @@ export const createGetSmartContractState = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QuerySmartContractStateRequest, QuerySmartContractStateResponse] }); -export const useGetSmartContractState = buildUseQuery({ - builderQueryFn: createGetSmartContractState, - queryKeyPrefix: "SmartContractStateQuery" -}); export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCodeRequest.encode, decode: QueryCodeResponse.decode, @@ -81,10 +56,6 @@ export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetCode, - queryKeyPrefix: "CodeQuery" -}); export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCodesRequest.encode, decode: QueryCodesResponse.decode, @@ -93,10 +64,6 @@ export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetCodes, - queryKeyPrefix: "CodesQuery" -}); export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCodeInfoRequest.encode, decode: QueryCodeInfoResponse.decode, @@ -105,10 +72,6 @@ export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetCodeInfo, - queryKeyPrefix: "CodeInfoQuery" -}); export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPinnedCodesRequest.encode, decode: QueryPinnedCodesResponse.decode, @@ -117,10 +80,6 @@ export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryPinnedCodesRequest, QueryPinnedCodesResponse] }); -export const useGetPinnedCodes = buildUseQuery({ - builderQueryFn: createGetPinnedCodes, - queryKeyPrefix: "PinnedCodesQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -129,10 +88,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetContractsByCreator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractsByCreatorRequest.encode, decode: QueryContractsByCreatorResponse.decode, @@ -141,10 +96,6 @@ export const createGetContractsByCreator = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryContractsByCreatorRequest, QueryContractsByCreatorResponse] }); -export const useGetContractsByCreator = buildUseQuery({ - builderQueryFn: createGetContractsByCreator, - queryKeyPrefix: "ContractsByCreatorQuery" -}); export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryWasmLimitsConfigRequest.encode, decode: QueryWasmLimitsConfigResponse.decode, @@ -153,10 +104,6 @@ export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse] }); -export const useGetWasmLimitsConfig = buildUseQuery({ - builderQueryFn: createGetWasmLimitsConfig, - queryKeyPrefix: "WasmLimitsConfigQuery" -}); export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBuildAddressRequest.encode, decode: QueryBuildAddressResponse.decode, @@ -164,8 +111,4 @@ export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuer method: "BuildAddress", clientResolver, deps: [QueryBuildAddressRequest, QueryBuildAddressResponse] -}); -export const useGetBuildAddress = buildUseQuery({ - builderQueryFn: createGetBuildAddress, - queryKeyPrefix: "BuildAddressQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts b/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts new file mode 100644 index 00000000..b71686d0 --- /dev/null +++ b/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts @@ -0,0 +1,59 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +export const useGetContractInfo = buildUseQuery({ + builderQueryFn: createGetContractInfo, + queryKeyPrefix: "ContractInfoQuery" +}); +export const useGetContractHistory = buildUseQuery({ + builderQueryFn: createGetContractHistory, + queryKeyPrefix: "ContractHistoryQuery" +}); +export const useGetContractsByCode = buildUseQuery({ + builderQueryFn: createGetContractsByCode, + queryKeyPrefix: "ContractsByCodeQuery" +}); +export const useGetAllContractState = buildUseQuery({ + builderQueryFn: createGetAllContractState, + queryKeyPrefix: "AllContractStateQuery" +}); +export const useGetRawContractState = buildUseQuery({ + builderQueryFn: createGetRawContractState, + queryKeyPrefix: "RawContractStateQuery" +}); +export const useGetSmartContractState = buildUseQuery({ + builderQueryFn: createGetSmartContractState, + queryKeyPrefix: "SmartContractStateQuery" +}); +export const useGetCode = buildUseQuery({ + builderQueryFn: createGetCode, + queryKeyPrefix: "CodeQuery" +}); +export const useGetCodes = buildUseQuery({ + builderQueryFn: createGetCodes, + queryKeyPrefix: "CodesQuery" +}); +export const useGetCodeInfo = buildUseQuery({ + builderQueryFn: createGetCodeInfo, + queryKeyPrefix: "CodeInfoQuery" +}); +export const useGetPinnedCodes = buildUseQuery({ + builderQueryFn: createGetPinnedCodes, + queryKeyPrefix: "PinnedCodesQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetContractsByCreator = buildUseQuery({ + builderQueryFn: createGetContractsByCreator, + queryKeyPrefix: "ContractsByCreatorQuery" +}); +export const useGetWasmLimitsConfig = buildUseQuery({ + builderQueryFn: createGetWasmLimitsConfig, + queryKeyPrefix: "WasmLimitsConfigQuery" +}); +export const useGetBuildAddress = buildUseQuery({ + builderQueryFn: createGetBuildAddress, + queryKeyPrefix: "BuildAddressQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts b/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts index db479ca4..5c34fb61 100644 --- a/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; export const createStoreCode = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createStoreCode = (clientResolver?: SigningClientResolver) => build converters: toConverters(MsgStoreCode), deps: [MsgStoreCode] }); -export const useStoreCode = buildUseMutation({ - builderMutationFn: createStoreCode -}); export const createInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantiateContract.typeUrl, @@ -19,9 +15,6 @@ export const createInstantiateContract = (clientResolver?: SigningClientResolver converters: toConverters(MsgInstantiateContract), deps: [MsgInstantiateContract] }); -export const useInstantiateContract = buildUseMutation({ - builderMutationFn: createInstantiateContract -}); export const createInstantiateContract2 = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantiateContract2.typeUrl, @@ -29,9 +22,6 @@ export const createInstantiateContract2 = (clientResolver?: SigningClientResolve converters: toConverters(MsgInstantiateContract2), deps: [MsgInstantiateContract2] }); -export const useInstantiateContract2 = buildUseMutation({ - builderMutationFn: createInstantiateContract2 -}); export const createExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExecuteContract.typeUrl, @@ -39,9 +29,6 @@ export const createExecuteContract = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgExecuteContract), deps: [MsgExecuteContract] }); -export const useExecuteContract = buildUseMutation({ - builderMutationFn: createExecuteContract -}); export const createMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgMigrateContract.typeUrl, @@ -49,9 +36,6 @@ export const createMigrateContract = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgMigrateContract), deps: [MsgMigrateContract] }); -export const useMigrateContract = buildUseMutation({ - builderMutationFn: createMigrateContract -}); export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateAdmin.typeUrl, @@ -59,9 +43,6 @@ export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => bui converters: toConverters(MsgUpdateAdmin), deps: [MsgUpdateAdmin] }); -export const useUpdateAdmin = buildUseMutation({ - builderMutationFn: createUpdateAdmin -}); export const createClearAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgClearAdmin.typeUrl, @@ -69,9 +50,6 @@ export const createClearAdmin = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgClearAdmin), deps: [MsgClearAdmin] }); -export const useClearAdmin = buildUseMutation({ - builderMutationFn: createClearAdmin -}); export const createUpdateInstantiateConfig = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateInstantiateConfig.typeUrl, @@ -79,9 +57,6 @@ export const createUpdateInstantiateConfig = (clientResolver?: SigningClientReso converters: toConverters(MsgUpdateInstantiateConfig), deps: [MsgUpdateInstantiateConfig] }); -export const useUpdateInstantiateConfig = buildUseMutation({ - builderMutationFn: createUpdateInstantiateConfig -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -89,9 +64,6 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createSudoContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSudoContract.typeUrl, @@ -99,9 +71,6 @@ export const createSudoContract = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgSudoContract), deps: [MsgSudoContract] }); -export const useSudoContract = buildUseMutation({ - builderMutationFn: createSudoContract -}); export const createPinCodes = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgPinCodes.typeUrl, @@ -109,9 +78,6 @@ export const createPinCodes = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgPinCodes), deps: [MsgPinCodes] }); -export const usePinCodes = buildUseMutation({ - builderMutationFn: createPinCodes -}); export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUnpinCodes.typeUrl, @@ -119,9 +85,6 @@ export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgUnpinCodes), deps: [MsgUnpinCodes] }); -export const useUnpinCodes = buildUseMutation({ - builderMutationFn: createUnpinCodes -}); export const createStoreAndInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgStoreAndInstantiateContract.typeUrl, @@ -129,9 +92,6 @@ export const createStoreAndInstantiateContract = (clientResolver?: SigningClient converters: toConverters(MsgStoreAndInstantiateContract), deps: [MsgStoreAndInstantiateContract] }); -export const useStoreAndInstantiateContract = buildUseMutation({ - builderMutationFn: createStoreAndInstantiateContract -}); export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRemoveCodeUploadParamsAddresses.typeUrl, @@ -139,9 +99,6 @@ export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningCl converters: toConverters(MsgRemoveCodeUploadParamsAddresses), deps: [MsgRemoveCodeUploadParamsAddresses] }); -export const useRemoveCodeUploadParamsAddresses = buildUseMutation({ - builderMutationFn: createRemoveCodeUploadParamsAddresses -}); export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgAddCodeUploadParamsAddresses.typeUrl, @@ -149,9 +106,6 @@ export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClien converters: toConverters(MsgAddCodeUploadParamsAddresses), deps: [MsgAddCodeUploadParamsAddresses] }); -export const useAddCodeUploadParamsAddresses = buildUseMutation({ - builderMutationFn: createAddCodeUploadParamsAddresses -}); export const createStoreAndMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgStoreAndMigrateContract.typeUrl, @@ -159,16 +113,10 @@ export const createStoreAndMigrateContract = (clientResolver?: SigningClientReso converters: toConverters(MsgStoreAndMigrateContract), deps: [MsgStoreAndMigrateContract] }); -export const useStoreAndMigrateContract = buildUseMutation({ - builderMutationFn: createStoreAndMigrateContract -}); export const createUpdateContractLabel = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateContractLabel.typeUrl, encoders: toEncoders(MsgUpdateContractLabel), converters: toConverters(MsgUpdateContractLabel), deps: [MsgUpdateContractLabel] -}); -export const useUpdateContractLabel = buildUseMutation({ - builderMutationFn: createUpdateContractLabel }); \ No newline at end of file diff --git a/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts b/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts new file mode 100644 index 00000000..602a0f30 --- /dev/null +++ b/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts @@ -0,0 +1,54 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +export const useStoreCode = buildUseMutation({ + builderMutationFn: createStoreCode +}); +export const useInstantiateContract = buildUseMutation({ + builderMutationFn: createInstantiateContract +}); +export const useInstantiateContract2 = buildUseMutation({ + builderMutationFn: createInstantiateContract2 +}); +export const useExecuteContract = buildUseMutation({ + builderMutationFn: createExecuteContract +}); +export const useMigrateContract = buildUseMutation({ + builderMutationFn: createMigrateContract +}); +export const useUpdateAdmin = buildUseMutation({ + builderMutationFn: createUpdateAdmin +}); +export const useClearAdmin = buildUseMutation({ + builderMutationFn: createClearAdmin +}); +export const useUpdateInstantiateConfig = buildUseMutation({ + builderMutationFn: createUpdateInstantiateConfig +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useSudoContract = buildUseMutation({ + builderMutationFn: createSudoContract +}); +export const usePinCodes = buildUseMutation({ + builderMutationFn: createPinCodes +}); +export const useUnpinCodes = buildUseMutation({ + builderMutationFn: createUnpinCodes +}); +export const useStoreAndInstantiateContract = buildUseMutation({ + builderMutationFn: createStoreAndInstantiateContract +}); +export const useRemoveCodeUploadParamsAddresses = buildUseMutation({ + builderMutationFn: createRemoveCodeUploadParamsAddresses +}); +export const useAddCodeUploadParamsAddresses = buildUseMutation({ + builderMutationFn: createAddCodeUploadParamsAddresses +}); +export const useStoreAndMigrateContract = buildUseMutation({ + builderMutationFn: createStoreAndMigrateContract +}); +export const useUpdateContractLabel = buildUseMutation({ + builderMutationFn: createUpdateContractLabel +}); \ No newline at end of file diff --git a/libs/injective-react/src/extern.ts b/libs/injective-react/src/extern.ts index 86edda83..eddf067e 100644 --- a/libs/injective-react/src/extern.ts +++ b/libs/injective-react/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/helper-func-types.ts b/libs/injective-react/src/helper-func-types.ts index 7abfde29..7aeeb7bc 100644 --- a/libs/injective-react/src/helper-func-types.ts +++ b/libs/injective-react/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/helpers.ts b/libs/injective-react/src/helpers.ts index 64d3444c..ba68bbdb 100644 --- a/libs/injective-react/src/helpers.ts +++ b/libs/injective-react/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts b/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts index cab032ea..c38aa495 100644 --- a/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgTransfer, MsgUpdateParams } from "./tx"; export const createTransfer = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,16 +8,10 @@ export const createTransfer = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgTransfer), deps: [MsgTransfer] }); -export const useTransfer = buildUseMutation({ - builderMutationFn: createTransfer -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts new file mode 100644 index 00000000..7130abbd --- /dev/null +++ b/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts @@ -0,0 +1,9 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +export const useTransfer = buildUseMutation({ + builderMutationFn: createTransfer +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.func.ts b/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.func.ts index a47e53ee..10dad0fc 100644 --- a/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgChannelOpenInit), deps: [MsgChannelOpenInit] }); -export const useChannelOpenInit = buildUseMutation({ - builderMutationFn: createChannelOpenInit -}); export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelOpenTry.typeUrl, @@ -19,9 +15,6 @@ export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgChannelOpenTry), deps: [MsgChannelOpenTry] }); -export const useChannelOpenTry = buildUseMutation({ - builderMutationFn: createChannelOpenTry -}); export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelOpenAck.typeUrl, @@ -29,9 +22,6 @@ export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgChannelOpenAck), deps: [MsgChannelOpenAck] }); -export const useChannelOpenAck = buildUseMutation({ - builderMutationFn: createChannelOpenAck -}); export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelOpenConfirm.typeUrl, @@ -39,9 +29,6 @@ export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelOpenConfirm), deps: [MsgChannelOpenConfirm] }); -export const useChannelOpenConfirm = buildUseMutation({ - builderMutationFn: createChannelOpenConfirm -}); export const createChannelCloseInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelCloseInit.typeUrl, @@ -49,9 +36,6 @@ export const createChannelCloseInit = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgChannelCloseInit), deps: [MsgChannelCloseInit] }); -export const useChannelCloseInit = buildUseMutation({ - builderMutationFn: createChannelCloseInit -}); export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelCloseConfirm.typeUrl, @@ -59,9 +43,6 @@ export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver converters: toConverters(MsgChannelCloseConfirm), deps: [MsgChannelCloseConfirm] }); -export const useChannelCloseConfirm = buildUseMutation({ - builderMutationFn: createChannelCloseConfirm -}); export const createRecvPacket = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRecvPacket.typeUrl, @@ -69,9 +50,6 @@ export const createRecvPacket = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgRecvPacket), deps: [MsgRecvPacket] }); -export const useRecvPacket = buildUseMutation({ - builderMutationFn: createRecvPacket -}); export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgTimeout.typeUrl, @@ -79,9 +57,6 @@ export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx converters: toConverters(MsgTimeout), deps: [MsgTimeout] }); -export const useTimeout = buildUseMutation({ - builderMutationFn: createTimeout -}); export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgTimeoutOnClose.typeUrl, @@ -89,9 +64,6 @@ export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgTimeoutOnClose), deps: [MsgTimeoutOnClose] }); -export const useTimeoutOnClose = buildUseMutation({ - builderMutationFn: createTimeoutOnClose -}); export const createAcknowledgement = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgAcknowledgement.typeUrl, @@ -99,9 +71,6 @@ export const createAcknowledgement = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgAcknowledgement), deps: [MsgAcknowledgement] }); -export const useAcknowledgement = buildUseMutation({ - builderMutationFn: createAcknowledgement -}); export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeInit.typeUrl, @@ -109,9 +78,6 @@ export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeInit), deps: [MsgChannelUpgradeInit] }); -export const useChannelUpgradeInit = buildUseMutation({ - builderMutationFn: createChannelUpgradeInit -}); export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeTry.typeUrl, @@ -119,9 +85,6 @@ export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeTry), deps: [MsgChannelUpgradeTry] }); -export const useChannelUpgradeTry = buildUseMutation({ - builderMutationFn: createChannelUpgradeTry -}); export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeAck.typeUrl, @@ -129,9 +92,6 @@ export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeAck), deps: [MsgChannelUpgradeAck] }); -export const useChannelUpgradeAck = buildUseMutation({ - builderMutationFn: createChannelUpgradeAck -}); export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeConfirm.typeUrl, @@ -139,9 +99,6 @@ export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolv converters: toConverters(MsgChannelUpgradeConfirm), deps: [MsgChannelUpgradeConfirm] }); -export const useChannelUpgradeConfirm = buildUseMutation({ - builderMutationFn: createChannelUpgradeConfirm -}); export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeOpen.typeUrl, @@ -149,9 +106,6 @@ export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeOpen), deps: [MsgChannelUpgradeOpen] }); -export const useChannelUpgradeOpen = buildUseMutation({ - builderMutationFn: createChannelUpgradeOpen -}); export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeTimeout.typeUrl, @@ -159,9 +113,6 @@ export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolv converters: toConverters(MsgChannelUpgradeTimeout), deps: [MsgChannelUpgradeTimeout] }); -export const useChannelUpgradeTimeout = buildUseMutation({ - builderMutationFn: createChannelUpgradeTimeout -}); export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeCancel.typeUrl, @@ -169,9 +120,6 @@ export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolve converters: toConverters(MsgChannelUpgradeCancel), deps: [MsgChannelUpgradeCancel] }); -export const useChannelUpgradeCancel = buildUseMutation({ - builderMutationFn: createChannelUpgradeCancel -}); export const createUpdateChannelParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -179,16 +127,10 @@ export const createUpdateChannelParams = (clientResolver?: SigningClientResolver converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateChannelParams = buildUseMutation({ - builderMutationFn: createUpdateChannelParams -}); export const createPruneAcknowledgements = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgPruneAcknowledgements.typeUrl, encoders: toEncoders(MsgPruneAcknowledgements), converters: toConverters(MsgPruneAcknowledgements), deps: [MsgPruneAcknowledgements] -}); -export const usePruneAcknowledgements = buildUseMutation({ - builderMutationFn: createPruneAcknowledgements }); \ No newline at end of file diff --git a/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts new file mode 100644 index 00000000..a11760aa --- /dev/null +++ b/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts @@ -0,0 +1,60 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +export const useChannelOpenInit = buildUseMutation({ + builderMutationFn: createChannelOpenInit +}); +export const useChannelOpenTry = buildUseMutation({ + builderMutationFn: createChannelOpenTry +}); +export const useChannelOpenAck = buildUseMutation({ + builderMutationFn: createChannelOpenAck +}); +export const useChannelOpenConfirm = buildUseMutation({ + builderMutationFn: createChannelOpenConfirm +}); +export const useChannelCloseInit = buildUseMutation({ + builderMutationFn: createChannelCloseInit +}); +export const useChannelCloseConfirm = buildUseMutation({ + builderMutationFn: createChannelCloseConfirm +}); +export const useRecvPacket = buildUseMutation({ + builderMutationFn: createRecvPacket +}); +export const useTimeout = buildUseMutation({ + builderMutationFn: createTimeout +}); +export const useTimeoutOnClose = buildUseMutation({ + builderMutationFn: createTimeoutOnClose +}); +export const useAcknowledgement = buildUseMutation({ + builderMutationFn: createAcknowledgement +}); +export const useChannelUpgradeInit = buildUseMutation({ + builderMutationFn: createChannelUpgradeInit +}); +export const useChannelUpgradeTry = buildUseMutation({ + builderMutationFn: createChannelUpgradeTry +}); +export const useChannelUpgradeAck = buildUseMutation({ + builderMutationFn: createChannelUpgradeAck +}); +export const useChannelUpgradeConfirm = buildUseMutation({ + builderMutationFn: createChannelUpgradeConfirm +}); +export const useChannelUpgradeOpen = buildUseMutation({ + builderMutationFn: createChannelUpgradeOpen +}); +export const useChannelUpgradeTimeout = buildUseMutation({ + builderMutationFn: createChannelUpgradeTimeout +}); +export const useChannelUpgradeCancel = buildUseMutation({ + builderMutationFn: createChannelUpgradeCancel +}); +export const useUpdateChannelParams = buildUseMutation({ + builderMutationFn: createUpdateChannelParams +}); +export const usePruneAcknowledgements = buildUseMutation({ + builderMutationFn: createPruneAcknowledgements +}); \ No newline at end of file diff --git a/libs/injective-react/src/ibc/core/client/v1/tx.rpc.func.ts b/libs/injective-react/src/ibc/core/client/v1/tx.rpc.func.ts index 7a754add..456651dd 100644 --- a/libs/injective-react/src/ibc/core/client/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/ibc/core/client/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; export const createCreateClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateClient = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgCreateClient), deps: [MsgCreateClient] }); -export const useCreateClient = buildUseMutation({ - builderMutationFn: createCreateClient -}); export const createUpdateClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateClient.typeUrl, @@ -19,9 +15,6 @@ export const createUpdateClient = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateClient), deps: [MsgUpdateClient] }); -export const useUpdateClient = buildUseMutation({ - builderMutationFn: createUpdateClient -}); export const createUpgradeClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpgradeClient.typeUrl, @@ -29,9 +22,6 @@ export const createUpgradeClient = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgUpgradeClient), deps: [MsgUpgradeClient] }); -export const useUpgradeClient = buildUseMutation({ - builderMutationFn: createUpgradeClient -}); export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSubmitMisbehaviour.typeUrl, @@ -39,9 +29,6 @@ export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) converters: toConverters(MsgSubmitMisbehaviour), deps: [MsgSubmitMisbehaviour] }); -export const useSubmitMisbehaviour = buildUseMutation({ - builderMutationFn: createSubmitMisbehaviour -}); export const createRecoverClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRecoverClient.typeUrl, @@ -49,9 +36,6 @@ export const createRecoverClient = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgRecoverClient), deps: [MsgRecoverClient] }); -export const useRecoverClient = buildUseMutation({ - builderMutationFn: createRecoverClient -}); export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgIBCSoftwareUpgrade.typeUrl, @@ -59,16 +43,10 @@ export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) converters: toConverters(MsgIBCSoftwareUpgrade), deps: [MsgIBCSoftwareUpgrade] }); -export const useIBCSoftwareUpgrade = buildUseMutation({ - builderMutationFn: createIBCSoftwareUpgrade -}); export const createUpdateClientParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateClientParams = buildUseMutation({ - builderMutationFn: createUpdateClientParams }); \ No newline at end of file diff --git a/libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts new file mode 100644 index 00000000..81bbd9ca --- /dev/null +++ b/libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +export const useCreateClient = buildUseMutation({ + builderMutationFn: createCreateClient +}); +export const useUpdateClient = buildUseMutation({ + builderMutationFn: createUpdateClient +}); +export const useUpgradeClient = buildUseMutation({ + builderMutationFn: createUpgradeClient +}); +export const useSubmitMisbehaviour = buildUseMutation({ + builderMutationFn: createSubmitMisbehaviour +}); +export const useRecoverClient = buildUseMutation({ + builderMutationFn: createRecoverClient +}); +export const useIBCSoftwareUpgrade = buildUseMutation({ + builderMutationFn: createIBCSoftwareUpgrade +}); +export const useUpdateClientParams = buildUseMutation({ + builderMutationFn: createUpdateClientParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.func.ts b/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.func.ts index 7d58334e..6ee23357 100644 --- a/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) converters: toConverters(MsgConnectionOpenInit), deps: [MsgConnectionOpenInit] }); -export const useConnectionOpenInit = buildUseMutation({ - builderMutationFn: createConnectionOpenInit -}); export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgConnectionOpenTry.typeUrl, @@ -19,9 +15,6 @@ export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) converters: toConverters(MsgConnectionOpenTry), deps: [MsgConnectionOpenTry] }); -export const useConnectionOpenTry = buildUseMutation({ - builderMutationFn: createConnectionOpenTry -}); export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgConnectionOpenAck.typeUrl, @@ -29,9 +22,6 @@ export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) converters: toConverters(MsgConnectionOpenAck), deps: [MsgConnectionOpenAck] }); -export const useConnectionOpenAck = buildUseMutation({ - builderMutationFn: createConnectionOpenAck -}); export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgConnectionOpenConfirm.typeUrl, @@ -39,16 +29,10 @@ export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolv converters: toConverters(MsgConnectionOpenConfirm), deps: [MsgConnectionOpenConfirm] }); -export const useConnectionOpenConfirm = buildUseMutation({ - builderMutationFn: createConnectionOpenConfirm -}); export const createUpdateConnectionParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateConnectionParams = buildUseMutation({ - builderMutationFn: createUpdateConnectionParams }); \ No newline at end of file diff --git a/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts new file mode 100644 index 00000000..f4eefea2 --- /dev/null +++ b/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts @@ -0,0 +1,18 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +export const useConnectionOpenInit = buildUseMutation({ + builderMutationFn: createConnectionOpenInit +}); +export const useConnectionOpenTry = buildUseMutation({ + builderMutationFn: createConnectionOpenTry +}); +export const useConnectionOpenAck = buildUseMutation({ + builderMutationFn: createConnectionOpenAck +}); +export const useConnectionOpenConfirm = buildUseMutation({ + builderMutationFn: createConnectionOpenConfirm +}); +export const useUpdateConnectionParams = buildUseMutation({ + builderMutationFn: createUpdateConnectionParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/auction/v1beta1/query.rpc.func.ts b/libs/injective-react/src/injective/auction/v1beta1/query.rpc.func.ts index 3870d57f..aef87a11 100644 --- a/libs/injective-react/src/injective/auction/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/auction/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; export const createGetAuctionParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAuctionParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetAuctionParams = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryAuctionParamsRequest, QueryAuctionParamsResponse] }); -export const useGetAuctionParams = buildUseQuery({ - builderQueryFn: createGetAuctionParams, - queryKeyPrefix: "AuctionParamsQuery" -}); export const createGetCurrentAuctionBasket = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCurrentAuctionBasketRequest.encode, decode: QueryCurrentAuctionBasketResponse.decode, @@ -21,10 +16,6 @@ export const createGetCurrentAuctionBasket = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse] }); -export const useGetCurrentAuctionBasket = buildUseQuery({ - builderQueryFn: createGetCurrentAuctionBasket, - queryKeyPrefix: "CurrentAuctionBasketQuery" -}); export const createGetAuctionModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -33,10 +24,6 @@ export const createGetAuctionModuleState = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] }); -export const useGetAuctionModuleState = buildUseQuery({ - builderQueryFn: createGetAuctionModuleState, - queryKeyPrefix: "AuctionModuleStateQuery" -}); export const createGetLastAuctionResult = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryLastAuctionResultRequest.encode, decode: QueryLastAuctionResultResponse.decode, @@ -44,8 +31,4 @@ export const createGetLastAuctionResult = (clientResolver?: RpcResolver) => buil method: "LastAuctionResult", clientResolver, deps: [QueryLastAuctionResultRequest, QueryLastAuctionResultResponse] -}); -export const useGetLastAuctionResult = buildUseQuery({ - builderQueryFn: createGetLastAuctionResult, - queryKeyPrefix: "LastAuctionResultQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..e9f78a82 --- /dev/null +++ b/libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts @@ -0,0 +1,19 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; +import { createGetAuctionParams, createGetCurrentAuctionBasket, createGetAuctionModuleState, createGetLastAuctionResult } from "./query.rpc.func.ts"; +export const useGetAuctionParams = buildUseQuery({ + builderQueryFn: createGetAuctionParams, + queryKeyPrefix: "AuctionParamsQuery" +}); +export const useGetCurrentAuctionBasket = buildUseQuery({ + builderQueryFn: createGetCurrentAuctionBasket, + queryKeyPrefix: "CurrentAuctionBasketQuery" +}); +export const useGetAuctionModuleState = buildUseQuery({ + builderQueryFn: createGetAuctionModuleState, + queryKeyPrefix: "AuctionModuleStateQuery" +}); +export const useGetLastAuctionResult = buildUseQuery({ + builderQueryFn: createGetLastAuctionResult, + queryKeyPrefix: "LastAuctionResultQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.func.ts index e8919581..03dbd06e 100644 --- a/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgBid, MsgUpdateParams } from "./tx"; export const createBid = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,16 +8,10 @@ export const createBid = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createBid -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..e4129d80 --- /dev/null +++ b/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts @@ -0,0 +1,9 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgBid, MsgUpdateParams } from "./tx"; +import { createBid, createUpdateParams } from "./tx.rpc.func.ts"; +export const useBid = buildUseMutation({ + builderMutationFn: createBid +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.func.ts b/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.func.ts index 3a1ce265..97005d48 100644 --- a/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; export const createGetQueryExchangeParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryExchangeParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetQueryExchangeParams = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryExchangeParamsRequest, QueryExchangeParamsResponse] }); -export const useGetQueryExchangeParams = buildUseQuery({ - builderQueryFn: createGetQueryExchangeParams, - queryKeyPrefix: "QueryExchangeParamsQuery" -}); export const createGetSubaccountDeposits = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountDepositsRequest.encode, decode: QuerySubaccountDepositsResponse.decode, @@ -21,10 +16,6 @@ export const createGetSubaccountDeposits = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse] }); -export const useGetSubaccountDeposits = buildUseQuery({ - builderQueryFn: createGetSubaccountDeposits, - queryKeyPrefix: "SubaccountDepositsQuery" -}); export const createGetSubaccountDeposit = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountDepositRequest.encode, decode: QuerySubaccountDepositResponse.decode, @@ -33,10 +24,6 @@ export const createGetSubaccountDeposit = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QuerySubaccountDepositRequest, QuerySubaccountDepositResponse] }); -export const useGetSubaccountDeposit = buildUseQuery({ - builderQueryFn: createGetSubaccountDeposit, - queryKeyPrefix: "SubaccountDepositQuery" -}); export const createGetExchangeBalances = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryExchangeBalancesRequest.encode, decode: QueryExchangeBalancesResponse.decode, @@ -45,10 +32,6 @@ export const createGetExchangeBalances = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryExchangeBalancesRequest, QueryExchangeBalancesResponse] }); -export const useGetExchangeBalances = buildUseQuery({ - builderQueryFn: createGetExchangeBalances, - queryKeyPrefix: "ExchangeBalancesQuery" -}); export const createGetAggregateVolume = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAggregateVolumeRequest.encode, decode: QueryAggregateVolumeResponse.decode, @@ -57,10 +40,6 @@ export const createGetAggregateVolume = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryAggregateVolumeRequest, QueryAggregateVolumeResponse] }); -export const useGetAggregateVolume = buildUseQuery({ - builderQueryFn: createGetAggregateVolume, - queryKeyPrefix: "AggregateVolumeQuery" -}); export const createGetAggregateVolumes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAggregateVolumesRequest.encode, decode: QueryAggregateVolumesResponse.decode, @@ -69,10 +48,6 @@ export const createGetAggregateVolumes = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryAggregateVolumesRequest, QueryAggregateVolumesResponse] }); -export const useGetAggregateVolumes = buildUseQuery({ - builderQueryFn: createGetAggregateVolumes, - queryKeyPrefix: "AggregateVolumesQuery" -}); export const createGetAggregateMarketVolume = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAggregateMarketVolumeRequest.encode, decode: QueryAggregateMarketVolumeResponse.decode, @@ -81,10 +56,6 @@ export const createGetAggregateMarketVolume = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse] }); -export const useGetAggregateMarketVolume = buildUseQuery({ - builderQueryFn: createGetAggregateMarketVolume, - queryKeyPrefix: "AggregateMarketVolumeQuery" -}); export const createGetAggregateMarketVolumes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAggregateMarketVolumesRequest.encode, decode: QueryAggregateMarketVolumesResponse.decode, @@ -93,10 +64,6 @@ export const createGetAggregateMarketVolumes = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse] }); -export const useGetAggregateMarketVolumes = buildUseQuery({ - builderQueryFn: createGetAggregateMarketVolumes, - queryKeyPrefix: "AggregateMarketVolumesQuery" -}); export const createGetDenomDecimal = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomDecimalRequest.encode, decode: QueryDenomDecimalResponse.decode, @@ -105,10 +72,6 @@ export const createGetDenomDecimal = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryDenomDecimalRequest, QueryDenomDecimalResponse] }); -export const useGetDenomDecimal = buildUseQuery({ - builderQueryFn: createGetDenomDecimal, - queryKeyPrefix: "DenomDecimalQuery" -}); export const createGetDenomDecimals = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomDecimalsRequest.encode, decode: QueryDenomDecimalsResponse.decode, @@ -117,10 +80,6 @@ export const createGetDenomDecimals = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryDenomDecimalsRequest, QueryDenomDecimalsResponse] }); -export const useGetDenomDecimals = buildUseQuery({ - builderQueryFn: createGetDenomDecimals, - queryKeyPrefix: "DenomDecimalsQuery" -}); export const createGetSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpotMarketsRequest.encode, decode: QuerySpotMarketsResponse.decode, @@ -129,10 +88,6 @@ export const createGetSpotMarkets = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QuerySpotMarketsRequest, QuerySpotMarketsResponse] }); -export const useGetSpotMarkets = buildUseQuery({ - builderQueryFn: createGetSpotMarkets, - queryKeyPrefix: "SpotMarketsQuery" -}); export const createGetSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpotMarketRequest.encode, decode: QuerySpotMarketResponse.decode, @@ -141,10 +96,6 @@ export const createGetSpotMarket = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QuerySpotMarketRequest, QuerySpotMarketResponse] }); -export const useGetSpotMarket = buildUseQuery({ - builderQueryFn: createGetSpotMarket, - queryKeyPrefix: "SpotMarketQuery" -}); export const createGetFullSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryFullSpotMarketsRequest.encode, decode: QueryFullSpotMarketsResponse.decode, @@ -153,10 +104,6 @@ export const createGetFullSpotMarkets = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse] }); -export const useGetFullSpotMarkets = buildUseQuery({ - builderQueryFn: createGetFullSpotMarkets, - queryKeyPrefix: "FullSpotMarketsQuery" -}); export const createGetFullSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryFullSpotMarketRequest.encode, decode: QueryFullSpotMarketResponse.decode, @@ -165,10 +112,6 @@ export const createGetFullSpotMarket = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryFullSpotMarketRequest, QueryFullSpotMarketResponse] }); -export const useGetFullSpotMarket = buildUseQuery({ - builderQueryFn: createGetFullSpotMarket, - queryKeyPrefix: "FullSpotMarketQuery" -}); export const createGetSpotOrderbook = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpotOrderbookRequest.encode, decode: QuerySpotOrderbookResponse.decode, @@ -177,10 +120,6 @@ export const createGetSpotOrderbook = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QuerySpotOrderbookRequest, QuerySpotOrderbookResponse] }); -export const useGetSpotOrderbook = buildUseQuery({ - builderQueryFn: createGetSpotOrderbook, - queryKeyPrefix: "SpotOrderbookQuery" -}); export const createGetTraderSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTraderSpotOrdersRequest.encode, decode: QueryTraderSpotOrdersResponse.decode, @@ -189,10 +128,6 @@ export const createGetTraderSpotOrders = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse] }); -export const useGetTraderSpotOrders = buildUseQuery({ - builderQueryFn: createGetTraderSpotOrders, - queryKeyPrefix: "TraderSpotOrdersQuery" -}); export const createGetAccountAddressSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountAddressSpotOrdersRequest.encode, decode: QueryAccountAddressSpotOrdersResponse.decode, @@ -201,10 +136,6 @@ export const createGetAccountAddressSpotOrders = (clientResolver?: RpcResolver) clientResolver, deps: [QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse] }); -export const useGetAccountAddressSpotOrders = buildUseQuery({ - builderQueryFn: createGetAccountAddressSpotOrders, - queryKeyPrefix: "AccountAddressSpotOrdersQuery" -}); export const createGetSpotOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpotOrdersByHashesRequest.encode, decode: QuerySpotOrdersByHashesResponse.decode, @@ -213,10 +144,6 @@ export const createGetSpotOrdersByHashes = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse] }); -export const useGetSpotOrdersByHashes = buildUseQuery({ - builderQueryFn: createGetSpotOrdersByHashes, - queryKeyPrefix: "SpotOrdersByHashesQuery" -}); export const createGetSubaccountOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountOrdersRequest.encode, decode: QuerySubaccountOrdersResponse.decode, @@ -225,10 +152,6 @@ export const createGetSubaccountOrders = (clientResolver?: RpcResolver) => build clientResolver, deps: [QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse] }); -export const useGetSubaccountOrders = buildUseQuery({ - builderQueryFn: createGetSubaccountOrders, - queryKeyPrefix: "SubaccountOrdersQuery" -}); export const createGetTraderSpotTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTraderSpotOrdersRequest.encode, decode: QueryTraderSpotOrdersResponse.decode, @@ -237,10 +160,6 @@ export const createGetTraderSpotTransientOrders = (clientResolver?: RpcResolver) clientResolver, deps: [QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse] }); -export const useGetTraderSpotTransientOrders = buildUseQuery({ - builderQueryFn: createGetTraderSpotTransientOrders, - queryKeyPrefix: "TraderSpotTransientOrdersQuery" -}); export const createGetSpotMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpotMidPriceAndTOBRequest.encode, decode: QuerySpotMidPriceAndTOBResponse.decode, @@ -249,10 +168,6 @@ export const createGetSpotMidPriceAndTOB = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse] }); -export const useGetSpotMidPriceAndTOB = buildUseQuery({ - builderQueryFn: createGetSpotMidPriceAndTOB, - queryKeyPrefix: "SpotMidPriceAndTOBQuery" -}); export const createGetDerivativeMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDerivativeMidPriceAndTOBRequest.encode, decode: QueryDerivativeMidPriceAndTOBResponse.decode, @@ -261,10 +176,6 @@ export const createGetDerivativeMidPriceAndTOB = (clientResolver?: RpcResolver) clientResolver, deps: [QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse] }); -export const useGetDerivativeMidPriceAndTOB = buildUseQuery({ - builderQueryFn: createGetDerivativeMidPriceAndTOB, - queryKeyPrefix: "DerivativeMidPriceAndTOBQuery" -}); export const createGetDerivativeOrderbook = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDerivativeOrderbookRequest.encode, decode: QueryDerivativeOrderbookResponse.decode, @@ -273,10 +184,6 @@ export const createGetDerivativeOrderbook = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse] }); -export const useGetDerivativeOrderbook = buildUseQuery({ - builderQueryFn: createGetDerivativeOrderbook, - queryKeyPrefix: "DerivativeOrderbookQuery" -}); export const createGetTraderDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTraderDerivativeOrdersRequest.encode, decode: QueryTraderDerivativeOrdersResponse.decode, @@ -285,10 +192,6 @@ export const createGetTraderDerivativeOrders = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse] }); -export const useGetTraderDerivativeOrders = buildUseQuery({ - builderQueryFn: createGetTraderDerivativeOrders, - queryKeyPrefix: "TraderDerivativeOrdersQuery" -}); export const createGetAccountAddressDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountAddressDerivativeOrdersRequest.encode, decode: QueryAccountAddressDerivativeOrdersResponse.decode, @@ -297,10 +200,6 @@ export const createGetAccountAddressDerivativeOrders = (clientResolver?: RpcReso clientResolver, deps: [QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse] }); -export const useGetAccountAddressDerivativeOrders = buildUseQuery({ - builderQueryFn: createGetAccountAddressDerivativeOrders, - queryKeyPrefix: "AccountAddressDerivativeOrdersQuery" -}); export const createGetDerivativeOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDerivativeOrdersByHashesRequest.encode, decode: QueryDerivativeOrdersByHashesResponse.decode, @@ -309,10 +208,6 @@ export const createGetDerivativeOrdersByHashes = (clientResolver?: RpcResolver) clientResolver, deps: [QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse] }); -export const useGetDerivativeOrdersByHashes = buildUseQuery({ - builderQueryFn: createGetDerivativeOrdersByHashes, - queryKeyPrefix: "DerivativeOrdersByHashesQuery" -}); export const createGetTraderDerivativeTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTraderDerivativeOrdersRequest.encode, decode: QueryTraderDerivativeOrdersResponse.decode, @@ -321,10 +216,6 @@ export const createGetTraderDerivativeTransientOrders = (clientResolver?: RpcRes clientResolver, deps: [QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse] }); -export const useGetTraderDerivativeTransientOrders = buildUseQuery({ - builderQueryFn: createGetTraderDerivativeTransientOrders, - queryKeyPrefix: "TraderDerivativeTransientOrdersQuery" -}); export const createGetDerivativeMarkets = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDerivativeMarketsRequest.encode, decode: QueryDerivativeMarketsResponse.decode, @@ -333,10 +224,6 @@ export const createGetDerivativeMarkets = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse] }); -export const useGetDerivativeMarkets = buildUseQuery({ - builderQueryFn: createGetDerivativeMarkets, - queryKeyPrefix: "DerivativeMarketsQuery" -}); export const createGetDerivativeMarket = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDerivativeMarketRequest.encode, decode: QueryDerivativeMarketResponse.decode, @@ -345,10 +232,6 @@ export const createGetDerivativeMarket = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryDerivativeMarketRequest, QueryDerivativeMarketResponse] }); -export const useGetDerivativeMarket = buildUseQuery({ - builderQueryFn: createGetDerivativeMarket, - queryKeyPrefix: "DerivativeMarketQuery" -}); export const createGetDerivativeMarketAddress = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDerivativeMarketAddressRequest.encode, decode: QueryDerivativeMarketAddressResponse.decode, @@ -357,10 +240,6 @@ export const createGetDerivativeMarketAddress = (clientResolver?: RpcResolver) = clientResolver, deps: [QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse] }); -export const useGetDerivativeMarketAddress = buildUseQuery({ - builderQueryFn: createGetDerivativeMarketAddress, - queryKeyPrefix: "DerivativeMarketAddressQuery" -}); export const createGetSubaccountTradeNonce = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountTradeNonceRequest.encode, decode: QuerySubaccountTradeNonceResponse.decode, @@ -369,10 +248,6 @@ export const createGetSubaccountTradeNonce = (clientResolver?: RpcResolver) => b clientResolver, deps: [QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse] }); -export const useGetSubaccountTradeNonce = buildUseQuery({ - builderQueryFn: createGetSubaccountTradeNonce, - queryKeyPrefix: "SubaccountTradeNonceQuery" -}); export const createGetExchangeModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -381,10 +256,6 @@ export const createGetExchangeModuleState = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] }); -export const useGetExchangeModuleState = buildUseQuery({ - builderQueryFn: createGetExchangeModuleState, - queryKeyPrefix: "ExchangeModuleStateQuery" -}); export const createGetPositions = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPositionsRequest.encode, decode: QueryPositionsResponse.decode, @@ -393,10 +264,6 @@ export const createGetPositions = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetPositions, - queryKeyPrefix: "PositionsQuery" -}); export const createGetSubaccountPositions = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountPositionsRequest.encode, decode: QuerySubaccountPositionsResponse.decode, @@ -405,10 +272,6 @@ export const createGetSubaccountPositions = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse] }); -export const useGetSubaccountPositions = buildUseQuery({ - builderQueryFn: createGetSubaccountPositions, - queryKeyPrefix: "SubaccountPositionsQuery" -}); export const createGetSubaccountPositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountPositionInMarketRequest.encode, decode: QuerySubaccountPositionInMarketResponse.decode, @@ -417,10 +280,6 @@ export const createGetSubaccountPositionInMarket = (clientResolver?: RpcResolver clientResolver, deps: [QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse] }); -export const useGetSubaccountPositionInMarket = buildUseQuery({ - builderQueryFn: createGetSubaccountPositionInMarket, - queryKeyPrefix: "SubaccountPositionInMarketQuery" -}); export const createGetSubaccountEffectivePositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountEffectivePositionInMarketRequest.encode, decode: QuerySubaccountEffectivePositionInMarketResponse.decode, @@ -429,10 +288,6 @@ export const createGetSubaccountEffectivePositionInMarket = (clientResolver?: Rp clientResolver, deps: [QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse] }); -export const useGetSubaccountEffectivePositionInMarket = buildUseQuery({ - builderQueryFn: createGetSubaccountEffectivePositionInMarket, - queryKeyPrefix: "SubaccountEffectivePositionInMarketQuery" -}); export const createGetPerpetualMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPerpetualMarketInfoRequest.encode, decode: QueryPerpetualMarketInfoResponse.decode, @@ -441,10 +296,6 @@ export const createGetPerpetualMarketInfo = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse] }); -export const useGetPerpetualMarketInfo = buildUseQuery({ - builderQueryFn: createGetPerpetualMarketInfo, - queryKeyPrefix: "PerpetualMarketInfoQuery" -}); export const createGetExpiryFuturesMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryExpiryFuturesMarketInfoRequest.encode, decode: QueryExpiryFuturesMarketInfoResponse.decode, @@ -453,10 +304,6 @@ export const createGetExpiryFuturesMarketInfo = (clientResolver?: RpcResolver) = clientResolver, deps: [QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse] }); -export const useGetExpiryFuturesMarketInfo = buildUseQuery({ - builderQueryFn: createGetExpiryFuturesMarketInfo, - queryKeyPrefix: "ExpiryFuturesMarketInfoQuery" -}); export const createGetPerpetualMarketFunding = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPerpetualMarketFundingRequest.encode, decode: QueryPerpetualMarketFundingResponse.decode, @@ -465,10 +312,6 @@ export const createGetPerpetualMarketFunding = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse] }); -export const useGetPerpetualMarketFunding = buildUseQuery({ - builderQueryFn: createGetPerpetualMarketFunding, - queryKeyPrefix: "PerpetualMarketFundingQuery" -}); export const createGetSubaccountOrderMetadata = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubaccountOrderMetadataRequest.encode, decode: QuerySubaccountOrderMetadataResponse.decode, @@ -477,10 +320,6 @@ export const createGetSubaccountOrderMetadata = (clientResolver?: RpcResolver) = clientResolver, deps: [QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse] }); -export const useGetSubaccountOrderMetadata = buildUseQuery({ - builderQueryFn: createGetSubaccountOrderMetadata, - queryKeyPrefix: "SubaccountOrderMetadataQuery" -}); export const createGetTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTradeRewardPointsRequest.encode, decode: QueryTradeRewardPointsResponse.decode, @@ -489,10 +328,6 @@ export const createGetTradeRewardPoints = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse] }); -export const useGetTradeRewardPoints = buildUseQuery({ - builderQueryFn: createGetTradeRewardPoints, - queryKeyPrefix: "TradeRewardPointsQuery" -}); export const createGetPendingTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTradeRewardPointsRequest.encode, decode: QueryTradeRewardPointsResponse.decode, @@ -501,10 +336,6 @@ export const createGetPendingTradeRewardPoints = (clientResolver?: RpcResolver) clientResolver, deps: [QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse] }); -export const useGetPendingTradeRewardPoints = buildUseQuery({ - builderQueryFn: createGetPendingTradeRewardPoints, - queryKeyPrefix: "PendingTradeRewardPointsQuery" -}); export const createGetTradeRewardCampaign = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTradeRewardCampaignRequest.encode, decode: QueryTradeRewardCampaignResponse.decode, @@ -513,10 +344,6 @@ export const createGetTradeRewardCampaign = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse] }); -export const useGetTradeRewardCampaign = buildUseQuery({ - builderQueryFn: createGetTradeRewardCampaign, - queryKeyPrefix: "TradeRewardCampaignQuery" -}); export const createGetFeeDiscountAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryFeeDiscountAccountInfoRequest.encode, decode: QueryFeeDiscountAccountInfoResponse.decode, @@ -525,10 +352,6 @@ export const createGetFeeDiscountAccountInfo = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse] }); -export const useGetFeeDiscountAccountInfo = buildUseQuery({ - builderQueryFn: createGetFeeDiscountAccountInfo, - queryKeyPrefix: "FeeDiscountAccountInfoQuery" -}); export const createGetFeeDiscountSchedule = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryFeeDiscountScheduleRequest.encode, decode: QueryFeeDiscountScheduleResponse.decode, @@ -537,10 +360,6 @@ export const createGetFeeDiscountSchedule = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse] }); -export const useGetFeeDiscountSchedule = buildUseQuery({ - builderQueryFn: createGetFeeDiscountSchedule, - queryKeyPrefix: "FeeDiscountScheduleQuery" -}); export const createGetBalanceMismatches = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBalanceMismatchesRequest.encode, decode: QueryBalanceMismatchesResponse.decode, @@ -549,10 +368,6 @@ export const createGetBalanceMismatches = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse] }); -export const useGetBalanceMismatches = buildUseQuery({ - builderQueryFn: createGetBalanceMismatches, - queryKeyPrefix: "BalanceMismatchesQuery" -}); export const createGetBalanceWithBalanceHolds = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBalanceWithBalanceHoldsRequest.encode, decode: QueryBalanceWithBalanceHoldsResponse.decode, @@ -561,10 +376,6 @@ export const createGetBalanceWithBalanceHolds = (clientResolver?: RpcResolver) = clientResolver, deps: [QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse] }); -export const useGetBalanceWithBalanceHolds = buildUseQuery({ - builderQueryFn: createGetBalanceWithBalanceHolds, - queryKeyPrefix: "BalanceWithBalanceHoldsQuery" -}); export const createGetFeeDiscountTierStatistics = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryFeeDiscountTierStatisticsRequest.encode, decode: QueryFeeDiscountTierStatisticsResponse.decode, @@ -573,10 +384,6 @@ export const createGetFeeDiscountTierStatistics = (clientResolver?: RpcResolver) clientResolver, deps: [QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse] }); -export const useGetFeeDiscountTierStatistics = buildUseQuery({ - builderQueryFn: createGetFeeDiscountTierStatistics, - queryKeyPrefix: "FeeDiscountTierStatisticsQuery" -}); export const createGetMitoVaultInfos = (clientResolver?: RpcResolver) => buildQuery({ encode: MitoVaultInfosRequest.encode, decode: MitoVaultInfosResponse.decode, @@ -585,10 +392,6 @@ export const createGetMitoVaultInfos = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [MitoVaultInfosRequest, MitoVaultInfosResponse] }); -export const useGetMitoVaultInfos = buildUseQuery({ - builderQueryFn: createGetMitoVaultInfos, - queryKeyPrefix: "MitoVaultInfosQuery" -}); export const createGetQueryMarketIDFromVault = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryMarketIDFromVaultRequest.encode, decode: QueryMarketIDFromVaultResponse.decode, @@ -597,10 +400,6 @@ export const createGetQueryMarketIDFromVault = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse] }); -export const useGetQueryMarketIDFromVault = buildUseQuery({ - builderQueryFn: createGetQueryMarketIDFromVault, - queryKeyPrefix: "QueryMarketIDFromVaultQuery" -}); export const createGetHistoricalTradeRecords = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryHistoricalTradeRecordsRequest.encode, decode: QueryHistoricalTradeRecordsResponse.decode, @@ -609,10 +408,6 @@ export const createGetHistoricalTradeRecords = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse] }); -export const useGetHistoricalTradeRecords = buildUseQuery({ - builderQueryFn: createGetHistoricalTradeRecords, - queryKeyPrefix: "HistoricalTradeRecordsQuery" -}); export const createGetIsOptedOutOfRewards = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryIsOptedOutOfRewardsRequest.encode, decode: QueryIsOptedOutOfRewardsResponse.decode, @@ -621,10 +416,6 @@ export const createGetIsOptedOutOfRewards = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse] }); -export const useGetIsOptedOutOfRewards = buildUseQuery({ - builderQueryFn: createGetIsOptedOutOfRewards, - queryKeyPrefix: "IsOptedOutOfRewardsQuery" -}); export const createGetOptedOutOfRewardsAccounts = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOptedOutOfRewardsAccountsRequest.encode, decode: QueryOptedOutOfRewardsAccountsResponse.decode, @@ -633,10 +424,6 @@ export const createGetOptedOutOfRewardsAccounts = (clientResolver?: RpcResolver) clientResolver, deps: [QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse] }); -export const useGetOptedOutOfRewardsAccounts = buildUseQuery({ - builderQueryFn: createGetOptedOutOfRewardsAccounts, - queryKeyPrefix: "OptedOutOfRewardsAccountsQuery" -}); export const createGetMarketVolatility = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryMarketVolatilityRequest.encode, decode: QueryMarketVolatilityResponse.decode, @@ -645,10 +432,6 @@ export const createGetMarketVolatility = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryMarketVolatilityRequest, QueryMarketVolatilityResponse] }); -export const useGetMarketVolatility = buildUseQuery({ - builderQueryFn: createGetMarketVolatility, - queryKeyPrefix: "MarketVolatilityQuery" -}); export const createGetBinaryOptionsMarkets = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBinaryMarketsRequest.encode, decode: QueryBinaryMarketsResponse.decode, @@ -657,10 +440,6 @@ export const createGetBinaryOptionsMarkets = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryBinaryMarketsRequest, QueryBinaryMarketsResponse] }); -export const useGetBinaryOptionsMarkets = buildUseQuery({ - builderQueryFn: createGetBinaryOptionsMarkets, - queryKeyPrefix: "BinaryOptionsMarketsQuery" -}); export const createGetTraderDerivativeConditionalOrders = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTraderDerivativeConditionalOrdersRequest.encode, decode: QueryTraderDerivativeConditionalOrdersResponse.decode, @@ -669,10 +448,6 @@ export const createGetTraderDerivativeConditionalOrders = (clientResolver?: RpcR clientResolver, deps: [QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse] }); -export const useGetTraderDerivativeConditionalOrders = buildUseQuery({ - builderQueryFn: createGetTraderDerivativeConditionalOrders, - queryKeyPrefix: "TraderDerivativeConditionalOrdersQuery" -}); export const createGetMarketAtomicExecutionFeeMultiplier = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryMarketAtomicExecutionFeeMultiplierRequest.encode, decode: QueryMarketAtomicExecutionFeeMultiplierResponse.decode, @@ -681,10 +456,6 @@ export const createGetMarketAtomicExecutionFeeMultiplier = (clientResolver?: Rpc clientResolver, deps: [QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse] }); -export const useGetMarketAtomicExecutionFeeMultiplier = buildUseQuery({ - builderQueryFn: createGetMarketAtomicExecutionFeeMultiplier, - queryKeyPrefix: "MarketAtomicExecutionFeeMultiplierQuery" -}); export const createGetActiveStakeGrant = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryActiveStakeGrantRequest.encode, decode: QueryActiveStakeGrantResponse.decode, @@ -693,10 +464,6 @@ export const createGetActiveStakeGrant = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse] }); -export const useGetActiveStakeGrant = buildUseQuery({ - builderQueryFn: createGetActiveStakeGrant, - queryKeyPrefix: "ActiveStakeGrantQuery" -}); export const createGetGrantAuthorization = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGrantAuthorizationRequest.encode, decode: QueryGrantAuthorizationResponse.decode, @@ -705,10 +472,6 @@ export const createGetGrantAuthorization = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse] }); -export const useGetGrantAuthorization = buildUseQuery({ - builderQueryFn: createGetGrantAuthorization, - queryKeyPrefix: "GrantAuthorizationQuery" -}); export const createGetGrantAuthorizations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGrantAuthorizationsRequest.encode, decode: QueryGrantAuthorizationsResponse.decode, @@ -716,8 +479,4 @@ export const createGetGrantAuthorizations = (clientResolver?: RpcResolver) => bu method: "GrantAuthorizations", clientResolver, deps: [QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse] -}); -export const useGetGrantAuthorizations = buildUseQuery({ - builderQueryFn: createGetGrantAuthorizations, - queryKeyPrefix: "GrantAuthorizationsQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..0af5ccf2 --- /dev/null +++ b/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts @@ -0,0 +1,243 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; +import { createGetQueryExchangeParams, createGetSubaccountDeposits, createGetSubaccountDeposit, createGetExchangeBalances, createGetAggregateVolume, createGetAggregateVolumes, createGetAggregateMarketVolume, createGetAggregateMarketVolumes, createGetDenomDecimal, createGetDenomDecimals, createGetSpotMarkets, createGetSpotMarket, createGetFullSpotMarkets, createGetFullSpotMarket, createGetSpotOrderbook, createGetTraderSpotOrders, createGetAccountAddressSpotOrders, createGetSpotOrdersByHashes, createGetSubaccountOrders, createGetTraderSpotTransientOrders, createGetSpotMidPriceAndTOB, createGetDerivativeMidPriceAndTOB, createGetDerivativeOrderbook, createGetTraderDerivativeOrders, createGetAccountAddressDerivativeOrders, createGetDerivativeOrdersByHashes, createGetTraderDerivativeTransientOrders, createGetDerivativeMarkets, createGetDerivativeMarket, createGetDerivativeMarketAddress, createGetSubaccountTradeNonce, createGetExchangeModuleState, createGetPositions, createGetSubaccountPositions, createGetSubaccountPositionInMarket, createGetSubaccountEffectivePositionInMarket, createGetPerpetualMarketInfo, createGetExpiryFuturesMarketInfo, createGetPerpetualMarketFunding, createGetSubaccountOrderMetadata, createGetTradeRewardPoints, createGetPendingTradeRewardPoints, createGetTradeRewardCampaign, createGetFeeDiscountAccountInfo, createGetFeeDiscountSchedule, createGetBalanceMismatches, createGetBalanceWithBalanceHolds, createGetFeeDiscountTierStatistics, createGetMitoVaultInfos, createGetQueryMarketIDFromVault, createGetHistoricalTradeRecords, createGetIsOptedOutOfRewards, createGetOptedOutOfRewardsAccounts, createGetMarketVolatility, createGetBinaryOptionsMarkets, createGetTraderDerivativeConditionalOrders, createGetMarketAtomicExecutionFeeMultiplier, createGetActiveStakeGrant, createGetGrantAuthorization, createGetGrantAuthorizations } from "./query.rpc.func.ts"; +export const useGetQueryExchangeParams = buildUseQuery({ + builderQueryFn: createGetQueryExchangeParams, + queryKeyPrefix: "QueryExchangeParamsQuery" +}); +export const useGetSubaccountDeposits = buildUseQuery({ + builderQueryFn: createGetSubaccountDeposits, + queryKeyPrefix: "SubaccountDepositsQuery" +}); +export const useGetSubaccountDeposit = buildUseQuery({ + builderQueryFn: createGetSubaccountDeposit, + queryKeyPrefix: "SubaccountDepositQuery" +}); +export const useGetExchangeBalances = buildUseQuery({ + builderQueryFn: createGetExchangeBalances, + queryKeyPrefix: "ExchangeBalancesQuery" +}); +export const useGetAggregateVolume = buildUseQuery({ + builderQueryFn: createGetAggregateVolume, + queryKeyPrefix: "AggregateVolumeQuery" +}); +export const useGetAggregateVolumes = buildUseQuery({ + builderQueryFn: createGetAggregateVolumes, + queryKeyPrefix: "AggregateVolumesQuery" +}); +export const useGetAggregateMarketVolume = buildUseQuery({ + builderQueryFn: createGetAggregateMarketVolume, + queryKeyPrefix: "AggregateMarketVolumeQuery" +}); +export const useGetAggregateMarketVolumes = buildUseQuery({ + builderQueryFn: createGetAggregateMarketVolumes, + queryKeyPrefix: "AggregateMarketVolumesQuery" +}); +export const useGetDenomDecimal = buildUseQuery({ + builderQueryFn: createGetDenomDecimal, + queryKeyPrefix: "DenomDecimalQuery" +}); +export const useGetDenomDecimals = buildUseQuery({ + builderQueryFn: createGetDenomDecimals, + queryKeyPrefix: "DenomDecimalsQuery" +}); +export const useGetSpotMarkets = buildUseQuery({ + builderQueryFn: createGetSpotMarkets, + queryKeyPrefix: "SpotMarketsQuery" +}); +export const useGetSpotMarket = buildUseQuery({ + builderQueryFn: createGetSpotMarket, + queryKeyPrefix: "SpotMarketQuery" +}); +export const useGetFullSpotMarkets = buildUseQuery({ + builderQueryFn: createGetFullSpotMarkets, + queryKeyPrefix: "FullSpotMarketsQuery" +}); +export const useGetFullSpotMarket = buildUseQuery({ + builderQueryFn: createGetFullSpotMarket, + queryKeyPrefix: "FullSpotMarketQuery" +}); +export const useGetSpotOrderbook = buildUseQuery({ + builderQueryFn: createGetSpotOrderbook, + queryKeyPrefix: "SpotOrderbookQuery" +}); +export const useGetTraderSpotOrders = buildUseQuery({ + builderQueryFn: createGetTraderSpotOrders, + queryKeyPrefix: "TraderSpotOrdersQuery" +}); +export const useGetAccountAddressSpotOrders = buildUseQuery({ + builderQueryFn: createGetAccountAddressSpotOrders, + queryKeyPrefix: "AccountAddressSpotOrdersQuery" +}); +export const useGetSpotOrdersByHashes = buildUseQuery({ + builderQueryFn: createGetSpotOrdersByHashes, + queryKeyPrefix: "SpotOrdersByHashesQuery" +}); +export const useGetSubaccountOrders = buildUseQuery({ + builderQueryFn: createGetSubaccountOrders, + queryKeyPrefix: "SubaccountOrdersQuery" +}); +export const useGetTraderSpotTransientOrders = buildUseQuery({ + builderQueryFn: createGetTraderSpotTransientOrders, + queryKeyPrefix: "TraderSpotTransientOrdersQuery" +}); +export const useGetSpotMidPriceAndTOB = buildUseQuery({ + builderQueryFn: createGetSpotMidPriceAndTOB, + queryKeyPrefix: "SpotMidPriceAndTOBQuery" +}); +export const useGetDerivativeMidPriceAndTOB = buildUseQuery({ + builderQueryFn: createGetDerivativeMidPriceAndTOB, + queryKeyPrefix: "DerivativeMidPriceAndTOBQuery" +}); +export const useGetDerivativeOrderbook = buildUseQuery({ + builderQueryFn: createGetDerivativeOrderbook, + queryKeyPrefix: "DerivativeOrderbookQuery" +}); +export const useGetTraderDerivativeOrders = buildUseQuery({ + builderQueryFn: createGetTraderDerivativeOrders, + queryKeyPrefix: "TraderDerivativeOrdersQuery" +}); +export const useGetAccountAddressDerivativeOrders = buildUseQuery({ + builderQueryFn: createGetAccountAddressDerivativeOrders, + queryKeyPrefix: "AccountAddressDerivativeOrdersQuery" +}); +export const useGetDerivativeOrdersByHashes = buildUseQuery({ + builderQueryFn: createGetDerivativeOrdersByHashes, + queryKeyPrefix: "DerivativeOrdersByHashesQuery" +}); +export const useGetTraderDerivativeTransientOrders = buildUseQuery({ + builderQueryFn: createGetTraderDerivativeTransientOrders, + queryKeyPrefix: "TraderDerivativeTransientOrdersQuery" +}); +export const useGetDerivativeMarkets = buildUseQuery({ + builderQueryFn: createGetDerivativeMarkets, + queryKeyPrefix: "DerivativeMarketsQuery" +}); +export const useGetDerivativeMarket = buildUseQuery({ + builderQueryFn: createGetDerivativeMarket, + queryKeyPrefix: "DerivativeMarketQuery" +}); +export const useGetDerivativeMarketAddress = buildUseQuery({ + builderQueryFn: createGetDerivativeMarketAddress, + queryKeyPrefix: "DerivativeMarketAddressQuery" +}); +export const useGetSubaccountTradeNonce = buildUseQuery({ + builderQueryFn: createGetSubaccountTradeNonce, + queryKeyPrefix: "SubaccountTradeNonceQuery" +}); +export const useGetExchangeModuleState = buildUseQuery({ + builderQueryFn: createGetExchangeModuleState, + queryKeyPrefix: "ExchangeModuleStateQuery" +}); +export const useGetPositions = buildUseQuery({ + builderQueryFn: createGetPositions, + queryKeyPrefix: "PositionsQuery" +}); +export const useGetSubaccountPositions = buildUseQuery({ + builderQueryFn: createGetSubaccountPositions, + queryKeyPrefix: "SubaccountPositionsQuery" +}); +export const useGetSubaccountPositionInMarket = buildUseQuery({ + builderQueryFn: createGetSubaccountPositionInMarket, + queryKeyPrefix: "SubaccountPositionInMarketQuery" +}); +export const useGetSubaccountEffectivePositionInMarket = buildUseQuery({ + builderQueryFn: createGetSubaccountEffectivePositionInMarket, + queryKeyPrefix: "SubaccountEffectivePositionInMarketQuery" +}); +export const useGetPerpetualMarketInfo = buildUseQuery({ + builderQueryFn: createGetPerpetualMarketInfo, + queryKeyPrefix: "PerpetualMarketInfoQuery" +}); +export const useGetExpiryFuturesMarketInfo = buildUseQuery({ + builderQueryFn: createGetExpiryFuturesMarketInfo, + queryKeyPrefix: "ExpiryFuturesMarketInfoQuery" +}); +export const useGetPerpetualMarketFunding = buildUseQuery({ + builderQueryFn: createGetPerpetualMarketFunding, + queryKeyPrefix: "PerpetualMarketFundingQuery" +}); +export const useGetSubaccountOrderMetadata = buildUseQuery({ + builderQueryFn: createGetSubaccountOrderMetadata, + queryKeyPrefix: "SubaccountOrderMetadataQuery" +}); +export const useGetTradeRewardPoints = buildUseQuery({ + builderQueryFn: createGetTradeRewardPoints, + queryKeyPrefix: "TradeRewardPointsQuery" +}); +export const useGetPendingTradeRewardPoints = buildUseQuery({ + builderQueryFn: createGetPendingTradeRewardPoints, + queryKeyPrefix: "PendingTradeRewardPointsQuery" +}); +export const useGetTradeRewardCampaign = buildUseQuery({ + builderQueryFn: createGetTradeRewardCampaign, + queryKeyPrefix: "TradeRewardCampaignQuery" +}); +export const useGetFeeDiscountAccountInfo = buildUseQuery({ + builderQueryFn: createGetFeeDiscountAccountInfo, + queryKeyPrefix: "FeeDiscountAccountInfoQuery" +}); +export const useGetFeeDiscountSchedule = buildUseQuery({ + builderQueryFn: createGetFeeDiscountSchedule, + queryKeyPrefix: "FeeDiscountScheduleQuery" +}); +export const useGetBalanceMismatches = buildUseQuery({ + builderQueryFn: createGetBalanceMismatches, + queryKeyPrefix: "BalanceMismatchesQuery" +}); +export const useGetBalanceWithBalanceHolds = buildUseQuery({ + builderQueryFn: createGetBalanceWithBalanceHolds, + queryKeyPrefix: "BalanceWithBalanceHoldsQuery" +}); +export const useGetFeeDiscountTierStatistics = buildUseQuery({ + builderQueryFn: createGetFeeDiscountTierStatistics, + queryKeyPrefix: "FeeDiscountTierStatisticsQuery" +}); +export const useGetMitoVaultInfos = buildUseQuery({ + builderQueryFn: createGetMitoVaultInfos, + queryKeyPrefix: "MitoVaultInfosQuery" +}); +export const useGetQueryMarketIDFromVault = buildUseQuery({ + builderQueryFn: createGetQueryMarketIDFromVault, + queryKeyPrefix: "QueryMarketIDFromVaultQuery" +}); +export const useGetHistoricalTradeRecords = buildUseQuery({ + builderQueryFn: createGetHistoricalTradeRecords, + queryKeyPrefix: "HistoricalTradeRecordsQuery" +}); +export const useGetIsOptedOutOfRewards = buildUseQuery({ + builderQueryFn: createGetIsOptedOutOfRewards, + queryKeyPrefix: "IsOptedOutOfRewardsQuery" +}); +export const useGetOptedOutOfRewardsAccounts = buildUseQuery({ + builderQueryFn: createGetOptedOutOfRewardsAccounts, + queryKeyPrefix: "OptedOutOfRewardsAccountsQuery" +}); +export const useGetMarketVolatility = buildUseQuery({ + builderQueryFn: createGetMarketVolatility, + queryKeyPrefix: "MarketVolatilityQuery" +}); +export const useGetBinaryOptionsMarkets = buildUseQuery({ + builderQueryFn: createGetBinaryOptionsMarkets, + queryKeyPrefix: "BinaryOptionsMarketsQuery" +}); +export const useGetTraderDerivativeConditionalOrders = buildUseQuery({ + builderQueryFn: createGetTraderDerivativeConditionalOrders, + queryKeyPrefix: "TraderDerivativeConditionalOrdersQuery" +}); +export const useGetMarketAtomicExecutionFeeMultiplier = buildUseQuery({ + builderQueryFn: createGetMarketAtomicExecutionFeeMultiplier, + queryKeyPrefix: "MarketAtomicExecutionFeeMultiplierQuery" +}); +export const useGetActiveStakeGrant = buildUseQuery({ + builderQueryFn: createGetActiveStakeGrant, + queryKeyPrefix: "ActiveStakeGrantQuery" +}); +export const useGetGrantAuthorization = buildUseQuery({ + builderQueryFn: createGetGrantAuthorization, + queryKeyPrefix: "GrantAuthorizationQuery" +}); +export const useGetGrantAuthorizations = buildUseQuery({ + builderQueryFn: createGetGrantAuthorizations, + queryKeyPrefix: "GrantAuthorizationsQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.func.ts index b8b7b4be..679cfedb 100644 --- a/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx converters: toConverters(MsgDeposit), deps: [MsgDeposit] }); -export const useDeposit = buildUseMutation({ - builderMutationFn: createDeposit -}); export const createWithdraw = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdraw.typeUrl, @@ -19,9 +15,6 @@ export const createWithdraw = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgWithdraw), deps: [MsgWithdraw] }); -export const useWithdraw = buildUseMutation({ - builderMutationFn: createWithdraw -}); export const createInstantSpotMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantSpotMarketLaunch.typeUrl, @@ -29,9 +22,6 @@ export const createInstantSpotMarketLaunch = (clientResolver?: SigningClientReso converters: toConverters(MsgInstantSpotMarketLaunch), deps: [MsgInstantSpotMarketLaunch] }); -export const useInstantSpotMarketLaunch = buildUseMutation({ - builderMutationFn: createInstantSpotMarketLaunch -}); export const createInstantPerpetualMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantPerpetualMarketLaunch.typeUrl, @@ -39,9 +29,6 @@ export const createInstantPerpetualMarketLaunch = (clientResolver?: SigningClien converters: toConverters(MsgInstantPerpetualMarketLaunch), deps: [MsgInstantPerpetualMarketLaunch] }); -export const useInstantPerpetualMarketLaunch = buildUseMutation({ - builderMutationFn: createInstantPerpetualMarketLaunch -}); export const createInstantExpiryFuturesMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantExpiryFuturesMarketLaunch.typeUrl, @@ -49,9 +36,6 @@ export const createInstantExpiryFuturesMarketLaunch = (clientResolver?: SigningC converters: toConverters(MsgInstantExpiryFuturesMarketLaunch), deps: [MsgInstantExpiryFuturesMarketLaunch] }); -export const useInstantExpiryFuturesMarketLaunch = buildUseMutation({ - builderMutationFn: createInstantExpiryFuturesMarketLaunch -}); export const createCreateSpotLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateSpotLimitOrder.typeUrl, @@ -59,9 +43,6 @@ export const createCreateSpotLimitOrder = (clientResolver?: SigningClientResolve converters: toConverters(MsgCreateSpotLimitOrder), deps: [MsgCreateSpotLimitOrder] }); -export const useCreateSpotLimitOrder = buildUseMutation({ - builderMutationFn: createCreateSpotLimitOrder -}); export const createBatchCreateSpotLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBatchCreateSpotLimitOrders.typeUrl, @@ -69,9 +50,6 @@ export const createBatchCreateSpotLimitOrders = (clientResolver?: SigningClientR converters: toConverters(MsgBatchCreateSpotLimitOrders), deps: [MsgBatchCreateSpotLimitOrders] }); -export const useBatchCreateSpotLimitOrders = buildUseMutation({ - builderMutationFn: createBatchCreateSpotLimitOrders -}); export const createCreateSpotMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateSpotMarketOrder.typeUrl, @@ -79,9 +57,6 @@ export const createCreateSpotMarketOrder = (clientResolver?: SigningClientResolv converters: toConverters(MsgCreateSpotMarketOrder), deps: [MsgCreateSpotMarketOrder] }); -export const useCreateSpotMarketOrder = buildUseMutation({ - builderMutationFn: createCreateSpotMarketOrder -}); export const createCancelSpotOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelSpotOrder.typeUrl, @@ -89,9 +64,6 @@ export const createCancelSpotOrder = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgCancelSpotOrder), deps: [MsgCancelSpotOrder] }); -export const useCancelSpotOrder = buildUseMutation({ - builderMutationFn: createCancelSpotOrder -}); export const createBatchCancelSpotOrders = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBatchCancelSpotOrders.typeUrl, @@ -99,9 +71,6 @@ export const createBatchCancelSpotOrders = (clientResolver?: SigningClientResolv converters: toConverters(MsgBatchCancelSpotOrders), deps: [MsgBatchCancelSpotOrders] }); -export const useBatchCancelSpotOrders = buildUseMutation({ - builderMutationFn: createBatchCancelSpotOrders -}); export const createBatchUpdateOrders = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBatchUpdateOrders.typeUrl, @@ -109,9 +78,6 @@ export const createBatchUpdateOrders = (clientResolver?: SigningClientResolver) converters: toConverters(MsgBatchUpdateOrders), deps: [MsgBatchUpdateOrders] }); -export const useBatchUpdateOrders = buildUseMutation({ - builderMutationFn: createBatchUpdateOrders -}); export const createPrivilegedExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgPrivilegedExecuteContract.typeUrl, @@ -119,9 +85,6 @@ export const createPrivilegedExecuteContract = (clientResolver?: SigningClientRe converters: toConverters(MsgPrivilegedExecuteContract), deps: [MsgPrivilegedExecuteContract] }); -export const usePrivilegedExecuteContract = buildUseMutation({ - builderMutationFn: createPrivilegedExecuteContract -}); export const createCreateDerivativeLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateDerivativeLimitOrder.typeUrl, @@ -129,9 +92,6 @@ export const createCreateDerivativeLimitOrder = (clientResolver?: SigningClientR converters: toConverters(MsgCreateDerivativeLimitOrder), deps: [MsgCreateDerivativeLimitOrder] }); -export const useCreateDerivativeLimitOrder = buildUseMutation({ - builderMutationFn: createCreateDerivativeLimitOrder -}); export const createBatchCreateDerivativeLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBatchCreateDerivativeLimitOrders.typeUrl, @@ -139,9 +99,6 @@ export const createBatchCreateDerivativeLimitOrders = (clientResolver?: SigningC converters: toConverters(MsgBatchCreateDerivativeLimitOrders), deps: [MsgBatchCreateDerivativeLimitOrders] }); -export const useBatchCreateDerivativeLimitOrders = buildUseMutation({ - builderMutationFn: createBatchCreateDerivativeLimitOrders -}); export const createCreateDerivativeMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateDerivativeMarketOrder.typeUrl, @@ -149,9 +106,6 @@ export const createCreateDerivativeMarketOrder = (clientResolver?: SigningClient converters: toConverters(MsgCreateDerivativeMarketOrder), deps: [MsgCreateDerivativeMarketOrder] }); -export const useCreateDerivativeMarketOrder = buildUseMutation({ - builderMutationFn: createCreateDerivativeMarketOrder -}); export const createCancelDerivativeOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelDerivativeOrder.typeUrl, @@ -159,9 +113,6 @@ export const createCancelDerivativeOrder = (clientResolver?: SigningClientResolv converters: toConverters(MsgCancelDerivativeOrder), deps: [MsgCancelDerivativeOrder] }); -export const useCancelDerivativeOrder = buildUseMutation({ - builderMutationFn: createCancelDerivativeOrder -}); export const createBatchCancelDerivativeOrders = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBatchCancelDerivativeOrders.typeUrl, @@ -169,9 +120,6 @@ export const createBatchCancelDerivativeOrders = (clientResolver?: SigningClient converters: toConverters(MsgBatchCancelDerivativeOrders), deps: [MsgBatchCancelDerivativeOrders] }); -export const useBatchCancelDerivativeOrders = buildUseMutation({ - builderMutationFn: createBatchCancelDerivativeOrders -}); export const createInstantBinaryOptionsMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantBinaryOptionsMarketLaunch.typeUrl, @@ -179,9 +127,6 @@ export const createInstantBinaryOptionsMarketLaunch = (clientResolver?: SigningC converters: toConverters(MsgInstantBinaryOptionsMarketLaunch), deps: [MsgInstantBinaryOptionsMarketLaunch] }); -export const useInstantBinaryOptionsMarketLaunch = buildUseMutation({ - builderMutationFn: createInstantBinaryOptionsMarketLaunch -}); export const createCreateBinaryOptionsLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateBinaryOptionsLimitOrder.typeUrl, @@ -189,9 +134,6 @@ export const createCreateBinaryOptionsLimitOrder = (clientResolver?: SigningClie converters: toConverters(MsgCreateBinaryOptionsLimitOrder), deps: [MsgCreateBinaryOptionsLimitOrder] }); -export const useCreateBinaryOptionsLimitOrder = buildUseMutation({ - builderMutationFn: createCreateBinaryOptionsLimitOrder -}); export const createCreateBinaryOptionsMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateBinaryOptionsMarketOrder.typeUrl, @@ -199,9 +141,6 @@ export const createCreateBinaryOptionsMarketOrder = (clientResolver?: SigningCli converters: toConverters(MsgCreateBinaryOptionsMarketOrder), deps: [MsgCreateBinaryOptionsMarketOrder] }); -export const useCreateBinaryOptionsMarketOrder = buildUseMutation({ - builderMutationFn: createCreateBinaryOptionsMarketOrder -}); export const createCancelBinaryOptionsOrder = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelBinaryOptionsOrder.typeUrl, @@ -209,9 +148,6 @@ export const createCancelBinaryOptionsOrder = (clientResolver?: SigningClientRes converters: toConverters(MsgCancelBinaryOptionsOrder), deps: [MsgCancelBinaryOptionsOrder] }); -export const useCancelBinaryOptionsOrder = buildUseMutation({ - builderMutationFn: createCancelBinaryOptionsOrder -}); export const createBatchCancelBinaryOptionsOrders = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBatchCancelBinaryOptionsOrders.typeUrl, @@ -219,9 +155,6 @@ export const createBatchCancelBinaryOptionsOrders = (clientResolver?: SigningCli converters: toConverters(MsgBatchCancelBinaryOptionsOrders), deps: [MsgBatchCancelBinaryOptionsOrders] }); -export const useBatchCancelBinaryOptionsOrders = buildUseMutation({ - builderMutationFn: createBatchCancelBinaryOptionsOrders -}); export const createSubaccountTransfer = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSubaccountTransfer.typeUrl, @@ -229,9 +162,6 @@ export const createSubaccountTransfer = (clientResolver?: SigningClientResolver) converters: toConverters(MsgSubaccountTransfer), deps: [MsgSubaccountTransfer] }); -export const useSubaccountTransfer = buildUseMutation({ - builderMutationFn: createSubaccountTransfer -}); export const createExternalTransfer = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExternalTransfer.typeUrl, @@ -239,9 +169,6 @@ export const createExternalTransfer = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgExternalTransfer), deps: [MsgExternalTransfer] }); -export const useExternalTransfer = buildUseMutation({ - builderMutationFn: createExternalTransfer -}); export const createLiquidatePosition = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgLiquidatePosition.typeUrl, @@ -249,9 +176,6 @@ export const createLiquidatePosition = (clientResolver?: SigningClientResolver) converters: toConverters(MsgLiquidatePosition), deps: [MsgLiquidatePosition] }); -export const useLiquidatePosition = buildUseMutation({ - builderMutationFn: createLiquidatePosition -}); export const createEmergencySettleMarket = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgEmergencySettleMarket.typeUrl, @@ -259,9 +183,6 @@ export const createEmergencySettleMarket = (clientResolver?: SigningClientResolv converters: toConverters(MsgEmergencySettleMarket), deps: [MsgEmergencySettleMarket] }); -export const useEmergencySettleMarket = buildUseMutation({ - builderMutationFn: createEmergencySettleMarket -}); export const createIncreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgIncreasePositionMargin.typeUrl, @@ -269,9 +190,6 @@ export const createIncreasePositionMargin = (clientResolver?: SigningClientResol converters: toConverters(MsgIncreasePositionMargin), deps: [MsgIncreasePositionMargin] }); -export const useIncreasePositionMargin = buildUseMutation({ - builderMutationFn: createIncreasePositionMargin -}); export const createDecreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDecreasePositionMargin.typeUrl, @@ -279,9 +197,6 @@ export const createDecreasePositionMargin = (clientResolver?: SigningClientResol converters: toConverters(MsgDecreasePositionMargin), deps: [MsgDecreasePositionMargin] }); -export const useDecreasePositionMargin = buildUseMutation({ - builderMutationFn: createDecreasePositionMargin -}); export const createRewardsOptOut = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRewardsOptOut.typeUrl, @@ -289,9 +204,6 @@ export const createRewardsOptOut = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgRewardsOptOut), deps: [MsgRewardsOptOut] }); -export const useRewardsOptOut = buildUseMutation({ - builderMutationFn: createRewardsOptOut -}); export const createAdminUpdateBinaryOptionsMarket = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgAdminUpdateBinaryOptionsMarket.typeUrl, @@ -299,9 +211,6 @@ export const createAdminUpdateBinaryOptionsMarket = (clientResolver?: SigningCli converters: toConverters(MsgAdminUpdateBinaryOptionsMarket), deps: [MsgAdminUpdateBinaryOptionsMarket] }); -export const useAdminUpdateBinaryOptionsMarket = buildUseMutation({ - builderMutationFn: createAdminUpdateBinaryOptionsMarket -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -309,9 +218,6 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createUpdateSpotMarket = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateSpotMarket.typeUrl, @@ -319,9 +225,6 @@ export const createUpdateSpotMarket = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgUpdateSpotMarket), deps: [MsgUpdateSpotMarket] }); -export const useUpdateSpotMarket = buildUseMutation({ - builderMutationFn: createUpdateSpotMarket -}); export const createUpdateDerivativeMarket = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateDerivativeMarket.typeUrl, @@ -329,9 +232,6 @@ export const createUpdateDerivativeMarket = (clientResolver?: SigningClientResol converters: toConverters(MsgUpdateDerivativeMarket), deps: [MsgUpdateDerivativeMarket] }); -export const useUpdateDerivativeMarket = buildUseMutation({ - builderMutationFn: createUpdateDerivativeMarket -}); export const createAuthorizeStakeGrants = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgAuthorizeStakeGrants.typeUrl, @@ -339,16 +239,10 @@ export const createAuthorizeStakeGrants = (clientResolver?: SigningClientResolve converters: toConverters(MsgAuthorizeStakeGrants), deps: [MsgAuthorizeStakeGrants] }); -export const useAuthorizeStakeGrants = buildUseMutation({ - builderMutationFn: createAuthorizeStakeGrants -}); export const createActivateStakeGrant = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgActivateStakeGrant.typeUrl, encoders: toEncoders(MsgActivateStakeGrant), converters: toConverters(MsgActivateStakeGrant), deps: [MsgActivateStakeGrant] -}); -export const useActivateStakeGrant = buildUseMutation({ - builderMutationFn: createActivateStakeGrant }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..c67ac7bc --- /dev/null +++ b/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts @@ -0,0 +1,108 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; +import { createDeposit, createWithdraw, createInstantSpotMarketLaunch, createInstantPerpetualMarketLaunch, createInstantExpiryFuturesMarketLaunch, createCreateSpotLimitOrder, createBatchCreateSpotLimitOrders, createCreateSpotMarketOrder, createCancelSpotOrder, createBatchCancelSpotOrders, createBatchUpdateOrders, createPrivilegedExecuteContract, createCreateDerivativeLimitOrder, createBatchCreateDerivativeLimitOrders, createCreateDerivativeMarketOrder, createCancelDerivativeOrder, createBatchCancelDerivativeOrders, createInstantBinaryOptionsMarketLaunch, createCreateBinaryOptionsLimitOrder, createCreateBinaryOptionsMarketOrder, createCancelBinaryOptionsOrder, createBatchCancelBinaryOptionsOrders, createSubaccountTransfer, createExternalTransfer, createLiquidatePosition, createEmergencySettleMarket, createIncreasePositionMargin, createDecreasePositionMargin, createRewardsOptOut, createAdminUpdateBinaryOptionsMarket, createUpdateParams, createUpdateSpotMarket, createUpdateDerivativeMarket, createAuthorizeStakeGrants, createActivateStakeGrant } from "./tx.rpc.func.ts"; +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); +export const useWithdraw = buildUseMutation({ + builderMutationFn: createWithdraw +}); +export const useInstantSpotMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantSpotMarketLaunch +}); +export const useInstantPerpetualMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantPerpetualMarketLaunch +}); +export const useInstantExpiryFuturesMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantExpiryFuturesMarketLaunch +}); +export const useCreateSpotLimitOrder = buildUseMutation({ + builderMutationFn: createCreateSpotLimitOrder +}); +export const useBatchCreateSpotLimitOrders = buildUseMutation({ + builderMutationFn: createBatchCreateSpotLimitOrders +}); +export const useCreateSpotMarketOrder = buildUseMutation({ + builderMutationFn: createCreateSpotMarketOrder +}); +export const useCancelSpotOrder = buildUseMutation({ + builderMutationFn: createCancelSpotOrder +}); +export const useBatchCancelSpotOrders = buildUseMutation({ + builderMutationFn: createBatchCancelSpotOrders +}); +export const useBatchUpdateOrders = buildUseMutation({ + builderMutationFn: createBatchUpdateOrders +}); +export const usePrivilegedExecuteContract = buildUseMutation({ + builderMutationFn: createPrivilegedExecuteContract +}); +export const useCreateDerivativeLimitOrder = buildUseMutation({ + builderMutationFn: createCreateDerivativeLimitOrder +}); +export const useBatchCreateDerivativeLimitOrders = buildUseMutation({ + builderMutationFn: createBatchCreateDerivativeLimitOrders +}); +export const useCreateDerivativeMarketOrder = buildUseMutation({ + builderMutationFn: createCreateDerivativeMarketOrder +}); +export const useCancelDerivativeOrder = buildUseMutation({ + builderMutationFn: createCancelDerivativeOrder +}); +export const useBatchCancelDerivativeOrders = buildUseMutation({ + builderMutationFn: createBatchCancelDerivativeOrders +}); +export const useInstantBinaryOptionsMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantBinaryOptionsMarketLaunch +}); +export const useCreateBinaryOptionsLimitOrder = buildUseMutation({ + builderMutationFn: createCreateBinaryOptionsLimitOrder +}); +export const useCreateBinaryOptionsMarketOrder = buildUseMutation({ + builderMutationFn: createCreateBinaryOptionsMarketOrder +}); +export const useCancelBinaryOptionsOrder = buildUseMutation({ + builderMutationFn: createCancelBinaryOptionsOrder +}); +export const useBatchCancelBinaryOptionsOrders = buildUseMutation({ + builderMutationFn: createBatchCancelBinaryOptionsOrders +}); +export const useSubaccountTransfer = buildUseMutation({ + builderMutationFn: createSubaccountTransfer +}); +export const useExternalTransfer = buildUseMutation({ + builderMutationFn: createExternalTransfer +}); +export const useLiquidatePosition = buildUseMutation({ + builderMutationFn: createLiquidatePosition +}); +export const useEmergencySettleMarket = buildUseMutation({ + builderMutationFn: createEmergencySettleMarket +}); +export const useIncreasePositionMargin = buildUseMutation({ + builderMutationFn: createIncreasePositionMargin +}); +export const useDecreasePositionMargin = buildUseMutation({ + builderMutationFn: createDecreasePositionMargin +}); +export const useRewardsOptOut = buildUseMutation({ + builderMutationFn: createRewardsOptOut +}); +export const useAdminUpdateBinaryOptionsMarket = buildUseMutation({ + builderMutationFn: createAdminUpdateBinaryOptionsMarket +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useUpdateSpotMarket = buildUseMutation({ + builderMutationFn: createUpdateSpotMarket +}); +export const useUpdateDerivativeMarket = buildUseMutation({ + builderMutationFn: createUpdateDerivativeMarket +}); +export const useAuthorizeStakeGrants = buildUseMutation({ + builderMutationFn: createAuthorizeStakeGrants +}); +export const useActivateStakeGrant = buildUseMutation({ + builderMutationFn: createActivateStakeGrant +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.func.ts b/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.func.ts index f17f2e46..73e9563a 100644 --- a/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; export const createGetInsuranceParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryInsuranceParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetInsuranceParams = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryInsuranceParamsRequest, QueryInsuranceParamsResponse] }); -export const useGetInsuranceParams = buildUseQuery({ - builderQueryFn: createGetInsuranceParams, - queryKeyPrefix: "InsuranceParamsQuery" -}); export const createGetInsuranceFund = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryInsuranceFundRequest.encode, decode: QueryInsuranceFundResponse.decode, @@ -21,10 +16,6 @@ export const createGetInsuranceFund = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryInsuranceFundRequest, QueryInsuranceFundResponse] }); -export const useGetInsuranceFund = buildUseQuery({ - builderQueryFn: createGetInsuranceFund, - queryKeyPrefix: "InsuranceFundQuery" -}); export const createGetInsuranceFunds = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryInsuranceFundsRequest.encode, decode: QueryInsuranceFundsResponse.decode, @@ -33,10 +24,6 @@ export const createGetInsuranceFunds = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryInsuranceFundsRequest, QueryInsuranceFundsResponse] }); -export const useGetInsuranceFunds = buildUseQuery({ - builderQueryFn: createGetInsuranceFunds, - queryKeyPrefix: "InsuranceFundsQuery" -}); export const createGetEstimatedRedemptions = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryEstimatedRedemptionsRequest.encode, decode: QueryEstimatedRedemptionsResponse.decode, @@ -45,10 +32,6 @@ export const createGetEstimatedRedemptions = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse] }); -export const useGetEstimatedRedemptions = buildUseQuery({ - builderQueryFn: createGetEstimatedRedemptions, - queryKeyPrefix: "EstimatedRedemptionsQuery" -}); export const createGetPendingRedemptions = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPendingRedemptionsRequest.encode, decode: QueryPendingRedemptionsResponse.decode, @@ -57,10 +40,6 @@ export const createGetPendingRedemptions = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse] }); -export const useGetPendingRedemptions = buildUseQuery({ - builderQueryFn: createGetPendingRedemptions, - queryKeyPrefix: "PendingRedemptionsQuery" -}); export const createGetInsuranceModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -68,8 +47,4 @@ export const createGetInsuranceModuleState = (clientResolver?: RpcResolver) => b method: "InsuranceModuleState", clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] -}); -export const useGetInsuranceModuleState = buildUseQuery({ - builderQueryFn: createGetInsuranceModuleState, - queryKeyPrefix: "InsuranceModuleStateQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..b1d18115 --- /dev/null +++ b/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts @@ -0,0 +1,27 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetInsuranceParams, createGetInsuranceFund, createGetInsuranceFunds, createGetEstimatedRedemptions, createGetPendingRedemptions, createGetInsuranceModuleState } from "./query.rpc.func.ts"; +export const useGetInsuranceParams = buildUseQuery({ + builderQueryFn: createGetInsuranceParams, + queryKeyPrefix: "InsuranceParamsQuery" +}); +export const useGetInsuranceFund = buildUseQuery({ + builderQueryFn: createGetInsuranceFund, + queryKeyPrefix: "InsuranceFundQuery" +}); +export const useGetInsuranceFunds = buildUseQuery({ + builderQueryFn: createGetInsuranceFunds, + queryKeyPrefix: "InsuranceFundsQuery" +}); +export const useGetEstimatedRedemptions = buildUseQuery({ + builderQueryFn: createGetEstimatedRedemptions, + queryKeyPrefix: "EstimatedRedemptionsQuery" +}); +export const useGetPendingRedemptions = buildUseQuery({ + builderQueryFn: createGetPendingRedemptions, + queryKeyPrefix: "PendingRedemptionsQuery" +}); +export const useGetInsuranceModuleState = buildUseQuery({ + builderQueryFn: createGetInsuranceModuleState, + queryKeyPrefix: "InsuranceModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.func.ts index 506cf94a..3af0a977 100644 --- a/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; export const createCreateInsuranceFund = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateInsuranceFund = (clientResolver?: SigningClientResolver converters: toConverters(MsgCreateInsuranceFund), deps: [MsgCreateInsuranceFund] }); -export const useCreateInsuranceFund = buildUseMutation({ - builderMutationFn: createCreateInsuranceFund -}); export const createUnderwrite = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUnderwrite.typeUrl, @@ -19,9 +15,6 @@ export const createUnderwrite = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgUnderwrite), deps: [MsgUnderwrite] }); -export const useUnderwrite = buildUseMutation({ - builderMutationFn: createUnderwrite -}); export const createRequestRedemption = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRequestRedemption.typeUrl, @@ -29,16 +22,10 @@ export const createRequestRedemption = (clientResolver?: SigningClientResolver) converters: toConverters(MsgRequestRedemption), deps: [MsgRequestRedemption] }); -export const useRequestRedemption = buildUseMutation({ - builderMutationFn: createRequestRedemption -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..9b6254c5 --- /dev/null +++ b/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; +import { createCreateInsuranceFund, createUnderwrite, createRequestRedemption, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateInsuranceFund = buildUseMutation({ + builderMutationFn: createCreateInsuranceFund +}); +export const useUnderwrite = buildUseMutation({ + builderMutationFn: createUnderwrite +}); +export const useRequestRedemption = buildUseMutation({ + builderMutationFn: createRequestRedemption +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.func.ts b/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.func.ts index cbad00a5..d084b36c 100644 --- a/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetFeedConfig = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryFeedConfigRequest.encode, decode: QueryFeedConfigResponse.decode, @@ -21,10 +16,6 @@ export const createGetFeedConfig = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QueryFeedConfigRequest, QueryFeedConfigResponse] }); -export const useGetFeedConfig = buildUseQuery({ - builderQueryFn: createGetFeedConfig, - queryKeyPrefix: "FeedConfigQuery" -}); export const createGetFeedConfigInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryFeedConfigInfoRequest.encode, decode: QueryFeedConfigInfoResponse.decode, @@ -33,10 +24,6 @@ export const createGetFeedConfigInfo = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse] }); -export const useGetFeedConfigInfo = buildUseQuery({ - builderQueryFn: createGetFeedConfigInfo, - queryKeyPrefix: "FeedConfigInfoQuery" -}); export const createGetLatestRound = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryLatestRoundRequest.encode, decode: QueryLatestRoundResponse.decode, @@ -45,10 +32,6 @@ export const createGetLatestRound = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryLatestRoundRequest, QueryLatestRoundResponse] }); -export const useGetLatestRound = buildUseQuery({ - builderQueryFn: createGetLatestRound, - queryKeyPrefix: "LatestRoundQuery" -}); export const createGetLatestTransmissionDetails = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryLatestTransmissionDetailsRequest.encode, decode: QueryLatestTransmissionDetailsResponse.decode, @@ -57,10 +40,6 @@ export const createGetLatestTransmissionDetails = (clientResolver?: RpcResolver) clientResolver, deps: [QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse] }); -export const useGetLatestTransmissionDetails = buildUseQuery({ - builderQueryFn: createGetLatestTransmissionDetails, - queryKeyPrefix: "LatestTransmissionDetailsQuery" -}); export const createGetOwedAmount = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOwedAmountRequest.encode, decode: QueryOwedAmountResponse.decode, @@ -69,10 +48,6 @@ export const createGetOwedAmount = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QueryOwedAmountRequest, QueryOwedAmountResponse] }); -export const useGetOwedAmount = buildUseQuery({ - builderQueryFn: createGetOwedAmount, - queryKeyPrefix: "OwedAmountQuery" -}); export const createGetOcrModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -80,8 +55,4 @@ export const createGetOcrModuleState = (clientResolver?: RpcResolver) => buildQu method: "OcrModuleState", clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] -}); -export const useGetOcrModuleState = buildUseQuery({ - builderQueryFn: createGetOcrModuleState, - queryKeyPrefix: "OcrModuleStateQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..b2f49999 --- /dev/null +++ b/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts @@ -0,0 +1,31 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetParams, createGetFeedConfig, createGetFeedConfigInfo, createGetLatestRound, createGetLatestTransmissionDetails, createGetOwedAmount, createGetOcrModuleState } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetFeedConfig = buildUseQuery({ + builderQueryFn: createGetFeedConfig, + queryKeyPrefix: "FeedConfigQuery" +}); +export const useGetFeedConfigInfo = buildUseQuery({ + builderQueryFn: createGetFeedConfigInfo, + queryKeyPrefix: "FeedConfigInfoQuery" +}); +export const useGetLatestRound = buildUseQuery({ + builderQueryFn: createGetLatestRound, + queryKeyPrefix: "LatestRoundQuery" +}); +export const useGetLatestTransmissionDetails = buildUseQuery({ + builderQueryFn: createGetLatestTransmissionDetails, + queryKeyPrefix: "LatestTransmissionDetailsQuery" +}); +export const useGetOwedAmount = buildUseQuery({ + builderQueryFn: createGetOwedAmount, + queryKeyPrefix: "OwedAmountQuery" +}); +export const useGetOcrModuleState = buildUseQuery({ + builderQueryFn: createGetOcrModuleState, + queryKeyPrefix: "OcrModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.func.ts index 233e39a2..534dfab5 100644 --- a/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; export const createCreateFeed = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateFeed = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgCreateFeed), deps: [MsgCreateFeed] }); -export const useCreateFeed = buildUseMutation({ - builderMutationFn: createCreateFeed -}); export const createUpdateFeed = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateFeed.typeUrl, @@ -19,9 +15,6 @@ export const createUpdateFeed = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgUpdateFeed), deps: [MsgUpdateFeed] }); -export const useUpdateFeed = buildUseMutation({ - builderMutationFn: createUpdateFeed -}); export const createTransmit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgTransmit.typeUrl, @@ -29,9 +22,6 @@ export const createTransmit = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgTransmit), deps: [MsgTransmit] }); -export const useTransmit = buildUseMutation({ - builderMutationFn: createTransmit -}); export const createFundFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgFundFeedRewardPool.typeUrl, @@ -39,9 +29,6 @@ export const createFundFeedRewardPool = (clientResolver?: SigningClientResolver) converters: toConverters(MsgFundFeedRewardPool), deps: [MsgFundFeedRewardPool] }); -export const useFundFeedRewardPool = buildUseMutation({ - builderMutationFn: createFundFeedRewardPool -}); export const createWithdrawFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawFeedRewardPool.typeUrl, @@ -49,9 +36,6 @@ export const createWithdrawFeedRewardPool = (clientResolver?: SigningClientResol converters: toConverters(MsgWithdrawFeedRewardPool), deps: [MsgWithdrawFeedRewardPool] }); -export const useWithdrawFeedRewardPool = buildUseMutation({ - builderMutationFn: createWithdrawFeedRewardPool -}); export const createSetPayees = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSetPayees.typeUrl, @@ -59,9 +43,6 @@ export const createSetPayees = (clientResolver?: SigningClientResolver) => build converters: toConverters(MsgSetPayees), deps: [MsgSetPayees] }); -export const useSetPayees = buildUseMutation({ - builderMutationFn: createSetPayees -}); export const createTransferPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgTransferPayeeship.typeUrl, @@ -69,9 +50,6 @@ export const createTransferPayeeship = (clientResolver?: SigningClientResolver) converters: toConverters(MsgTransferPayeeship), deps: [MsgTransferPayeeship] }); -export const useTransferPayeeship = buildUseMutation({ - builderMutationFn: createTransferPayeeship -}); export const createAcceptPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgAcceptPayeeship.typeUrl, @@ -79,16 +57,10 @@ export const createAcceptPayeeship = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgAcceptPayeeship), deps: [MsgAcceptPayeeship] }); -export const useAcceptPayeeship = buildUseMutation({ - builderMutationFn: createAcceptPayeeship -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..05301ba3 --- /dev/null +++ b/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts @@ -0,0 +1,30 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; +import { createCreateFeed, createUpdateFeed, createTransmit, createFundFeedRewardPool, createWithdrawFeedRewardPool, createSetPayees, createTransferPayeeship, createAcceptPayeeship, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateFeed = buildUseMutation({ + builderMutationFn: createCreateFeed +}); +export const useUpdateFeed = buildUseMutation({ + builderMutationFn: createUpdateFeed +}); +export const useTransmit = buildUseMutation({ + builderMutationFn: createTransmit +}); +export const useFundFeedRewardPool = buildUseMutation({ + builderMutationFn: createFundFeedRewardPool +}); +export const useWithdrawFeedRewardPool = buildUseMutation({ + builderMutationFn: createWithdrawFeedRewardPool +}); +export const useSetPayees = buildUseMutation({ + builderMutationFn: createSetPayees +}); +export const useTransferPayeeship = buildUseMutation({ + builderMutationFn: createTransferPayeeship +}); +export const useAcceptPayeeship = buildUseMutation({ + builderMutationFn: createAcceptPayeeship +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.func.ts b/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.func.ts index 6aa4fb2f..b42d914b 100644 --- a/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetBandRelayers = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBandRelayersRequest.encode, decode: QueryBandRelayersResponse.decode, @@ -21,10 +16,6 @@ export const createGetBandRelayers = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryBandRelayersRequest, QueryBandRelayersResponse] }); -export const useGetBandRelayers = buildUseQuery({ - builderQueryFn: createGetBandRelayers, - queryKeyPrefix: "BandRelayersQuery" -}); export const createGetBandPriceStates = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBandPriceStatesRequest.encode, decode: QueryBandPriceStatesResponse.decode, @@ -33,10 +24,6 @@ export const createGetBandPriceStates = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryBandPriceStatesRequest, QueryBandPriceStatesResponse] }); -export const useGetBandPriceStates = buildUseQuery({ - builderQueryFn: createGetBandPriceStates, - queryKeyPrefix: "BandPriceStatesQuery" -}); export const createGetBandIBCPriceStates = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBandIBCPriceStatesRequest.encode, decode: QueryBandIBCPriceStatesResponse.decode, @@ -45,10 +32,6 @@ export const createGetBandIBCPriceStates = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse] }); -export const useGetBandIBCPriceStates = buildUseQuery({ - builderQueryFn: createGetBandIBCPriceStates, - queryKeyPrefix: "BandIBCPriceStatesQuery" -}); export const createGetPriceFeedPriceStates = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPriceFeedPriceStatesRequest.encode, decode: QueryPriceFeedPriceStatesResponse.decode, @@ -57,10 +40,6 @@ export const createGetPriceFeedPriceStates = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse] }); -export const useGetPriceFeedPriceStates = buildUseQuery({ - builderQueryFn: createGetPriceFeedPriceStates, - queryKeyPrefix: "PriceFeedPriceStatesQuery" -}); export const createGetCoinbasePriceStates = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCoinbasePriceStatesRequest.encode, decode: QueryCoinbasePriceStatesResponse.decode, @@ -69,10 +48,6 @@ export const createGetCoinbasePriceStates = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse] }); -export const useGetCoinbasePriceStates = buildUseQuery({ - builderQueryFn: createGetCoinbasePriceStates, - queryKeyPrefix: "CoinbasePriceStatesQuery" -}); export const createGetPythPriceStates = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPythPriceStatesRequest.encode, decode: QueryPythPriceStatesResponse.decode, @@ -81,10 +56,6 @@ export const createGetPythPriceStates = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryPythPriceStatesRequest, QueryPythPriceStatesResponse] }); -export const useGetPythPriceStates = buildUseQuery({ - builderQueryFn: createGetPythPriceStates, - queryKeyPrefix: "PythPriceStatesQuery" -}); export const createGetStorkPriceStates = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryStorkPriceStatesRequest.encode, decode: QueryStorkPriceStatesResponse.decode, @@ -93,10 +64,6 @@ export const createGetStorkPriceStates = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse] }); -export const useGetStorkPriceStates = buildUseQuery({ - builderQueryFn: createGetStorkPriceStates, - queryKeyPrefix: "StorkPriceStatesQuery" -}); export const createGetStorkPublishers = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryStorkPublishersRequest.encode, decode: QueryStorkPublishersResponse.decode, @@ -105,10 +72,6 @@ export const createGetStorkPublishers = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryStorkPublishersRequest, QueryStorkPublishersResponse] }); -export const useGetStorkPublishers = buildUseQuery({ - builderQueryFn: createGetStorkPublishers, - queryKeyPrefix: "StorkPublishersQuery" -}); export const createGetProviderPriceState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProviderPriceStateRequest.encode, decode: QueryProviderPriceStateResponse.decode, @@ -117,10 +80,6 @@ export const createGetProviderPriceState = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryProviderPriceStateRequest, QueryProviderPriceStateResponse] }); -export const useGetProviderPriceState = buildUseQuery({ - builderQueryFn: createGetProviderPriceState, - queryKeyPrefix: "ProviderPriceStateQuery" -}); export const createGetOracleModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -129,10 +88,6 @@ export const createGetOracleModuleState = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] }); -export const useGetOracleModuleState = buildUseQuery({ - builderQueryFn: createGetOracleModuleState, - queryKeyPrefix: "OracleModuleStateQuery" -}); export const createGetHistoricalPriceRecords = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryHistoricalPriceRecordsRequest.encode, decode: QueryHistoricalPriceRecordsResponse.decode, @@ -141,10 +96,6 @@ export const createGetHistoricalPriceRecords = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse] }); -export const useGetHistoricalPriceRecords = buildUseQuery({ - builderQueryFn: createGetHistoricalPriceRecords, - queryKeyPrefix: "HistoricalPriceRecordsQuery" -}); export const createGetOracleVolatility = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOracleVolatilityRequest.encode, decode: QueryOracleVolatilityResponse.decode, @@ -153,10 +104,6 @@ export const createGetOracleVolatility = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryOracleVolatilityRequest, QueryOracleVolatilityResponse] }); -export const useGetOracleVolatility = buildUseQuery({ - builderQueryFn: createGetOracleVolatility, - queryKeyPrefix: "OracleVolatilityQuery" -}); export const createGetOracleProvidersInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOracleProvidersInfoRequest.encode, decode: QueryOracleProvidersInfoResponse.decode, @@ -165,10 +112,6 @@ export const createGetOracleProvidersInfo = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse] }); -export const useGetOracleProvidersInfo = buildUseQuery({ - builderQueryFn: createGetOracleProvidersInfo, - queryKeyPrefix: "OracleProvidersInfoQuery" -}); export const createGetOracleProviderPrices = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOracleProviderPricesRequest.encode, decode: QueryOracleProviderPricesResponse.decode, @@ -177,10 +120,6 @@ export const createGetOracleProviderPrices = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse] }); -export const useGetOracleProviderPrices = buildUseQuery({ - builderQueryFn: createGetOracleProviderPrices, - queryKeyPrefix: "OracleProviderPricesQuery" -}); export const createGetOraclePrice = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOraclePriceRequest.encode, decode: QueryOraclePriceResponse.decode, @@ -189,10 +128,6 @@ export const createGetOraclePrice = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryOraclePriceRequest, QueryOraclePriceResponse] }); -export const useGetOraclePrice = buildUseQuery({ - builderQueryFn: createGetOraclePrice, - queryKeyPrefix: "OraclePriceQuery" -}); export const createGetPythPrice = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPythPriceRequest.encode, decode: QueryPythPriceResponse.decode, @@ -200,8 +135,4 @@ export const createGetPythPrice = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetPythPrice, - queryKeyPrefix: "PythPriceQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..e6c96e7e --- /dev/null +++ b/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts @@ -0,0 +1,71 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; +import { createGetParams, createGetBandRelayers, createGetBandPriceStates, createGetBandIBCPriceStates, createGetPriceFeedPriceStates, createGetCoinbasePriceStates, createGetPythPriceStates, createGetStorkPriceStates, createGetStorkPublishers, createGetProviderPriceState, createGetOracleModuleState, createGetHistoricalPriceRecords, createGetOracleVolatility, createGetOracleProvidersInfo, createGetOracleProviderPrices, createGetOraclePrice, createGetPythPrice } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetBandRelayers = buildUseQuery({ + builderQueryFn: createGetBandRelayers, + queryKeyPrefix: "BandRelayersQuery" +}); +export const useGetBandPriceStates = buildUseQuery({ + builderQueryFn: createGetBandPriceStates, + queryKeyPrefix: "BandPriceStatesQuery" +}); +export const useGetBandIBCPriceStates = buildUseQuery({ + builderQueryFn: createGetBandIBCPriceStates, + queryKeyPrefix: "BandIBCPriceStatesQuery" +}); +export const useGetPriceFeedPriceStates = buildUseQuery({ + builderQueryFn: createGetPriceFeedPriceStates, + queryKeyPrefix: "PriceFeedPriceStatesQuery" +}); +export const useGetCoinbasePriceStates = buildUseQuery({ + builderQueryFn: createGetCoinbasePriceStates, + queryKeyPrefix: "CoinbasePriceStatesQuery" +}); +export const useGetPythPriceStates = buildUseQuery({ + builderQueryFn: createGetPythPriceStates, + queryKeyPrefix: "PythPriceStatesQuery" +}); +export const useGetStorkPriceStates = buildUseQuery({ + builderQueryFn: createGetStorkPriceStates, + queryKeyPrefix: "StorkPriceStatesQuery" +}); +export const useGetStorkPublishers = buildUseQuery({ + builderQueryFn: createGetStorkPublishers, + queryKeyPrefix: "StorkPublishersQuery" +}); +export const useGetProviderPriceState = buildUseQuery({ + builderQueryFn: createGetProviderPriceState, + queryKeyPrefix: "ProviderPriceStateQuery" +}); +export const useGetOracleModuleState = buildUseQuery({ + builderQueryFn: createGetOracleModuleState, + queryKeyPrefix: "OracleModuleStateQuery" +}); +export const useGetHistoricalPriceRecords = buildUseQuery({ + builderQueryFn: createGetHistoricalPriceRecords, + queryKeyPrefix: "HistoricalPriceRecordsQuery" +}); +export const useGetOracleVolatility = buildUseQuery({ + builderQueryFn: createGetOracleVolatility, + queryKeyPrefix: "OracleVolatilityQuery" +}); +export const useGetOracleProvidersInfo = buildUseQuery({ + builderQueryFn: createGetOracleProvidersInfo, + queryKeyPrefix: "OracleProvidersInfoQuery" +}); +export const useGetOracleProviderPrices = buildUseQuery({ + builderQueryFn: createGetOracleProviderPrices, + queryKeyPrefix: "OracleProviderPricesQuery" +}); +export const useGetOraclePrice = buildUseQuery({ + builderQueryFn: createGetOraclePrice, + queryKeyPrefix: "OraclePriceQuery" +}); +export const useGetPythPrice = buildUseQuery({ + builderQueryFn: createGetPythPrice, + queryKeyPrefix: "PythPriceQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.func.ts index f94e7d54..cb368da4 100644 --- a/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; export const createRelayProviderPrices = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createRelayProviderPrices = (clientResolver?: SigningClientResolver converters: toConverters(MsgRelayProviderPrices), deps: [MsgRelayProviderPrices] }); -export const useRelayProviderPrices = buildUseMutation({ - builderMutationFn: createRelayProviderPrices -}); export const createRelayPriceFeedPrice = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRelayPriceFeedPrice.typeUrl, @@ -19,9 +15,6 @@ export const createRelayPriceFeedPrice = (clientResolver?: SigningClientResolver converters: toConverters(MsgRelayPriceFeedPrice), deps: [MsgRelayPriceFeedPrice] }); -export const useRelayPriceFeedPrice = buildUseMutation({ - builderMutationFn: createRelayPriceFeedPrice -}); export const createRelayBandRates = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRelayBandRates.typeUrl, @@ -29,9 +22,6 @@ export const createRelayBandRates = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgRelayBandRates), deps: [MsgRelayBandRates] }); -export const useRelayBandRates = buildUseMutation({ - builderMutationFn: createRelayBandRates -}); export const createRequestBandIBCRates = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRequestBandIBCRates.typeUrl, @@ -39,9 +29,6 @@ export const createRequestBandIBCRates = (clientResolver?: SigningClientResolver converters: toConverters(MsgRequestBandIBCRates), deps: [MsgRequestBandIBCRates] }); -export const useRequestBandIBCRates = buildUseMutation({ - builderMutationFn: createRequestBandIBCRates -}); export const createRelayCoinbaseMessages = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRelayCoinbaseMessages.typeUrl, @@ -49,9 +36,6 @@ export const createRelayCoinbaseMessages = (clientResolver?: SigningClientResolv converters: toConverters(MsgRelayCoinbaseMessages), deps: [MsgRelayCoinbaseMessages] }); -export const useRelayCoinbaseMessages = buildUseMutation({ - builderMutationFn: createRelayCoinbaseMessages -}); export const createRelayStorkMessage = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRelayStorkPrices.typeUrl, @@ -59,9 +43,6 @@ export const createRelayStorkMessage = (clientResolver?: SigningClientResolver) converters: toConverters(MsgRelayStorkPrices), deps: [MsgRelayStorkPrices] }); -export const useRelayStorkMessage = buildUseMutation({ - builderMutationFn: createRelayStorkMessage -}); export const createRelayPythPrices = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRelayPythPrices.typeUrl, @@ -69,16 +50,10 @@ export const createRelayPythPrices = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgRelayPythPrices), deps: [MsgRelayPythPrices] }); -export const useRelayPythPrices = buildUseMutation({ - builderMutationFn: createRelayPythPrices -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..3fc9e703 --- /dev/null +++ b/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts @@ -0,0 +1,27 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; +import { createRelayProviderPrices, createRelayPriceFeedPrice, createRelayBandRates, createRequestBandIBCRates, createRelayCoinbaseMessages, createRelayStorkMessage, createRelayPythPrices, createUpdateParams } from "./tx.rpc.func.ts"; +export const useRelayProviderPrices = buildUseMutation({ + builderMutationFn: createRelayProviderPrices +}); +export const useRelayPriceFeedPrice = buildUseMutation({ + builderMutationFn: createRelayPriceFeedPrice +}); +export const useRelayBandRates = buildUseMutation({ + builderMutationFn: createRelayBandRates +}); +export const useRequestBandIBCRates = buildUseMutation({ + builderMutationFn: createRequestBandIBCRates +}); +export const useRelayCoinbaseMessages = buildUseMutation({ + builderMutationFn: createRelayCoinbaseMessages +}); +export const useRelayStorkMessage = buildUseMutation({ + builderMutationFn: createRelayStorkMessage +}); +export const useRelayPythPrices = buildUseMutation({ + builderMutationFn: createRelayPythPrices +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/peggy/v1/msgs.rpc.func.ts b/libs/injective-react/src/injective/peggy/v1/msgs.rpc.func.ts index bc9d6ab5..d5220f90 100644 --- a/libs/injective-react/src/injective/peggy/v1/msgs.rpc.func.ts +++ b/libs/injective-react/src/injective/peggy/v1/msgs.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; export const createValsetConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createValsetConfirm = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgValsetConfirm), deps: [MsgValsetConfirm] }); -export const useValsetConfirm = buildUseMutation({ - builderMutationFn: createValsetConfirm -}); export const createSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSendToEth.typeUrl, @@ -19,9 +15,6 @@ export const createSendToEth = (clientResolver?: SigningClientResolver) => build converters: toConverters(MsgSendToEth), deps: [MsgSendToEth] }); -export const useSendToEth = buildUseMutation({ - builderMutationFn: createSendToEth -}); export const createRequestBatch = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRequestBatch.typeUrl, @@ -29,9 +22,6 @@ export const createRequestBatch = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgRequestBatch), deps: [MsgRequestBatch] }); -export const useRequestBatch = buildUseMutation({ - builderMutationFn: createRequestBatch -}); export const createConfirmBatch = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgConfirmBatch.typeUrl, @@ -39,9 +29,6 @@ export const createConfirmBatch = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgConfirmBatch), deps: [MsgConfirmBatch] }); -export const useConfirmBatch = buildUseMutation({ - builderMutationFn: createConfirmBatch -}); export const createDepositClaim = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDepositClaim.typeUrl, @@ -49,9 +36,6 @@ export const createDepositClaim = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgDepositClaim), deps: [MsgDepositClaim] }); -export const useDepositClaim = buildUseMutation({ - builderMutationFn: createDepositClaim -}); export const createWithdrawClaim = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawClaim.typeUrl, @@ -59,9 +43,6 @@ export const createWithdrawClaim = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgWithdrawClaim), deps: [MsgWithdrawClaim] }); -export const useWithdrawClaim = buildUseMutation({ - builderMutationFn: createWithdrawClaim -}); export const createValsetUpdateClaim = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgValsetUpdatedClaim.typeUrl, @@ -69,9 +50,6 @@ export const createValsetUpdateClaim = (clientResolver?: SigningClientResolver) converters: toConverters(MsgValsetUpdatedClaim), deps: [MsgValsetUpdatedClaim] }); -export const useValsetUpdateClaim = buildUseMutation({ - builderMutationFn: createValsetUpdateClaim -}); export const createERC20DeployedClaim = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgERC20DeployedClaim.typeUrl, @@ -79,9 +57,6 @@ export const createERC20DeployedClaim = (clientResolver?: SigningClientResolver) converters: toConverters(MsgERC20DeployedClaim), deps: [MsgERC20DeployedClaim] }); -export const useERC20DeployedClaim = buildUseMutation({ - builderMutationFn: createERC20DeployedClaim -}); export const createSetOrchestratorAddresses = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSetOrchestratorAddresses.typeUrl, @@ -89,9 +64,6 @@ export const createSetOrchestratorAddresses = (clientResolver?: SigningClientRes converters: toConverters(MsgSetOrchestratorAddresses), deps: [MsgSetOrchestratorAddresses] }); -export const useSetOrchestratorAddresses = buildUseMutation({ - builderMutationFn: createSetOrchestratorAddresses -}); export const createCancelSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelSendToEth.typeUrl, @@ -99,9 +71,6 @@ export const createCancelSendToEth = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgCancelSendToEth), deps: [MsgCancelSendToEth] }); -export const useCancelSendToEth = buildUseMutation({ - builderMutationFn: createCancelSendToEth -}); export const createSubmitBadSignatureEvidence = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSubmitBadSignatureEvidence.typeUrl, @@ -109,9 +78,6 @@ export const createSubmitBadSignatureEvidence = (clientResolver?: SigningClientR converters: toConverters(MsgSubmitBadSignatureEvidence), deps: [MsgSubmitBadSignatureEvidence] }); -export const useSubmitBadSignatureEvidence = buildUseMutation({ - builderMutationFn: createSubmitBadSignatureEvidence -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -119,9 +85,6 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createBlacklistEthereumAddresses = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBlacklistEthereumAddresses.typeUrl, @@ -129,16 +92,10 @@ export const createBlacklistEthereumAddresses = (clientResolver?: SigningClientR converters: toConverters(MsgBlacklistEthereumAddresses), deps: [MsgBlacklistEthereumAddresses] }); -export const useBlacklistEthereumAddresses = buildUseMutation({ - builderMutationFn: createBlacklistEthereumAddresses -}); export const createRevokeEthereumBlacklist = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRevokeEthereumBlacklist.typeUrl, encoders: toEncoders(MsgRevokeEthereumBlacklist), converters: toConverters(MsgRevokeEthereumBlacklist), deps: [MsgRevokeEthereumBlacklist] -}); -export const useRevokeEthereumBlacklist = buildUseMutation({ - builderMutationFn: createRevokeEthereumBlacklist }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts b/libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts new file mode 100644 index 00000000..6e488ac4 --- /dev/null +++ b/libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts @@ -0,0 +1,45 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; +import { createValsetConfirm, createSendToEth, createRequestBatch, createConfirmBatch, createDepositClaim, createWithdrawClaim, createValsetUpdateClaim, createERC20DeployedClaim, createSetOrchestratorAddresses, createCancelSendToEth, createSubmitBadSignatureEvidence, createUpdateParams, createBlacklistEthereumAddresses, createRevokeEthereumBlacklist } from "./msgs.rpc.func.ts"; +export const useValsetConfirm = buildUseMutation({ + builderMutationFn: createValsetConfirm +}); +export const useSendToEth = buildUseMutation({ + builderMutationFn: createSendToEth +}); +export const useRequestBatch = buildUseMutation({ + builderMutationFn: createRequestBatch +}); +export const useConfirmBatch = buildUseMutation({ + builderMutationFn: createConfirmBatch +}); +export const useDepositClaim = buildUseMutation({ + builderMutationFn: createDepositClaim +}); +export const useWithdrawClaim = buildUseMutation({ + builderMutationFn: createWithdrawClaim +}); +export const useValsetUpdateClaim = buildUseMutation({ + builderMutationFn: createValsetUpdateClaim +}); +export const useERC20DeployedClaim = buildUseMutation({ + builderMutationFn: createERC20DeployedClaim +}); +export const useSetOrchestratorAddresses = buildUseMutation({ + builderMutationFn: createSetOrchestratorAddresses +}); +export const useCancelSendToEth = buildUseMutation({ + builderMutationFn: createCancelSendToEth +}); +export const useSubmitBadSignatureEvidence = buildUseMutation({ + builderMutationFn: createSubmitBadSignatureEvidence +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useBlacklistEthereumAddresses = buildUseMutation({ + builderMutationFn: createBlacklistEthereumAddresses +}); +export const useRevokeEthereumBlacklist = buildUseMutation({ + builderMutationFn: createRevokeEthereumBlacklist +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/peggy/v1/query.rpc.func.ts b/libs/injective-react/src/injective/peggy/v1/query.rpc.func.ts index 320e4fe3..2915d012 100644 --- a/libs/injective-react/src/injective/peggy/v1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/peggy/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetCurrentValset = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCurrentValsetRequest.encode, decode: QueryCurrentValsetResponse.decode, @@ -21,10 +16,6 @@ export const createGetCurrentValset = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryCurrentValsetRequest, QueryCurrentValsetResponse] }); -export const useGetCurrentValset = buildUseQuery({ - builderQueryFn: createGetCurrentValset, - queryKeyPrefix: "CurrentValsetQuery" -}); export const createGetValsetRequest = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValsetRequestRequest.encode, decode: QueryValsetRequestResponse.decode, @@ -33,10 +24,6 @@ export const createGetValsetRequest = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryValsetRequestRequest, QueryValsetRequestResponse] }); -export const useGetValsetRequest = buildUseQuery({ - builderQueryFn: createGetValsetRequest, - queryKeyPrefix: "ValsetRequestQuery" -}); export const createGetValsetConfirm = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValsetConfirmRequest.encode, decode: QueryValsetConfirmResponse.decode, @@ -45,10 +32,6 @@ export const createGetValsetConfirm = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryValsetConfirmRequest, QueryValsetConfirmResponse] }); -export const useGetValsetConfirm = buildUseQuery({ - builderQueryFn: createGetValsetConfirm, - queryKeyPrefix: "ValsetConfirmQuery" -}); export const createGetValsetConfirmsByNonce = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValsetConfirmsByNonceRequest.encode, decode: QueryValsetConfirmsByNonceResponse.decode, @@ -57,10 +40,6 @@ export const createGetValsetConfirmsByNonce = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse] }); -export const useGetValsetConfirmsByNonce = buildUseQuery({ - builderQueryFn: createGetValsetConfirmsByNonce, - queryKeyPrefix: "ValsetConfirmsByNonceQuery" -}); export const createGetLastValsetRequests = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryLastValsetRequestsRequest.encode, decode: QueryLastValsetRequestsResponse.decode, @@ -69,10 +48,6 @@ export const createGetLastValsetRequests = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse] }); -export const useGetLastValsetRequests = buildUseQuery({ - builderQueryFn: createGetLastValsetRequests, - queryKeyPrefix: "LastValsetRequestsQuery" -}); export const createGetLastPendingValsetRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryLastPendingValsetRequestByAddrRequest.encode, decode: QueryLastPendingValsetRequestByAddrResponse.decode, @@ -81,10 +56,6 @@ export const createGetLastPendingValsetRequestByAddr = (clientResolver?: RpcReso clientResolver, deps: [QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse] }); -export const useGetLastPendingValsetRequestByAddr = buildUseQuery({ - builderQueryFn: createGetLastPendingValsetRequestByAddr, - queryKeyPrefix: "LastPendingValsetRequestByAddrQuery" -}); export const createGetLastEventByAddr = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryLastEventByAddrRequest.encode, decode: QueryLastEventByAddrResponse.decode, @@ -93,10 +64,6 @@ export const createGetLastEventByAddr = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryLastEventByAddrRequest, QueryLastEventByAddrResponse] }); -export const useGetLastEventByAddr = buildUseQuery({ - builderQueryFn: createGetLastEventByAddr, - queryKeyPrefix: "LastEventByAddrQuery" -}); export const createGetGetPendingSendToEth = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPendingSendToEth.encode, decode: QueryPendingSendToEthResponse.decode, @@ -105,10 +72,6 @@ export const createGetGetPendingSendToEth = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryPendingSendToEth, QueryPendingSendToEthResponse] }); -export const useGetGetPendingSendToEth = buildUseQuery({ - builderQueryFn: createGetGetPendingSendToEth, - queryKeyPrefix: "GetPendingSendToEthQuery" -}); export const createGetBatchFees = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBatchFeeRequest.encode, decode: QueryBatchFeeResponse.decode, @@ -117,10 +80,6 @@ export const createGetBatchFees = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetBatchFees, - queryKeyPrefix: "BatchFeesQuery" -}); export const createGetOutgoingTxBatches = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOutgoingTxBatchesRequest.encode, decode: QueryOutgoingTxBatchesResponse.decode, @@ -129,10 +88,6 @@ export const createGetOutgoingTxBatches = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse] }); -export const useGetOutgoingTxBatches = buildUseQuery({ - builderQueryFn: createGetOutgoingTxBatches, - queryKeyPrefix: "OutgoingTxBatchesQuery" -}); export const createGetLastPendingBatchRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryLastPendingBatchRequestByAddrRequest.encode, decode: QueryLastPendingBatchRequestByAddrResponse.decode, @@ -141,10 +96,6 @@ export const createGetLastPendingBatchRequestByAddr = (clientResolver?: RpcResol clientResolver, deps: [QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse] }); -export const useGetLastPendingBatchRequestByAddr = buildUseQuery({ - builderQueryFn: createGetLastPendingBatchRequestByAddr, - queryKeyPrefix: "LastPendingBatchRequestByAddrQuery" -}); export const createGetBatchRequestByNonce = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBatchRequestByNonceRequest.encode, decode: QueryBatchRequestByNonceResponse.decode, @@ -153,10 +104,6 @@ export const createGetBatchRequestByNonce = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse] }); -export const useGetBatchRequestByNonce = buildUseQuery({ - builderQueryFn: createGetBatchRequestByNonce, - queryKeyPrefix: "BatchRequestByNonceQuery" -}); export const createGetBatchConfirms = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBatchConfirmsRequest.encode, decode: QueryBatchConfirmsResponse.decode, @@ -165,10 +112,6 @@ export const createGetBatchConfirms = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryBatchConfirmsRequest, QueryBatchConfirmsResponse] }); -export const useGetBatchConfirms = buildUseQuery({ - builderQueryFn: createGetBatchConfirms, - queryKeyPrefix: "BatchConfirmsQuery" -}); export const createGetERC20ToDenom = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryERC20ToDenomRequest.encode, decode: QueryERC20ToDenomResponse.decode, @@ -177,10 +120,6 @@ export const createGetERC20ToDenom = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryERC20ToDenomRequest, QueryERC20ToDenomResponse] }); -export const useGetERC20ToDenom = buildUseQuery({ - builderQueryFn: createGetERC20ToDenom, - queryKeyPrefix: "ERC20ToDenomQuery" -}); export const createGetDenomToERC20 = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomToERC20Request.encode, decode: QueryDenomToERC20Response.decode, @@ -189,10 +128,6 @@ export const createGetDenomToERC20 = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryDenomToERC20Request, QueryDenomToERC20Response] }); -export const useGetDenomToERC20 = buildUseQuery({ - builderQueryFn: createGetDenomToERC20, - queryKeyPrefix: "DenomToERC20Query" -}); export const createGetGetDelegateKeyByValidator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegateKeysByValidatorAddress.encode, decode: QueryDelegateKeysByValidatorAddressResponse.decode, @@ -201,10 +136,6 @@ export const createGetGetDelegateKeyByValidator = (clientResolver?: RpcResolver) clientResolver, deps: [QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse] }); -export const useGetGetDelegateKeyByValidator = buildUseQuery({ - builderQueryFn: createGetGetDelegateKeyByValidator, - queryKeyPrefix: "GetDelegateKeyByValidatorQuery" -}); export const createGetGetDelegateKeyByEth = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegateKeysByEthAddress.encode, decode: QueryDelegateKeysByEthAddressResponse.decode, @@ -213,10 +144,6 @@ export const createGetGetDelegateKeyByEth = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse] }); -export const useGetGetDelegateKeyByEth = buildUseQuery({ - builderQueryFn: createGetGetDelegateKeyByEth, - queryKeyPrefix: "GetDelegateKeyByEthQuery" -}); export const createGetGetDelegateKeyByOrchestrator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegateKeysByOrchestratorAddress.encode, decode: QueryDelegateKeysByOrchestratorAddressResponse.decode, @@ -225,10 +152,6 @@ export const createGetGetDelegateKeyByOrchestrator = (clientResolver?: RpcResolv clientResolver, deps: [QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse] }); -export const useGetGetDelegateKeyByOrchestrator = buildUseQuery({ - builderQueryFn: createGetGetDelegateKeyByOrchestrator, - queryKeyPrefix: "GetDelegateKeyByOrchestratorQuery" -}); export const createGetPeggyModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -237,10 +160,6 @@ export const createGetPeggyModuleState = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] }); -export const useGetPeggyModuleState = buildUseQuery({ - builderQueryFn: createGetPeggyModuleState, - queryKeyPrefix: "PeggyModuleStateQuery" -}); export const createGetMissingPeggoNonces = (clientResolver?: RpcResolver) => buildQuery({ encode: MissingNoncesRequest.encode, decode: MissingNoncesResponse.decode, @@ -248,8 +167,4 @@ export const createGetMissingPeggoNonces = (clientResolver?: RpcResolver) => bui method: "MissingPeggoNonces", clientResolver, deps: [MissingNoncesRequest, MissingNoncesResponse] -}); -export const useGetMissingPeggoNonces = buildUseQuery({ - builderQueryFn: createGetMissingPeggoNonces, - queryKeyPrefix: "MissingPeggoNoncesQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts b/libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts new file mode 100644 index 00000000..b004b522 --- /dev/null +++ b/libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts @@ -0,0 +1,87 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; +import { createGetParams, createGetCurrentValset, createGetValsetRequest, createGetValsetConfirm, createGetValsetConfirmsByNonce, createGetLastValsetRequests, createGetLastPendingValsetRequestByAddr, createGetLastEventByAddr, createGetGetPendingSendToEth, createGetBatchFees, createGetOutgoingTxBatches, createGetLastPendingBatchRequestByAddr, createGetBatchRequestByNonce, createGetBatchConfirms, createGetERC20ToDenom, createGetDenomToERC20, createGetGetDelegateKeyByValidator, createGetGetDelegateKeyByEth, createGetGetDelegateKeyByOrchestrator, createGetPeggyModuleState, createGetMissingPeggoNonces } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetCurrentValset = buildUseQuery({ + builderQueryFn: createGetCurrentValset, + queryKeyPrefix: "CurrentValsetQuery" +}); +export const useGetValsetRequest = buildUseQuery({ + builderQueryFn: createGetValsetRequest, + queryKeyPrefix: "ValsetRequestQuery" +}); +export const useGetValsetConfirm = buildUseQuery({ + builderQueryFn: createGetValsetConfirm, + queryKeyPrefix: "ValsetConfirmQuery" +}); +export const useGetValsetConfirmsByNonce = buildUseQuery({ + builderQueryFn: createGetValsetConfirmsByNonce, + queryKeyPrefix: "ValsetConfirmsByNonceQuery" +}); +export const useGetLastValsetRequests = buildUseQuery({ + builderQueryFn: createGetLastValsetRequests, + queryKeyPrefix: "LastValsetRequestsQuery" +}); +export const useGetLastPendingValsetRequestByAddr = buildUseQuery({ + builderQueryFn: createGetLastPendingValsetRequestByAddr, + queryKeyPrefix: "LastPendingValsetRequestByAddrQuery" +}); +export const useGetLastEventByAddr = buildUseQuery({ + builderQueryFn: createGetLastEventByAddr, + queryKeyPrefix: "LastEventByAddrQuery" +}); +export const useGetGetPendingSendToEth = buildUseQuery({ + builderQueryFn: createGetGetPendingSendToEth, + queryKeyPrefix: "GetPendingSendToEthQuery" +}); +export const useGetBatchFees = buildUseQuery({ + builderQueryFn: createGetBatchFees, + queryKeyPrefix: "BatchFeesQuery" +}); +export const useGetOutgoingTxBatches = buildUseQuery({ + builderQueryFn: createGetOutgoingTxBatches, + queryKeyPrefix: "OutgoingTxBatchesQuery" +}); +export const useGetLastPendingBatchRequestByAddr = buildUseQuery({ + builderQueryFn: createGetLastPendingBatchRequestByAddr, + queryKeyPrefix: "LastPendingBatchRequestByAddrQuery" +}); +export const useGetBatchRequestByNonce = buildUseQuery({ + builderQueryFn: createGetBatchRequestByNonce, + queryKeyPrefix: "BatchRequestByNonceQuery" +}); +export const useGetBatchConfirms = buildUseQuery({ + builderQueryFn: createGetBatchConfirms, + queryKeyPrefix: "BatchConfirmsQuery" +}); +export const useGetERC20ToDenom = buildUseQuery({ + builderQueryFn: createGetERC20ToDenom, + queryKeyPrefix: "ERC20ToDenomQuery" +}); +export const useGetDenomToERC20 = buildUseQuery({ + builderQueryFn: createGetDenomToERC20, + queryKeyPrefix: "DenomToERC20Query" +}); +export const useGetGetDelegateKeyByValidator = buildUseQuery({ + builderQueryFn: createGetGetDelegateKeyByValidator, + queryKeyPrefix: "GetDelegateKeyByValidatorQuery" +}); +export const useGetGetDelegateKeyByEth = buildUseQuery({ + builderQueryFn: createGetGetDelegateKeyByEth, + queryKeyPrefix: "GetDelegateKeyByEthQuery" +}); +export const useGetGetDelegateKeyByOrchestrator = buildUseQuery({ + builderQueryFn: createGetGetDelegateKeyByOrchestrator, + queryKeyPrefix: "GetDelegateKeyByOrchestratorQuery" +}); +export const useGetPeggyModuleState = buildUseQuery({ + builderQueryFn: createGetPeggyModuleState, + queryKeyPrefix: "PeggyModuleStateQuery" +}); +export const useGetMissingPeggoNonces = buildUseQuery({ + builderQueryFn: createGetMissingPeggoNonces, + queryKeyPrefix: "MissingPeggoNoncesQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.func.ts b/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.func.ts index ef93a703..22e64ab9 100644 --- a/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetAllNamespaces = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllNamespacesRequest.encode, decode: QueryAllNamespacesResponse.decode, @@ -21,10 +16,6 @@ export const createGetAllNamespaces = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryAllNamespacesRequest, QueryAllNamespacesResponse] }); -export const useGetAllNamespaces = buildUseQuery({ - builderQueryFn: createGetAllNamespaces, - queryKeyPrefix: "AllNamespacesQuery" -}); export const createGetNamespaceByDenom = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryNamespaceByDenomRequest.encode, decode: QueryNamespaceByDenomResponse.decode, @@ -33,10 +24,6 @@ export const createGetNamespaceByDenom = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse] }); -export const useGetNamespaceByDenom = buildUseQuery({ - builderQueryFn: createGetNamespaceByDenom, - queryKeyPrefix: "NamespaceByDenomQuery" -}); export const createGetAddressRoles = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAddressRolesRequest.encode, decode: QueryAddressRolesResponse.decode, @@ -45,10 +32,6 @@ export const createGetAddressRoles = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryAddressRolesRequest, QueryAddressRolesResponse] }); -export const useGetAddressRoles = buildUseQuery({ - builderQueryFn: createGetAddressRoles, - queryKeyPrefix: "AddressRolesQuery" -}); export const createGetAddressesByRole = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAddressesByRoleRequest.encode, decode: QueryAddressesByRoleResponse.decode, @@ -57,10 +40,6 @@ export const createGetAddressesByRole = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryAddressesByRoleRequest, QueryAddressesByRoleResponse] }); -export const useGetAddressesByRole = buildUseQuery({ - builderQueryFn: createGetAddressesByRole, - queryKeyPrefix: "AddressesByRoleQuery" -}); export const createGetVouchersForAddress = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVouchersForAddressRequest.encode, decode: QueryVouchersForAddressResponse.decode, @@ -68,8 +47,4 @@ export const createGetVouchersForAddress = (clientResolver?: RpcResolver) => bui method: "VouchersForAddress", clientResolver, deps: [QueryVouchersForAddressRequest, QueryVouchersForAddressResponse] -}); -export const useGetVouchersForAddress = buildUseQuery({ - builderQueryFn: createGetVouchersForAddress, - queryKeyPrefix: "VouchersForAddressQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..8a076a1a --- /dev/null +++ b/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts @@ -0,0 +1,27 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; +import { createGetParams, createGetAllNamespaces, createGetNamespaceByDenom, createGetAddressRoles, createGetAddressesByRole, createGetVouchersForAddress } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetAllNamespaces = buildUseQuery({ + builderQueryFn: createGetAllNamespaces, + queryKeyPrefix: "AllNamespacesQuery" +}); +export const useGetNamespaceByDenom = buildUseQuery({ + builderQueryFn: createGetNamespaceByDenom, + queryKeyPrefix: "NamespaceByDenomQuery" +}); +export const useGetAddressRoles = buildUseQuery({ + builderQueryFn: createGetAddressRoles, + queryKeyPrefix: "AddressRolesQuery" +}); +export const useGetAddressesByRole = buildUseQuery({ + builderQueryFn: createGetAddressesByRole, + queryKeyPrefix: "AddressesByRoleQuery" +}); +export const useGetVouchersForAddress = buildUseQuery({ + builderQueryFn: createGetVouchersForAddress, + queryKeyPrefix: "VouchersForAddressQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.func.ts index 5d767842..cec152ec 100644 --- a/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createCreateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateNamespace.typeUrl, @@ -19,9 +15,6 @@ export const createCreateNamespace = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgCreateNamespace), deps: [MsgCreateNamespace] }); -export const useCreateNamespace = buildUseMutation({ - builderMutationFn: createCreateNamespace -}); export const createDeleteNamespace = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDeleteNamespace.typeUrl, @@ -29,9 +22,6 @@ export const createDeleteNamespace = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgDeleteNamespace), deps: [MsgDeleteNamespace] }); -export const useDeleteNamespace = buildUseMutation({ - builderMutationFn: createDeleteNamespace -}); export const createUpdateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateNamespace.typeUrl, @@ -39,9 +29,6 @@ export const createUpdateNamespace = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgUpdateNamespace), deps: [MsgUpdateNamespace] }); -export const useUpdateNamespace = buildUseMutation({ - builderMutationFn: createUpdateNamespace -}); export const createUpdateNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateNamespaceRoles.typeUrl, @@ -49,9 +36,6 @@ export const createUpdateNamespaceRoles = (clientResolver?: SigningClientResolve converters: toConverters(MsgUpdateNamespaceRoles), deps: [MsgUpdateNamespaceRoles] }); -export const useUpdateNamespaceRoles = buildUseMutation({ - builderMutationFn: createUpdateNamespaceRoles -}); export const createRevokeNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRevokeNamespaceRoles.typeUrl, @@ -59,16 +43,10 @@ export const createRevokeNamespaceRoles = (clientResolver?: SigningClientResolve converters: toConverters(MsgRevokeNamespaceRoles), deps: [MsgRevokeNamespaceRoles] }); -export const useRevokeNamespaceRoles = buildUseMutation({ - builderMutationFn: createRevokeNamespaceRoles -}); export const createClaimVoucher = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgClaimVoucher.typeUrl, encoders: toEncoders(MsgClaimVoucher), converters: toConverters(MsgClaimVoucher), deps: [MsgClaimVoucher] -}); -export const useClaimVoucher = buildUseMutation({ - builderMutationFn: createClaimVoucher }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..256c359b --- /dev/null +++ b/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; +import { createUpdateParams, createCreateNamespace, createDeleteNamespace, createUpdateNamespace, createUpdateNamespaceRoles, createRevokeNamespaceRoles, createClaimVoucher } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useCreateNamespace = buildUseMutation({ + builderMutationFn: createCreateNamespace +}); +export const useDeleteNamespace = buildUseMutation({ + builderMutationFn: createDeleteNamespace +}); +export const useUpdateNamespace = buildUseMutation({ + builderMutationFn: createUpdateNamespace +}); +export const useUpdateNamespaceRoles = buildUseMutation({ + builderMutationFn: createUpdateNamespaceRoles +}); +export const useRevokeNamespaceRoles = buildUseMutation({ + builderMutationFn: createRevokeNamespaceRoles +}); +export const useClaimVoucher = buildUseMutation({ + builderMutationFn: createClaimVoucher +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.func.ts b/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.func.ts index 3edeb77c..f443876c 100644 --- a/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetDenomAuthorityMetadata = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomAuthorityMetadataRequest.encode, decode: QueryDenomAuthorityMetadataResponse.decode, @@ -21,10 +16,6 @@ export const createGetDenomAuthorityMetadata = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse] }); -export const useGetDenomAuthorityMetadata = buildUseQuery({ - builderQueryFn: createGetDenomAuthorityMetadata, - queryKeyPrefix: "DenomAuthorityMetadataQuery" -}); export const createGetDenomsFromCreator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomsFromCreatorRequest.encode, decode: QueryDenomsFromCreatorResponse.decode, @@ -33,10 +24,6 @@ export const createGetDenomsFromCreator = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse] }); -export const useGetDenomsFromCreator = buildUseQuery({ - builderQueryFn: createGetDenomsFromCreator, - queryKeyPrefix: "DenomsFromCreatorQuery" -}); export const createGetTokenfactoryModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -44,8 +31,4 @@ export const createGetTokenfactoryModuleState = (clientResolver?: RpcResolver) = method: "TokenfactoryModuleState", clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] -}); -export const useGetTokenfactoryModuleState = buildUseQuery({ - builderQueryFn: createGetTokenfactoryModuleState, - queryKeyPrefix: "TokenfactoryModuleStateQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..aaacfde2 --- /dev/null +++ b/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts @@ -0,0 +1,19 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetParams, createGetDenomAuthorityMetadata, createGetDenomsFromCreator, createGetTokenfactoryModuleState } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDenomAuthorityMetadata = buildUseQuery({ + builderQueryFn: createGetDenomAuthorityMetadata, + queryKeyPrefix: "DenomAuthorityMetadataQuery" +}); +export const useGetDenomsFromCreator = buildUseQuery({ + builderQueryFn: createGetDenomsFromCreator, + queryKeyPrefix: "DenomsFromCreatorQuery" +}); +export const useGetTokenfactoryModuleState = buildUseQuery({ + builderQueryFn: createGetTokenfactoryModuleState, + queryKeyPrefix: "TokenfactoryModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts b/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts index 3a20b01c..28455f34 100644 --- a/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; export const createCreateDenom = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateDenom = (clientResolver?: SigningClientResolver) => bui converters: toConverters(MsgCreateDenom), deps: [MsgCreateDenom] }); -export const useCreateDenom = buildUseMutation({ - builderMutationFn: createCreateDenom -}); export const createMint = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgMint.typeUrl, @@ -19,9 +15,6 @@ export const createMint = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createMint -}); export const createBurn = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBurn.typeUrl, @@ -29,9 +22,6 @@ export const createBurn = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createBurn -}); export const createChangeAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChangeAdmin.typeUrl, @@ -39,9 +29,6 @@ export const createChangeAdmin = (clientResolver?: SigningClientResolver) => bui converters: toConverters(MsgChangeAdmin), deps: [MsgChangeAdmin] }); -export const useChangeAdmin = buildUseMutation({ - builderMutationFn: createChangeAdmin -}); export const createSetDenomMetadata = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSetDenomMetadata.typeUrl, @@ -49,16 +36,10 @@ export const createSetDenomMetadata = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgSetDenomMetadata), deps: [MsgSetDenomMetadata] }); -export const useSetDenomMetadata = buildUseMutation({ - builderMutationFn: createSetDenomMetadata -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..a900abba --- /dev/null +++ b/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts @@ -0,0 +1,21 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; +import { createCreateDenom, createMint, createBurn, createChangeAdmin, createSetDenomMetadata, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateDenom = buildUseMutation({ + builderMutationFn: createCreateDenom +}); +export const useMint = buildUseMutation({ + builderMutationFn: createMint +}); +export const useBurn = buildUseMutation({ + builderMutationFn: createBurn +}); +export const useChangeAdmin = buildUseMutation({ + builderMutationFn: createChangeAdmin +}); +export const useSetDenomMetadata = buildUseMutation({ + builderMutationFn: createSetDenomMetadata +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/wasmx/v1/query.rpc.func.ts b/libs/injective-react/src/injective/wasmx/v1/query.rpc.func.ts index 0a24db06..5b2d75b1 100644 --- a/libs/injective-react/src/injective/wasmx/v1/query.rpc.func.ts +++ b/libs/injective-react/src/injective/wasmx/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; export const createGetWasmxParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryWasmxParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetWasmxParams = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryWasmxParamsRequest, QueryWasmxParamsResponse] }); -export const useGetWasmxParams = buildUseQuery({ - builderQueryFn: createGetWasmxParams, - queryKeyPrefix: "WasmxParamsQuery" -}); export const createGetContractRegistrationInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractRegistrationInfoRequest.encode, decode: QueryContractRegistrationInfoResponse.decode, @@ -21,10 +16,6 @@ export const createGetContractRegistrationInfo = (clientResolver?: RpcResolver) clientResolver, deps: [QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse] }); -export const useGetContractRegistrationInfo = buildUseQuery({ - builderQueryFn: createGetContractRegistrationInfo, - queryKeyPrefix: "ContractRegistrationInfoQuery" -}); export const createGetWasmxModuleState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleStateRequest.encode, decode: QueryModuleStateResponse.decode, @@ -32,8 +23,4 @@ export const createGetWasmxModuleState = (clientResolver?: RpcResolver) => build method: "WasmxModuleState", clientResolver, deps: [QueryModuleStateRequest, QueryModuleStateResponse] -}); -export const useGetWasmxModuleState = buildUseQuery({ - builderQueryFn: createGetWasmxModuleState, - queryKeyPrefix: "WasmxModuleStateQuery" }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts b/libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts new file mode 100644 index 00000000..5df8c151 --- /dev/null +++ b/libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetWasmxParams, createGetContractRegistrationInfo, createGetWasmxModuleState } from "./query.rpc.func.ts"; +export const useGetWasmxParams = buildUseQuery({ + builderQueryFn: createGetWasmxParams, + queryKeyPrefix: "WasmxParamsQuery" +}); +export const useGetContractRegistrationInfo = buildUseQuery({ + builderQueryFn: createGetContractRegistrationInfo, + queryKeyPrefix: "ContractRegistrationInfoQuery" +}); +export const useGetWasmxModuleState = buildUseQuery({ + builderQueryFn: createGetWasmxModuleState, + queryKeyPrefix: "WasmxModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-react/src/injective/wasmx/v1/tx.rpc.func.ts b/libs/injective-react/src/injective/wasmx/v1/tx.rpc.func.ts index d6f5c2ee..48648798 100644 --- a/libs/injective-react/src/injective/wasmx/v1/tx.rpc.func.ts +++ b/libs/injective-react/src/injective/wasmx/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; export const createUpdateRegistryContractParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createUpdateRegistryContractParams = (clientResolver?: SigningClien converters: toConverters(MsgUpdateContract), deps: [MsgUpdateContract] }); -export const useUpdateRegistryContractParams = buildUseMutation({ - builderMutationFn: createUpdateRegistryContractParams -}); export const createActivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgActivateContract.typeUrl, @@ -19,9 +15,6 @@ export const createActivateRegistryContract = (clientResolver?: SigningClientRes converters: toConverters(MsgActivateContract), deps: [MsgActivateContract] }); -export const useActivateRegistryContract = buildUseMutation({ - builderMutationFn: createActivateRegistryContract -}); export const createDeactivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDeactivateContract.typeUrl, @@ -29,9 +22,6 @@ export const createDeactivateRegistryContract = (clientResolver?: SigningClientR converters: toConverters(MsgDeactivateContract), deps: [MsgDeactivateContract] }); -export const useDeactivateRegistryContract = buildUseMutation({ - builderMutationFn: createDeactivateRegistryContract -}); export const createExecuteContractCompat = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExecuteContractCompat.typeUrl, @@ -39,9 +29,6 @@ export const createExecuteContractCompat = (clientResolver?: SigningClientResolv converters: toConverters(MsgExecuteContractCompat), deps: [MsgExecuteContractCompat] }); -export const useExecuteContractCompat = buildUseMutation({ - builderMutationFn: createExecuteContractCompat -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -49,16 +36,10 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createRegisterContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRegisterContract.typeUrl, encoders: toEncoders(MsgRegisterContract), converters: toConverters(MsgRegisterContract), deps: [MsgRegisterContract] -}); -export const useRegisterContract = buildUseMutation({ - builderMutationFn: createRegisterContract }); \ No newline at end of file diff --git a/libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts b/libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts new file mode 100644 index 00000000..54db46b1 --- /dev/null +++ b/libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts @@ -0,0 +1,21 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; +import { createUpdateRegistryContractParams, createActivateRegistryContract, createDeactivateRegistryContract, createExecuteContractCompat, createUpdateParams, createRegisterContract } from "./tx.rpc.func.ts"; +export const useUpdateRegistryContractParams = buildUseMutation({ + builderMutationFn: createUpdateRegistryContractParams +}); +export const useActivateRegistryContract = buildUseMutation({ + builderMutationFn: createActivateRegistryContract +}); +export const useDeactivateRegistryContract = buildUseMutation({ + builderMutationFn: createDeactivateRegistryContract +}); +export const useExecuteContractCompat = buildUseMutation({ + builderMutationFn: createExecuteContractCompat +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useRegisterContract = buildUseMutation({ + builderMutationFn: createRegisterContract +}); \ No newline at end of file diff --git a/libs/injective-react/src/react-query.ts b/libs/injective-react/src/react-query.ts index 587070c6..f26d1ce2 100644 --- a/libs/injective-react/src/react-query.ts +++ b/libs/injective-react/src/react-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/registry.ts b/libs/injective-react/src/registry.ts index 7356722f..1581e912 100644 --- a/libs/injective-react/src/registry.ts +++ b/libs/injective-react/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/types.ts b/libs/injective-react/src/types.ts index 2bace856..cdcfbdf9 100644 --- a/libs/injective-react/src/types.ts +++ b/libs/injective-react/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/utf8.ts b/libs/injective-react/src/utf8.ts index c5dba8d6..c0f5c97c 100644 --- a/libs/injective-react/src/utf8.ts +++ b/libs/injective-react/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/varint.ts b/libs/injective-react/src/varint.ts index 95ef3b55..70a851bd 100644 --- a/libs/injective-react/src/varint.ts +++ b/libs/injective-react/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/binary.ts b/libs/injective-vue/src/binary.ts index 2eaa6cb6..e6922501 100644 --- a/libs/injective-vue/src/binary.ts +++ b/libs/injective-vue/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/cosmos/auth/v1beta1/auth.ts b/libs/injective-vue/src/cosmos/auth/v1beta1/auth.ts index 236320b9..c05b4a94 100644 --- a/libs/injective-vue/src/cosmos/auth/v1beta1/auth.ts +++ b/libs/injective-vue/src/cosmos/auth/v1beta1/auth.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * BaseAccount defines a base account type. It contains all the necessary fields * for basic account functionality. Any custom account type should extend this @@ -14,12 +13,6 @@ export interface BaseAccount { accountNumber: bigint; sequence: bigint; } -export interface ReactiveBaseAccount { - address: ComputedRef; - pubKey?: ComputedRef; - accountNumber: ComputedRef; - sequence: ComputedRef; -} export interface BaseAccountProtoMsg { typeUrl: "/cosmos.auth.v1beta1.BaseAccount"; value: Uint8Array; @@ -45,11 +38,6 @@ export interface ModuleAccount { name: string; permissions: string[]; } -export interface ReactiveModuleAccount { - baseAccount?: ComputedRef; - name: ComputedRef; - permissions: ComputedRef; -} export interface ModuleAccountProtoMsg { typeUrl: "/cosmos.auth.v1beta1.ModuleAccount"; value: Uint8Array; @@ -78,10 +66,6 @@ export interface ModuleCredential { */ derivationKeys: Uint8Array[]; } -export interface ReactiveModuleCredential { - moduleName: ComputedRef; - derivationKeys: ComputedRef; -} export interface ModuleCredentialProtoMsg { typeUrl: "/cosmos.auth.v1beta1.ModuleCredential"; value: Uint8Array; @@ -112,13 +96,6 @@ export interface Params { sigVerifyCostEd25519: bigint; sigVerifyCostSecp256k1: bigint; } -export interface ReactiveParams { - maxMemoCharacters: ComputedRef; - txSigLimit: ComputedRef; - txSizeCostPerByte: ComputedRef; - sigVerifyCostEd25519: ComputedRef; - sigVerifyCostSecp256k1: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.auth.v1beta1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts deleted file mode 100644 index e2374dd6..00000000 --- a/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,528 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse, ReactiveQueryAccountsRequest, ReactiveQueryAccountRequest, ReactiveQueryAccountAddressByIDRequest, ReactiveQueryParamsRequest, ReactiveQueryModuleAccountsRequest, ReactiveQueryModuleAccountByNameRequest, ReactiveQueryAccountInfoRequest } from "./query"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* 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 = async (request: QueryAccountsRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* Account returns account details based on address. */ - account = async (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 BinaryReader(data))); - }; - /* AccountAddressByID returns account address based on account number. - - Since: cosmos-sdk 0.46.2 */ - accountAddressByID = async (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 BinaryReader(data))); - }; - /* Params queries all parameters. */ - params = async (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 BinaryReader(data))); - }; - /* ModuleAccounts returns all the existing module accounts. - - Since: cosmos-sdk 0.46 */ - moduleAccounts = async (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 BinaryReader(data))); - }; - /* ModuleAccountByName returns the module account info by module name */ - moduleAccountByName = async (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 BinaryReader(data))); - }; - /* Bech32Prefix queries bech32Prefix - - Since: cosmos-sdk 0.46 */ - bech32Prefix = async (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 BinaryReader(data))); - }; - /* AddressBytesToString converts Account Address bytes to string - - Since: cosmos-sdk 0.46 */ - addressBytesToString = async (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 BinaryReader(data))); - }; - /* AddressStringToBytes converts Address string to bytes - - Since: cosmos-sdk 0.46 */ - addressStringToBytes = async (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 BinaryReader(data))); - }; - /* AccountInfo queries account info which is common to all account types. - - Since: cosmos-sdk 0.47 */ - accountInfo = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - accounts(request?: QueryAccountsRequest): Promise { - return queryService.accounts(request); - }, - account(request: QueryAccountRequest): Promise { - return queryService.account(request); - }, - accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { - return queryService.accountAddressByID(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - moduleAccounts(request?: QueryModuleAccountsRequest): Promise { - return queryService.moduleAccounts(request); - }, - moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise { - return queryService.moduleAccountByName(request); - }, - bech32Prefix(request?: Bech32PrefixRequest): Promise { - return queryService.bech32Prefix(request); - }, - addressBytesToString(request: AddressBytesToStringRequest): Promise { - return queryService.addressBytesToString(request); - }, - addressStringToBytes(request: AddressStringToBytesRequest): Promise { - return queryService.addressStringToBytes(request); - }, - accountInfo(request: QueryAccountInfoRequest): Promise { - return queryService.accountInfo(request); - } - }; -}; -export interface UseAccountsQuery extends VueQueryParams { - request?: ReactiveQueryAccountsRequest; -} -export interface UseAccountQuery extends VueQueryParams { - request: ReactiveQueryAccountRequest; -} -export interface UseAccountAddressByIDQuery extends VueQueryParams { - request: ReactiveQueryAccountAddressByIDRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseModuleAccountsQuery extends VueQueryParams { - request?: ReactiveQueryModuleAccountsRequest; -} -export interface UseModuleAccountByNameQuery extends VueQueryParams { - request: ReactiveQueryModuleAccountByNameRequest; -} -export interface UseBech32PrefixQuery extends VueQueryParams { - request?: ReactiveBech32PrefixRequest; -} -export interface UseAddressBytesToStringQuery extends VueQueryParams { - request: ReactiveAddressBytesToStringRequest; -} -export interface UseAddressStringToBytesQuery extends VueQueryParams { - request: ReactiveAddressStringToBytesRequest; -} -export interface UseAccountInfoQuery extends VueQueryParams { - request: ReactiveQueryAccountInfoRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useAccounts = ({ - request, - options - }: UseAccountsQuery) => { - const queryKey = ["accountsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accounts(params); - }, - ...options - }); - }; - const useAccount = ({ - request, - options - }: UseAccountQuery) => { - const queryKey = ["accountQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.account(params); - }, - ...options - }); - }; - const useAccountAddressByID = ({ - request, - options - }: UseAccountAddressByIDQuery) => { - const queryKey = ["accountAddressByIDQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accountAddressByID(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useModuleAccounts = ({ - request, - options - }: UseModuleAccountsQuery) => { - const queryKey = ["moduleAccountsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.moduleAccounts(params); - }, - ...options - }); - }; - const useModuleAccountByName = ({ - request, - options - }: UseModuleAccountByNameQuery) => { - const queryKey = ["moduleAccountByNameQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.moduleAccountByName(params); - }, - ...options - }); - }; - const useBech32Prefix = ({ - request, - options - }: UseBech32PrefixQuery) => { - const queryKey = ["bech32PrefixQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.bech32Prefix(params); - }, - ...options - }); - }; - const useAddressBytesToString = ({ - request, - options - }: UseAddressBytesToStringQuery) => { - const queryKey = ["addressBytesToStringQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.addressBytesToString(params); - }, - ...options - }); - }; - const useAddressStringToBytes = ({ - request, - options - }: UseAddressStringToBytesQuery) => { - const queryKey = ["addressStringToBytesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.addressStringToBytes(params); - }, - ...options - }); - }; - const useAccountInfo = ({ - request, - options - }: UseAccountInfoQuery) => { - const queryKey = ["accountInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accountInfo(params); - }, - ...options - }); - }; - return { - /** - * 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 - */ - useAccounts, - /** Account returns account details based on address. */useAccount, - /** - * AccountAddressByID returns account address based on account number. - * - * Since: cosmos-sdk 0.46.2 - */ - useAccountAddressByID, - /** Params queries all parameters. */useParams, - /** - * ModuleAccounts returns all the existing module accounts. - * - * Since: cosmos-sdk 0.46 - */ - useModuleAccounts, - /** ModuleAccountByName returns the module account info by module name */useModuleAccountByName, - /** - * Bech32Prefix queries bech32Prefix - * - * Since: cosmos-sdk 0.46 - */ - useBech32Prefix, - /** - * AddressBytesToString converts Account Address bytes to string - * - * Since: cosmos-sdk 0.46 - */ - useAddressBytesToString, - /** - * AddressStringToBytes converts Address string to bytes - * - * Since: cosmos-sdk 0.46 - */ - useAddressStringToBytes, - /** - * AccountInfo queries account info which is common to all account types. - * - * Since: cosmos-sdk 0.47 - */ - useAccountInfo - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..9a6e4931 --- /dev/null +++ b/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts @@ -0,0 +1,72 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountsRequest.encode, + decode: QueryAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Accounts", + clientResolver +}); +export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountRequest.encode, + decode: QueryAccountResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Account", + clientResolver +}); +export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressByIDRequest.encode, + decode: QueryAccountAddressByIDResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountAddressByID", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountsRequest.encode, + decode: QueryModuleAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccounts", + clientResolver +}); +export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountByNameRequest.encode, + decode: QueryModuleAccountByNameResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccountByName", + clientResolver +}); +export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuery({ + encode: Bech32PrefixRequest.encode, + decode: Bech32PrefixResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Bech32Prefix", + clientResolver +}); +export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressBytesToStringRequest.encode, + decode: AddressBytesToStringResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressBytesToString", + clientResolver +}); +export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressStringToBytesRequest.encode, + decode: AddressStringToBytesResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressStringToBytes", + clientResolver +}); +export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountInfoRequest.encode, + decode: QueryAccountInfoResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountInfo", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..b09ee08f --- /dev/null +++ b/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts @@ -0,0 +1,43 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +export const useGetAccounts = buildUseVueQuery({ + builderQueryFn: createGetAccounts, + queryKeyPrefix: "AccountsQuery" +}); +export const useGetAccount = buildUseVueQuery({ + builderQueryFn: createGetAccount, + queryKeyPrefix: "AccountQuery" +}); +export const useGetAccountAddressByID = buildUseVueQuery({ + builderQueryFn: createGetAccountAddressByID, + queryKeyPrefix: "AccountAddressByIDQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetModuleAccounts = buildUseVueQuery({ + builderQueryFn: createGetModuleAccounts, + queryKeyPrefix: "ModuleAccountsQuery" +}); +export const useGetModuleAccountByName = buildUseVueQuery({ + builderQueryFn: createGetModuleAccountByName, + queryKeyPrefix: "ModuleAccountByNameQuery" +}); +export const useGetBech32Prefix = buildUseVueQuery({ + builderQueryFn: createGetBech32Prefix, + queryKeyPrefix: "Bech32PrefixQuery" +}); +export const useGetAddressBytesToString = buildUseVueQuery({ + builderQueryFn: createGetAddressBytesToString, + queryKeyPrefix: "AddressBytesToStringQuery" +}); +export const useGetAddressStringToBytes = buildUseVueQuery({ + builderQueryFn: createGetAddressStringToBytes, + queryKeyPrefix: "AddressStringToBytesQuery" +}); +export const useGetAccountInfo = buildUseVueQuery({ + builderQueryFn: createGetAccountInfo, + queryKeyPrefix: "AccountInfoQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/auth/v1beta1/query.ts b/libs/injective-vue/src/cosmos/auth/v1beta1/query.ts index 50544a50..7a1a3c1a 100644 --- a/libs/injective-vue/src/cosmos/auth/v1beta1/query.ts +++ b/libs/injective-vue/src/cosmos/auth/v1beta1/query.ts @@ -5,7 +5,6 @@ import { EthAccount, EthAccountProtoMsg } from "../../../injective/types/v1beta1 import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. * @@ -15,9 +14,6 @@ export interface QueryAccountsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAccountsRequest { - pagination?: ComputedRef; -} export interface QueryAccountsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; value: Uint8Array; @@ -46,10 +42,6 @@ export interface QueryAccountsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAccountsResponse { - accounts: ComputedRef<(BaseAccount | EthAccount | Any)[] | Any[]>; - pagination?: ComputedRef; -} export interface QueryAccountsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; value: Uint8Array; @@ -77,9 +69,6 @@ export interface QueryAccountRequest { /** address defines the address to query for. */ address: string; } -export interface ReactiveQueryAccountRequest { - address: ComputedRef; -} export interface QueryAccountRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest"; value: Uint8Array; @@ -98,9 +87,6 @@ export interface QueryAccountResponse { /** account defines the account of the corresponding address. */ account?: BaseAccount | EthAccount | Any | undefined; } -export interface ReactiveQueryAccountResponse { - account?: ComputedRef; -} export interface QueryAccountResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse"; value: Uint8Array; @@ -119,7 +105,6 @@ export interface QueryAccountResponseAminoMsg { } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -135,9 +120,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -157,7 +139,6 @@ export interface QueryParamsResponseAminoMsg { * Since: cosmos-sdk 0.46 */ export interface QueryModuleAccountsRequest {} -export interface ReactiveQueryModuleAccountsRequest {} export interface QueryModuleAccountsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest"; value: Uint8Array; @@ -180,9 +161,6 @@ export interface QueryModuleAccountsRequestAminoMsg { export interface QueryModuleAccountsResponse { accounts: (ModuleAccount | Any)[] | Any[]; } -export interface ReactiveQueryModuleAccountsResponse { - accounts: ComputedRef<(ModuleAccount | Any)[] | Any[]>; -} export interface QueryModuleAccountsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse"; value: Uint8Array; @@ -206,9 +184,6 @@ export interface QueryModuleAccountsResponseAminoMsg { export interface QueryModuleAccountByNameRequest { name: string; } -export interface ReactiveQueryModuleAccountByNameRequest { - name: ComputedRef; -} export interface QueryModuleAccountByNameRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest"; value: Uint8Array; @@ -225,9 +200,6 @@ export interface QueryModuleAccountByNameRequestAminoMsg { export interface QueryModuleAccountByNameResponse { account?: ModuleAccount | Any | undefined; } -export interface ReactiveQueryModuleAccountByNameResponse { - account?: ComputedRef; -} export interface QueryModuleAccountByNameResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse"; value: Uint8Array; @@ -249,7 +221,6 @@ export interface QueryModuleAccountByNameResponseAminoMsg { * Since: cosmos-sdk 0.46 */ export interface Bech32PrefixRequest {} -export interface ReactiveBech32PrefixRequest {} export interface Bech32PrefixRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest"; value: Uint8Array; @@ -272,9 +243,6 @@ export interface Bech32PrefixRequestAminoMsg { export interface Bech32PrefixResponse { bech32Prefix: string; } -export interface ReactiveBech32PrefixResponse { - bech32Prefix: ComputedRef; -} export interface Bech32PrefixResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse"; value: Uint8Array; @@ -299,9 +267,6 @@ export interface Bech32PrefixResponseAminoMsg { export interface AddressBytesToStringRequest { addressBytes: Uint8Array; } -export interface ReactiveAddressBytesToStringRequest { - addressBytes: ComputedRef; -} export interface AddressBytesToStringRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest"; value: Uint8Array; @@ -326,9 +291,6 @@ export interface AddressBytesToStringRequestAminoMsg { export interface AddressBytesToStringResponse { addressString: string; } -export interface ReactiveAddressBytesToStringResponse { - addressString: ComputedRef; -} export interface AddressBytesToStringResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse"; value: Uint8Array; @@ -353,9 +315,6 @@ export interface AddressBytesToStringResponseAminoMsg { export interface AddressStringToBytesRequest { addressString: string; } -export interface ReactiveAddressStringToBytesRequest { - addressString: ComputedRef; -} export interface AddressStringToBytesRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest"; value: Uint8Array; @@ -380,9 +339,6 @@ export interface AddressStringToBytesRequestAminoMsg { export interface AddressStringToBytesResponse { addressBytes: Uint8Array; } -export interface ReactiveAddressStringToBytesResponse { - addressBytes: ComputedRef; -} export interface AddressStringToBytesResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse"; value: Uint8Array; @@ -421,10 +377,6 @@ export interface QueryAccountAddressByIDRequest { */ accountId: bigint; } -export interface ReactiveQueryAccountAddressByIDRequest { - id: ComputedRef; - accountId: ComputedRef; -} export interface QueryAccountAddressByIDRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest"; value: Uint8Array; @@ -463,9 +415,6 @@ export interface QueryAccountAddressByIDRequestAminoMsg { export interface QueryAccountAddressByIDResponse { accountAddress: string; } -export interface ReactiveQueryAccountAddressByIDResponse { - accountAddress: ComputedRef; -} export interface QueryAccountAddressByIDResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse"; value: Uint8Array; @@ -491,9 +440,6 @@ export interface QueryAccountInfoRequest { /** address is the account address string. */ address: string; } -export interface ReactiveQueryAccountInfoRequest { - address: ComputedRef; -} export interface QueryAccountInfoRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest"; value: Uint8Array; @@ -520,9 +466,6 @@ export interface QueryAccountInfoResponse { /** info is the account info which is represented by BaseAccount. */ info?: BaseAccount; } -export interface ReactiveQueryAccountInfoResponse { - info?: ComputedRef; -} export interface QueryAccountInfoResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/authz/v1beta1/authz.ts b/libs/injective-vue/src/cosmos/authz/v1beta1/authz.ts index 3373cb76..e71c3fee 100644 --- a/libs/injective-vue/src/cosmos/authz/v1beta1/authz.ts +++ b/libs/injective-vue/src/cosmos/authz/v1beta1/authz.ts @@ -3,7 +3,6 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * GenericAuthorization gives the grantee unrestricted permissions to execute * the provided method on behalf of the granter's account. @@ -12,9 +11,6 @@ export interface GenericAuthorization { /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ msg: string; } -export interface ReactiveGenericAuthorization { - msg: ComputedRef; -} export interface GenericAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization"; value: Uint8Array; @@ -44,10 +40,6 @@ export interface Grant { */ expiration?: Date; } -export interface ReactiveGrant { - authorization?: ComputedRef; - expiration?: ComputedRef; -} export interface GrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.Grant"; value: Uint8Array; @@ -82,12 +74,6 @@ export interface GrantAuthorization { authorization?: GenericAuthorization | Any | undefined; expiration?: Date; } -export interface ReactiveGrantAuthorization { - granter: ComputedRef; - grantee: ComputedRef; - authorization?: ComputedRef; - expiration?: ComputedRef; -} export interface GrantAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; value: Uint8Array; @@ -114,9 +100,6 @@ export interface GrantQueueItem { /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ msgTypeUrls: string[]; } -export interface ReactiveGrantQueueItem { - msgTypeUrls: ComputedRef; -} export interface GrantQueueItemProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.amino.ts b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.amino.ts deleted file mode 100644 index 6fcf9fd4..00000000 --- a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; -export const AminoConverter = { - "/cosmos.authz.v1beta1.MsgGrant": { - aminoType: "cosmos-sdk/MsgGrant", - toAmino: MsgGrant.toAmino, - fromAmino: MsgGrant.fromAmino - }, - "/cosmos.authz.v1beta1.MsgExec": { - aminoType: "cosmos-sdk/MsgExec", - toAmino: MsgExec.toAmino, - fromAmino: MsgExec.fromAmino - }, - "/cosmos.authz.v1beta1.MsgRevoke": { - aminoType: "cosmos-sdk/MsgRevoke", - toAmino: MsgRevoke.toAmino, - fromAmino: MsgRevoke.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..18006a6c --- /dev/null +++ b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrant.typeUrl, + encoders: toEncoders(MsgGrant), + converters: toConverters(MsgGrant) +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const createRevoke = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevoke.typeUrl, + encoders: toEncoders(MsgRevoke), + converters: toConverters(MsgRevoke) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index e690d4f6..00000000 --- a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgGrant, MsgGrantResponse, MsgExec, MsgExecResponse, MsgRevoke, MsgRevokeResponse } from "./tx"; -/** Msg defines the authz Msg service. */ -export interface Msg { - /** - * Grant grants the provided authorization to the grantee on the granter's - * account with the provided expiration time. If there is already a grant - * for the given (granter, grantee, Authorization) triple, then the grant - * will be overwritten. - */ - grant(request: MsgGrant): Promise; - /** - * Exec attempts to execute the provided messages using - * authorizations granted to the grantee. Each message should have only - * one signer corresponding to the granter of the authorization. - */ - exec(request: MsgExec): Promise; - /** - * Revoke revokes any authorization corresponding to the provided method name on the - * granter's account that has been granted to the grantee. - */ - revoke(request: MsgRevoke): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Grant grants the provided authorization to the grantee on the granter's - account with the provided expiration time. If there is already a grant - for the given (granter, grantee, Authorization) triple, then the grant - will be overwritten. */ - grant = async (request: MsgGrant): Promise => { - const data = MsgGrant.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Grant", data); - return promise.then(data => MsgGrantResponse.decode(new BinaryReader(data))); - }; - /* Exec attempts to execute the provided messages using - authorizations granted to the grantee. Each message should have only - one signer corresponding to the granter of the authorization. */ - exec = async (request: MsgExec): Promise => { - const data = MsgExec.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Exec", data); - return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); - }; - /* Revoke revokes any authorization corresponding to the provided method name on the - granter's account that has been granted to the grantee. */ - revoke = async (request: MsgRevoke): Promise => { - const data = MsgRevoke.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data); - return promise.then(data => MsgRevokeResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..214f14b1 --- /dev/null +++ b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,12 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +export const useGrant = buildUseVueMutation({ + builderMutationFn: createGrant +}); +export const useExec = buildUseVueMutation({ + builderMutationFn: createExec +}); +export const useRevoke = buildUseVueMutation({ + builderMutationFn: createRevoke +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.ts index 375f7350..96acd25e 100644 --- a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. @@ -13,11 +12,6 @@ export interface MsgGrant { grantee: string; grant: Grant; } -export interface ReactiveMsgGrant { - granter: ComputedRef; - grantee: ComputedRef; - grant: ComputedRef; -} export interface MsgGrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgGrant"; value: Uint8Array; @@ -37,7 +31,6 @@ export interface MsgGrantAminoMsg { } /** MsgGrantResponse defines the Msg/MsgGrant response type. */ export interface MsgGrantResponse {} -export interface ReactiveMsgGrantResponse {} export interface MsgGrantResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; value: Uint8Array; @@ -62,10 +55,6 @@ export interface MsgExec { */ msgs: (Any)[] | Any[]; } -export interface ReactiveMsgExec { - grantee: ComputedRef; - msgs: ComputedRef<(Any)[] | Any[]>; -} export interface MsgExecProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgExec"; value: Uint8Array; @@ -100,9 +89,6 @@ export interface MsgExecAminoMsg { export interface MsgExecResponse { results: Uint8Array[]; } -export interface ReactiveMsgExecResponse { - results: ComputedRef; -} export interface MsgExecResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; value: Uint8Array; @@ -124,11 +110,6 @@ export interface MsgRevoke { grantee: string; msgTypeUrl: string; } -export interface ReactiveMsgRevoke { - granter: ComputedRef; - grantee: ComputedRef; - msgTypeUrl: ComputedRef; -} export interface MsgRevokeProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke"; value: Uint8Array; @@ -148,7 +129,6 @@ export interface MsgRevokeAminoMsg { } /** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ export interface MsgRevokeResponse {} -export interface ReactiveMsgRevokeResponse {} export interface MsgRevokeResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/bank.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/bank.ts index 70e96f40..2c115ba3 100644 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/bank.ts +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/bank.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Params defines the parameters for the bank module. */ export interface Params { /** @@ -16,10 +15,6 @@ export interface Params { sendEnabled: SendEnabled[]; defaultSendEnabled: boolean; } -export interface ReactiveParams { - sendEnabled: ComputedRef; - defaultSendEnabled: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Params"; value: Uint8Array; @@ -49,10 +44,6 @@ export interface SendEnabled { denom: string; enabled: boolean; } -export interface ReactiveSendEnabled { - denom: ComputedRef; - enabled: ComputedRef; -} export interface SendEnabledProtoMsg { typeUrl: "/cosmos.bank.v1beta1.SendEnabled"; value: Uint8Array; @@ -74,10 +65,6 @@ export interface Input { address: string; coins: Coin[]; } -export interface ReactiveInput { - address: ComputedRef; - coins: ComputedRef; -} export interface InputProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Input"; value: Uint8Array; @@ -96,10 +83,6 @@ export interface Output { address: string; coins: Coin[]; } -export interface ReactiveOutput { - address: ComputedRef; - coins: ComputedRef; -} export interface OutputProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Output"; value: Uint8Array; @@ -122,9 +105,6 @@ export interface OutputAminoMsg { export interface Supply { total: Coin[]; } -export interface ReactiveSupply { - total: ComputedRef; -} export interface SupplyProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Supply"; value: Uint8Array; @@ -160,11 +140,6 @@ export interface DenomUnit { /** aliases is a list of string aliases for the given denom */ aliases: string[]; } -export interface ReactiveDenomUnit { - denom: ComputedRef; - exponent: ComputedRef; - aliases: ComputedRef; -} export interface DenomUnitProtoMsg { typeUrl: "/cosmos.bank.v1beta1.DenomUnit"; value: Uint8Array; @@ -233,16 +208,6 @@ export interface Metadata { */ uriHash: string; } -export interface ReactiveMetadata { - description: ComputedRef; - denomUnits: ComputedRef; - base: ComputedRef; - display: ComputedRef; - name: ComputedRef; - symbol: ComputedRef; - uri: ComputedRef; - uriHash: ComputedRef; -} export interface MetadataProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Metadata"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts deleted file mode 100644 index ff16a80c..00000000 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,720 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse, ReactiveQueryBalanceRequest, ReactiveQueryAllBalancesRequest, ReactiveQuerySpendableBalancesRequest, ReactiveQuerySpendableBalanceByDenomRequest, ReactiveQueryTotalSupplyRequest, ReactiveQuerySupplyOfRequest, ReactiveQueryParamsRequest, ReactiveQueryDenomMetadataRequest, ReactiveQueryDenomMetadataByQueryStringRequest, ReactiveQueryDenomsMetadataRequest, ReactiveQueryDenomOwnersRequest, ReactiveQueryDenomOwnersByQueryRequest, ReactiveQuerySendEnabledRequest } from "./query"; -/** Query defines the gRPC querier service. */ -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. - * - * 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. - */ - supplyOf(request: QuerySupplyOfRequest): Promise; - /** Params queries the parameters of x/bank module. */ - params(request?: QueryParamsRequest): Promise; - /** DenomMetadata queries the client metadata of a given coin denomination. */ - denomMetadata(request: QueryDenomMetadataRequest): Promise; - /** DenomMetadataByQueryString queries the client metadata of a given coin denomination. */ - denomMetadataByQueryString(request: QueryDenomMetadataByQueryStringRequest): 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; - /** - * DenomOwnersByQuery queries for all account addresses that own a particular token - * denomination. - * - * Since: cosmos-sdk 0.50.3 - */ - denomOwnersByQuery(request: QueryDenomOwnersByQueryRequest): 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Balance queries the balance of a single coin for a single account. */ - balance = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (request: QueryTotalSupplyRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* 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. */ - supplyOf = async (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 BinaryReader(data))); - }; - /* Params queries the parameters of x/bank module. */ - params = async (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 BinaryReader(data))); - }; - /* DenomMetadata queries the client metadata of a given coin denomination. */ - denomMetadata = async (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 BinaryReader(data))); - }; - /* DenomMetadataByQueryString queries the client metadata of a given coin denomination. */ - denomMetadataByQueryString = async (request: QueryDenomMetadataByQueryStringRequest): Promise => { - const data = QueryDenomMetadataByQueryStringRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadataByQueryString", data); - return promise.then(data => QueryDenomMetadataByQueryStringResponse.decode(new BinaryReader(data))); - }; - /* DenomsMetadata queries the client metadata for all registered coin - denominations. */ - denomsMetadata = async (request: QueryDenomsMetadataRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* DenomOwnersByQuery queries for all account addresses that own a particular token - denomination. - - Since: cosmos-sdk 0.50.3 */ - denomOwnersByQuery = async (request: QueryDenomOwnersByQueryRequest): Promise => { - const data = QueryDenomOwnersByQueryRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwnersByQuery", data); - return promise.then(data => QueryDenomOwnersByQueryResponse.decode(new BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - balance(request: QueryBalanceRequest): Promise { - return queryService.balance(request); - }, - allBalances(request: QueryAllBalancesRequest): Promise { - return queryService.allBalances(request); - }, - spendableBalances(request: QuerySpendableBalancesRequest): Promise { - return queryService.spendableBalances(request); - }, - spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { - return queryService.spendableBalanceByDenom(request); - }, - totalSupply(request?: QueryTotalSupplyRequest): Promise { - return queryService.totalSupply(request); - }, - supplyOf(request: QuerySupplyOfRequest): Promise { - return queryService.supplyOf(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - denomMetadata(request: QueryDenomMetadataRequest): Promise { - return queryService.denomMetadata(request); - }, - denomMetadataByQueryString(request: QueryDenomMetadataByQueryStringRequest): Promise { - return queryService.denomMetadataByQueryString(request); - }, - denomsMetadata(request?: QueryDenomsMetadataRequest): Promise { - return queryService.denomsMetadata(request); - }, - denomOwners(request: QueryDenomOwnersRequest): Promise { - return queryService.denomOwners(request); - }, - denomOwnersByQuery(request: QueryDenomOwnersByQueryRequest): Promise { - return queryService.denomOwnersByQuery(request); - }, - sendEnabled(request: QuerySendEnabledRequest): Promise { - return queryService.sendEnabled(request); - } - }; -}; -export interface UseBalanceQuery extends VueQueryParams { - request: ReactiveQueryBalanceRequest; -} -export interface UseAllBalancesQuery extends VueQueryParams { - request: ReactiveQueryAllBalancesRequest; -} -export interface UseSpendableBalancesQuery extends VueQueryParams { - request: ReactiveQuerySpendableBalancesRequest; -} -export interface UseSpendableBalanceByDenomQuery extends VueQueryParams { - request: ReactiveQuerySpendableBalanceByDenomRequest; -} -export interface UseTotalSupplyQuery extends VueQueryParams { - request?: ReactiveQueryTotalSupplyRequest; -} -export interface UseSupplyOfQuery extends VueQueryParams { - request: ReactiveQuerySupplyOfRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseDenomMetadataQuery extends VueQueryParams { - request: ReactiveQueryDenomMetadataRequest; -} -export interface UseDenomMetadataByQueryStringQuery extends VueQueryParams { - request: ReactiveQueryDenomMetadataByQueryStringRequest; -} -export interface UseDenomsMetadataQuery extends VueQueryParams { - request?: ReactiveQueryDenomsMetadataRequest; -} -export interface UseDenomOwnersQuery extends VueQueryParams { - request: ReactiveQueryDenomOwnersRequest; -} -export interface UseDenomOwnersByQueryQuery extends VueQueryParams { - request: ReactiveQueryDenomOwnersByQueryRequest; -} -export interface UseSendEnabledQuery extends VueQueryParams { - request: ReactiveQuerySendEnabledRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useBalance = ({ - request, - options - }: UseBalanceQuery) => { - const queryKey = ["balanceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.balance(params); - }, - ...options - }); - }; - const useAllBalances = ({ - request, - options - }: UseAllBalancesQuery) => { - const queryKey = ["allBalancesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allBalances(params); - }, - ...options - }); - }; - const useSpendableBalances = ({ - request, - options - }: UseSpendableBalancesQuery) => { - const queryKey = ["spendableBalancesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spendableBalances(params); - }, - ...options - }); - }; - const useSpendableBalanceByDenom = ({ - request, - options - }: UseSpendableBalanceByDenomQuery) => { - const queryKey = ["spendableBalanceByDenomQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spendableBalanceByDenom(params); - }, - ...options - }); - }; - const useTotalSupply = ({ - request, - options - }: UseTotalSupplyQuery) => { - const queryKey = ["totalSupplyQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.totalSupply(params); - }, - ...options - }); - }; - const useSupplyOf = ({ - request, - options - }: UseSupplyOfQuery) => { - const queryKey = ["supplyOfQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.supplyOf(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useDenomMetadata = ({ - request, - options - }: UseDenomMetadataQuery) => { - const queryKey = ["denomMetadataQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomMetadata(params); - }, - ...options - }); - }; - const useDenomMetadataByQueryString = ({ - request, - options - }: UseDenomMetadataByQueryStringQuery) => { - const queryKey = ["denomMetadataByQueryStringQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomMetadataByQueryString(params); - }, - ...options - }); - }; - const useDenomsMetadata = ({ - request, - options - }: UseDenomsMetadataQuery) => { - const queryKey = ["denomsMetadataQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomsMetadata(params); - }, - ...options - }); - }; - const useDenomOwners = ({ - request, - options - }: UseDenomOwnersQuery) => { - const queryKey = ["denomOwnersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomOwners(params); - }, - ...options - }); - }; - const useDenomOwnersByQuery = ({ - request, - options - }: UseDenomOwnersByQueryQuery) => { - const queryKey = ["denomOwnersByQueryQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomOwnersByQuery(params); - }, - ...options - }); - }; - const useSendEnabled = ({ - request, - options - }: UseSendEnabledQuery) => { - const queryKey = ["sendEnabledQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.sendEnabled(params); - }, - ...options - }); - }; - return { - /** Balance queries the balance of a single coin for a single account. */useBalance, - /** - * 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. - */ - useAllBalances, - /** - * 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 - */ - useSpendableBalances, - /** - * 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 - */ - useSpendableBalanceByDenom, - /** - * 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. - */ - useTotalSupply, - /** - * 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. - */ - useSupplyOf, - /** Params queries the parameters of x/bank module. */useParams, - /** DenomMetadata queries the client metadata of a given coin denomination. */useDenomMetadata, - /** DenomMetadataByQueryString queries the client metadata of a given coin denomination. */useDenomMetadataByQueryString, - /** - * DenomsMetadata queries the client metadata for all registered coin - * denominations. - */ - useDenomsMetadata, - /** - * 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 - */ - useDenomOwners, - /** - * DenomOwnersByQuery queries for all account addresses that own a particular token - * denomination. - * - * Since: cosmos-sdk 0.50.3 - */ - useDenomOwnersByQuery, - /** - * 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 - */ - useSendEnabled - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..dc21baf8 --- /dev/null +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts @@ -0,0 +1,93 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; +export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceRequest.encode, + decode: QueryBalanceResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Balance", + clientResolver +}); +export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllBalancesRequest.encode, + decode: QueryAllBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "AllBalances", + clientResolver +}); +export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalancesRequest.encode, + decode: QuerySpendableBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalances", + clientResolver +}); +export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalanceByDenomRequest.encode, + decode: QuerySpendableBalanceByDenomResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalanceByDenom", + clientResolver +}); +export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTotalSupplyRequest.encode, + decode: QueryTotalSupplyResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "TotalSupply", + clientResolver +}); +export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySupplyOfRequest.encode, + decode: QuerySupplyOfResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SupplyOf", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataRequest.encode, + decode: QueryDenomMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadata", + clientResolver +}); +export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataByQueryStringRequest.encode, + decode: QueryDenomMetadataByQueryStringResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadataByQueryString", + clientResolver +}); +export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomsMetadataRequest.encode, + decode: QueryDenomsMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomsMetadata", + clientResolver +}); +export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersRequest.encode, + decode: QueryDenomOwnersResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwners", + clientResolver +}); +export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersByQueryRequest.encode, + decode: QueryDenomOwnersByQueryResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwnersByQuery", + clientResolver +}); +export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySendEnabledRequest.encode, + decode: QuerySendEnabledResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SendEnabled", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..fb0e2f44 --- /dev/null +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts @@ -0,0 +1,55 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +export const useGetBalance = buildUseVueQuery({ + builderQueryFn: createGetBalance, + queryKeyPrefix: "BalanceQuery" +}); +export const useGetAllBalances = buildUseVueQuery({ + builderQueryFn: createGetAllBalances, + queryKeyPrefix: "AllBalancesQuery" +}); +export const useGetSpendableBalances = buildUseVueQuery({ + builderQueryFn: createGetSpendableBalances, + queryKeyPrefix: "SpendableBalancesQuery" +}); +export const useGetSpendableBalanceByDenom = buildUseVueQuery({ + builderQueryFn: createGetSpendableBalanceByDenom, + queryKeyPrefix: "SpendableBalanceByDenomQuery" +}); +export const useGetTotalSupply = buildUseVueQuery({ + builderQueryFn: createGetTotalSupply, + queryKeyPrefix: "TotalSupplyQuery" +}); +export const useGetSupplyOf = buildUseVueQuery({ + builderQueryFn: createGetSupplyOf, + queryKeyPrefix: "SupplyOfQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDenomMetadata = buildUseVueQuery({ + builderQueryFn: createGetDenomMetadata, + queryKeyPrefix: "DenomMetadataQuery" +}); +export const useGetDenomMetadataByQueryString = buildUseVueQuery({ + builderQueryFn: createGetDenomMetadataByQueryString, + queryKeyPrefix: "DenomMetadataByQueryStringQuery" +}); +export const useGetDenomsMetadata = buildUseVueQuery({ + builderQueryFn: createGetDenomsMetadata, + queryKeyPrefix: "DenomsMetadataQuery" +}); +export const useGetDenomOwners = buildUseVueQuery({ + builderQueryFn: createGetDenomOwners, + queryKeyPrefix: "DenomOwnersQuery" +}); +export const useGetDenomOwnersByQuery = buildUseVueQuery({ + builderQueryFn: createGetDenomOwnersByQuery, + queryKeyPrefix: "DenomOwnersByQueryQuery" +}); +export const useGetSendEnabled = buildUseVueQuery({ + builderQueryFn: createGetSendEnabled, + queryKeyPrefix: "SendEnabledQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/query.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/query.ts index 5253c83a..45f3fa82 100644 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/query.ts +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/query.ts @@ -4,7 +4,6 @@ import { Params, ParamsAmino, Metadata, MetadataAmino, SendEnabled, SendEnabledA import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { /** address is the address to query balances for. */ @@ -12,10 +11,6 @@ export interface QueryBalanceRequest { /** denom is the coin denom to query balances for. */ denom: string; } -export interface ReactiveQueryBalanceRequest { - address: ComputedRef; - denom: ComputedRef; -} export interface QueryBalanceRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest"; value: Uint8Array; @@ -36,9 +31,6 @@ export interface QueryBalanceResponse { /** balance is the balance of the coin. */ balance?: Coin; } -export interface ReactiveQueryBalanceResponse { - balance?: ComputedRef; -} export interface QueryBalanceResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; value: Uint8Array; @@ -65,11 +57,6 @@ export interface QueryAllBalancesRequest { */ resolveDenom: boolean; } -export interface ReactiveQueryAllBalancesRequest { - address: ComputedRef; - pagination?: ComputedRef; - resolveDenom: ComputedRef; -} export interface QueryAllBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest"; value: Uint8Array; @@ -101,10 +88,6 @@ export interface QueryAllBalancesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAllBalancesResponse { - balances: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; value: Uint8Array; @@ -135,10 +118,6 @@ export interface QuerySpendableBalancesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQuerySpendableBalancesRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySpendableBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; value: Uint8Array; @@ -171,10 +150,6 @@ export interface QuerySpendableBalancesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQuerySpendableBalancesResponse { - balances: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySpendableBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; value: Uint8Array; @@ -207,10 +182,6 @@ export interface QuerySpendableBalanceByDenomRequest { /** denom is the coin denom to query balances for. */ denom: string; } -export interface ReactiveQuerySpendableBalanceByDenomRequest { - address: ComputedRef; - denom: ComputedRef; -} export interface QuerySpendableBalanceByDenomRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest"; value: Uint8Array; @@ -241,9 +212,6 @@ export interface QuerySpendableBalanceByDenomResponse { /** balance is the balance of the coin. */ balance?: Coin; } -export interface ReactiveQuerySpendableBalanceByDenomResponse { - balance?: ComputedRef; -} export interface QuerySpendableBalanceByDenomResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse"; value: Uint8Array; @@ -274,9 +242,6 @@ export interface QueryTotalSupplyRequest { */ pagination?: PageRequest; } -export interface ReactiveQueryTotalSupplyRequest { - pagination?: ComputedRef; -} export interface QueryTotalSupplyRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; value: Uint8Array; @@ -311,10 +276,6 @@ export interface QueryTotalSupplyResponse { */ pagination?: PageResponse; } -export interface ReactiveQueryTotalSupplyResponse { - supply: ComputedRef; - pagination?: ComputedRef; -} export interface QueryTotalSupplyResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; value: Uint8Array; @@ -342,9 +303,6 @@ export interface QuerySupplyOfRequest { /** denom is the coin denom to query balances for. */ denom: string; } -export interface ReactiveQuerySupplyOfRequest { - denom: ComputedRef; -} export interface QuerySupplyOfRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest"; value: Uint8Array; @@ -363,9 +321,6 @@ export interface QuerySupplyOfResponse { /** amount is the supply of the coin. */ amount: Coin; } -export interface ReactiveQuerySupplyOfResponse { - amount: ComputedRef; -} export interface QuerySupplyOfResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse"; value: Uint8Array; @@ -381,7 +336,6 @@ export interface QuerySupplyOfResponseAminoMsg { } /** QueryParamsRequest defines the request type for querying x/bank parameters. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -397,9 +351,6 @@ export interface QueryParamsResponse { /** params provides the parameters of the bank module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -418,9 +369,6 @@ export interface QueryDenomsMetadataRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDenomsMetadataRequest { - pagination?: ComputedRef; -} export interface QueryDenomsMetadataRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; value: Uint8Array; @@ -444,10 +392,6 @@ export interface QueryDenomsMetadataResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDenomsMetadataResponse { - metadatas: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomsMetadataResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; value: Uint8Array; @@ -471,9 +415,6 @@ export interface QueryDenomMetadataRequest { /** denom is the coin denom to query the metadata for. */ denom: string; } -export interface ReactiveQueryDenomMetadataRequest { - denom: ComputedRef; -} export interface QueryDenomMetadataRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest"; value: Uint8Array; @@ -495,9 +436,6 @@ export interface QueryDenomMetadataResponse { /** metadata describes and provides all the client information for the requested token. */ metadata: Metadata; } -export interface ReactiveQueryDenomMetadataResponse { - metadata: ComputedRef; -} export interface QueryDenomMetadataResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse"; value: Uint8Array; @@ -522,9 +460,6 @@ export interface QueryDenomMetadataByQueryStringRequest { /** denom is the coin denom to query the metadata for. */ denom: string; } -export interface ReactiveQueryDenomMetadataByQueryStringRequest { - denom: ComputedRef; -} export interface QueryDenomMetadataByQueryStringRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest"; value: Uint8Array; @@ -549,9 +484,6 @@ export interface QueryDenomMetadataByQueryStringResponse { /** metadata describes and provides all the client information for the requested token. */ metadata: Metadata; } -export interface ReactiveQueryDenomMetadataByQueryStringResponse { - metadata: ComputedRef; -} export interface QueryDenomMetadataByQueryStringResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse"; value: Uint8Array; @@ -579,10 +511,6 @@ export interface QueryDenomOwnersRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDenomOwnersRequest { - denom: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest"; value: Uint8Array; @@ -615,10 +543,6 @@ export interface DenomOwner { /** balance is the balance of the denominated coin for an account. */ balance: Coin; } -export interface ReactiveDenomOwner { - address: ComputedRef; - balance: ComputedRef; -} export interface DenomOwnerProtoMsg { typeUrl: "/cosmos.bank.v1beta1.DenomOwner"; value: Uint8Array; @@ -650,10 +574,6 @@ export interface QueryDenomOwnersResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDenomOwnersResponse { - denomOwners: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse"; value: Uint8Array; @@ -685,10 +605,6 @@ export interface QueryDenomOwnersByQueryRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDenomOwnersByQueryRequest { - denom: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersByQueryRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest"; value: Uint8Array; @@ -720,10 +636,6 @@ export interface QueryDenomOwnersByQueryResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDenomOwnersByQueryResponse { - denomOwners: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersByQueryResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse"; value: Uint8Array; @@ -756,10 +668,6 @@ export interface QuerySendEnabledRequest { */ pagination?: PageRequest; } -export interface ReactiveQuerySendEnabledRequest { - denoms: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySendEnabledRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest"; value: Uint8Array; @@ -795,10 +703,6 @@ export interface QuerySendEnabledResponse { */ pagination?: PageResponse; } -export interface ReactiveQuerySendEnabledResponse { - sendEnabled: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySendEnabledResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.amino.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.amino.ts deleted file mode 100644 index f146051f..00000000 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.amino.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; -export const AminoConverter = { - "/cosmos.bank.v1beta1.MsgSend": { - aminoType: "cosmos-sdk/MsgSend", - toAmino: MsgSend.toAmino, - fromAmino: MsgSend.fromAmino - }, - "/cosmos.bank.v1beta1.MsgMultiSend": { - aminoType: "cosmos-sdk/MsgMultiSend", - toAmino: MsgMultiSend.toAmino, - fromAmino: MsgMultiSend.fromAmino - }, - "/cosmos.bank.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmos.bank.v1beta1.MsgSetSendEnabled": { - aminoType: "cosmos-sdk/MsgSetSendEnabled", - toAmino: MsgSetSendEnabled.toAmino, - fromAmino: MsgSetSendEnabled.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..fa81e316 --- /dev/null +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSend.typeUrl, + encoders: toEncoders(MsgSend), + converters: toConverters(MsgSend) +}); +export const createMultiSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMultiSend.typeUrl, + encoders: toEncoders(MsgMultiSend), + converters: toConverters(MsgMultiSend) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createSetSendEnabled = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetSendEnabled.typeUrl, + encoders: toEncoders(MsgSetSendEnabled), + converters: toConverters(MsgSetSendEnabled) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 46f85b3d..00000000 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSetSendEnabled, MsgSetSendEnabledResponse } from "./tx"; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** Send defines a method for sending coins from one account to another account. */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Send defines a method for sending coins from one account to another account. */ - send = async (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 BinaryReader(data))); - }; - /* MultiSend defines a method for sending coins from some accounts to other accounts. */ - multiSend = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..654e3c48 --- /dev/null +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +export const useSend = buildUseVueMutation({ + builderMutationFn: createSend +}); +export const useMultiSend = buildUseVueMutation({ + builderMutationFn: createMultiSend +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useSetSendEnabled = buildUseVueMutation({ + builderMutationFn: createSetSendEnabled +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.ts index dd89a158..afc67365 100644 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.ts @@ -3,18 +3,12 @@ import { Input, InputAmino, Output, OutputAmino, Params, ParamsAmino, SendEnable import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { fromAddress: string; toAddress: string; amount: Coin[]; } -export interface ReactiveMsgSend { - fromAddress: ComputedRef; - toAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgSendProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSend"; value: Uint8Array; @@ -31,7 +25,6 @@ export interface MsgSendAminoMsg { } /** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponse {} -export interface ReactiveMsgSendResponse {} export interface MsgSendResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse"; value: Uint8Array; @@ -51,10 +44,6 @@ export interface MsgMultiSend { inputs: Input[]; outputs: Output[]; } -export interface ReactiveMsgMultiSend { - inputs: ComputedRef; - outputs: ComputedRef; -} export interface MsgMultiSendProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend"; value: Uint8Array; @@ -74,7 +63,6 @@ export interface MsgMultiSendAminoMsg { } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ export interface MsgMultiSendResponse {} -export interface ReactiveMsgMultiSendResponse {} export interface MsgMultiSendResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse"; value: Uint8Array; @@ -100,10 +88,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -134,7 +118,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -172,11 +155,6 @@ export interface MsgSetSendEnabled { */ useDefaultFor: string[]; } -export interface ReactiveMsgSetSendEnabled { - authority: ComputedRef; - sendEnabled: ComputedRef; - useDefaultFor: ComputedRef; -} export interface MsgSetSendEnabledProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled"; value: Uint8Array; @@ -213,7 +191,6 @@ export interface MsgSetSendEnabledAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgSetSendEnabledResponse {} -export interface ReactiveMsgSetSendEnabledResponse {} export interface MsgSetSendEnabledResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/base/abci/v1beta1/abci.ts b/libs/injective-vue/src/cosmos/base/abci/v1beta1/abci.ts index 4477c71f..2a000dfb 100644 --- a/libs/injective-vue/src/cosmos/base/abci/v1beta1/abci.ts +++ b/libs/injective-vue/src/cosmos/base/abci/v1beta1/abci.ts @@ -4,7 +4,6 @@ import { Block, BlockAmino } from "../../../../tendermint/types/block"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * TxResponse defines a structure containing relevant tx data and metadata. The * tags are stringified and the log is JSON decoded. @@ -51,21 +50,6 @@ export interface TxResponse { */ events: Event[]; } -export interface ReactiveTxResponse { - height: ComputedRef; - txhash: ComputedRef; - codespace: ComputedRef; - code: ComputedRef; - data: ComputedRef; - rawLog: ComputedRef; - logs: ComputedRef; - info: ComputedRef; - gasWanted: ComputedRef; - gasUsed: ComputedRef; - tx?: ComputedRef; - timestamp: ComputedRef; - events: ComputedRef; -} export interface TxResponseProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.TxResponse"; value: Uint8Array; @@ -130,11 +114,6 @@ export interface ABCIMessageLog { */ events: StringEvent[]; } -export interface ReactiveABCIMessageLog { - msgIndex: ComputedRef; - log: ComputedRef; - events: ComputedRef; -} export interface ABCIMessageLogProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog"; value: Uint8Array; @@ -161,10 +140,6 @@ export interface StringEvent { type: string; attributes: Attribute[]; } -export interface ReactiveStringEvent { - type: ComputedRef; - attributes: ComputedRef; -} export interface StringEventProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.StringEvent"; value: Uint8Array; @@ -189,10 +164,6 @@ export interface Attribute { key: string; value: string; } -export interface ReactiveAttribute { - key: ComputedRef; - value: ComputedRef; -} export interface AttributeProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.Attribute"; value: Uint8Array; @@ -216,10 +187,6 @@ export interface GasInfo { /** GasUsed is the amount of gas actually consumed. */ gasUsed: bigint; } -export interface ReactiveGasInfo { - gasWanted: ComputedRef; - gasUsed: ComputedRef; -} export interface GasInfoProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.GasInfo"; value: Uint8Array; @@ -259,12 +226,6 @@ export interface Result { */ msgResponses: Any[]; } -export interface ReactiveResult { - data: ComputedRef; - log: ComputedRef; - events: ComputedRef; - msgResponses: ComputedRef; -} export interface ResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.Result"; value: Uint8Array; @@ -305,10 +266,6 @@ export interface SimulationResponse { gasInfo: GasInfo; result?: Result; } -export interface ReactiveSimulationResponse { - gasInfo: ComputedRef; - result?: ComputedRef; -} export interface SimulationResponseProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; value: Uint8Array; @@ -334,10 +291,6 @@ export interface MsgData { msgType: string; data: Uint8Array; } -export interface ReactiveMsgData { - msgType: ComputedRef; - data: ComputedRef; -} export interface MsgDataProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.MsgData"; value: Uint8Array; @@ -370,10 +323,6 @@ export interface TxMsgData { */ msgResponses: Any[]; } -export interface ReactiveTxMsgData { - data: ComputedRef; - msgResponses: ComputedRef; -} export interface TxMsgDataProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData"; value: Uint8Array; @@ -412,14 +361,6 @@ export interface SearchTxsResult { /** List of txs in current page */ txs: TxResponse[]; } -export interface ReactiveSearchTxsResult { - totalCount: ComputedRef; - count: ComputedRef; - pageNumber: ComputedRef; - pageTotal: ComputedRef; - limit: ComputedRef; - txs: ComputedRef; -} export interface SearchTxsResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult"; value: Uint8Array; @@ -458,14 +399,6 @@ export interface SearchBlocksResult { /** List of blocks in current page */ blocks: Block[]; } -export interface ReactiveSearchBlocksResult { - totalCount: ComputedRef; - count: ComputedRef; - pageNumber: ComputedRef; - pageTotal: ComputedRef; - limit: ComputedRef; - blocks: ComputedRef; -} export interface SearchBlocksResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SearchBlocksResult"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/base/query/v1beta1/pagination.ts b/libs/injective-vue/src/cosmos/base/query/v1beta1/pagination.ts index 4d084237..35272ec2 100644 --- a/libs/injective-vue/src/cosmos/base/query/v1beta1/pagination.ts +++ b/libs/injective-vue/src/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * PageRequest is to be embedded in gRPC request messages for efficient * pagination. Ex: @@ -43,13 +42,6 @@ export interface PageRequest { */ reverse: boolean; } -export interface ReactivePageRequest { - key: ComputedRef; - offset: ComputedRef; - limit: ComputedRef; - countTotal: ComputedRef; - reverse: ComputedRef; -} export interface PageRequestProtoMsg { typeUrl: "/cosmos.base.query.v1beta1.PageRequest"; value: Uint8Array; @@ -121,10 +113,6 @@ export interface PageResponse { */ total: bigint; } -export interface ReactivePageResponse { - nextKey: ComputedRef; - total: ComputedRef; -} export interface PageResponseProtoMsg { typeUrl: "/cosmos.base.query.v1beta1.PageResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/base/v1beta1/coin.ts b/libs/injective-vue/src/cosmos/base/v1beta1/coin.ts index 7405d5a9..155e8009 100644 --- a/libs/injective-vue/src/cosmos/base/v1beta1/coin.ts +++ b/libs/injective-vue/src/cosmos/base/v1beta1/coin.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * Coin defines a token with a denomination and an amount. * @@ -12,10 +11,6 @@ export interface Coin { denom: string; amount: string; } -export interface ReactiveCoin { - denom: ComputedRef; - amount: ComputedRef; -} export interface CoinProtoMsg { typeUrl: "/cosmos.base.v1beta1.Coin"; value: Uint8Array; @@ -44,10 +39,6 @@ export interface DecCoin { denom: string; amount: string; } -export interface ReactiveDecCoin { - denom: ComputedRef; - amount: ComputedRef; -} export interface DecCoinProtoMsg { typeUrl: "/cosmos.base.v1beta1.DecCoin"; value: Uint8Array; @@ -73,9 +64,6 @@ export interface DecCoinAminoMsg { export interface IntProto { int: string; } -export interface ReactiveIntProto { - int: ComputedRef; -} export interface IntProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.IntProto"; value: Uint8Array; @@ -98,9 +86,6 @@ export interface IntProtoAminoMsg { export interface DecProto { dec: string; } -export interface ReactiveDecProto { - dec: ComputedRef; -} export interface DecProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.DecProto"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/crypto/ed25519/keys.ts b/libs/injective-vue/src/cosmos/crypto/ed25519/keys.ts index 70c93f6c..6f544d77 100644 --- a/libs/injective-vue/src/cosmos/crypto/ed25519/keys.ts +++ b/libs/injective-vue/src/cosmos/crypto/ed25519/keys.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. * It's needed for Any serialization and SDK compatibility. @@ -12,9 +11,6 @@ import { ComputedRef } from "vue"; export interface PubKey { key: Uint8Array; } -export interface ReactivePubKey { - key: ComputedRef; -} export interface PubKeyProtoMsg { typeUrl: "/cosmos.crypto.ed25519.PubKey"; value: Uint8Array; @@ -40,9 +36,6 @@ export interface PubKeyAminoMsg { export interface PrivKey { key: Uint8Array; } -export interface ReactivePrivKey { - key: ComputedRef; -} export interface PrivKeyProtoMsg { typeUrl: "/cosmos.crypto.ed25519.PrivKey"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/libs/injective-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts index b6a78558..1d46639b 100644 --- a/libs/injective-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/libs/injective-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers @@ -10,9 +9,6 @@ import { ComputedRef } from "vue"; export interface MultiSignature { signatures: Uint8Array[]; } -export interface ReactiveMultiSignature { - signatures: ComputedRef; -} export interface MultiSignatureProtoMsg { typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature"; value: Uint8Array; @@ -39,10 +35,6 @@ export interface CompactBitArray { extraBitsStored: number; elems: Uint8Array; } -export interface ReactiveCompactBitArray { - extraBitsStored: ComputedRef; - elems: ComputedRef; -} export interface CompactBitArrayProtoMsg { typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/crypto/secp256k1/keys.ts b/libs/injective-vue/src/cosmos/crypto/secp256k1/keys.ts index 6e19f0c9..c0fdd0ac 100644 --- a/libs/injective-vue/src/cosmos/crypto/secp256k1/keys.ts +++ b/libs/injective-vue/src/cosmos/crypto/secp256k1/keys.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * PubKey defines a secp256k1 public key * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte @@ -12,9 +11,6 @@ import { ComputedRef } from "vue"; export interface PubKey { key: Uint8Array; } -export interface ReactivePubKey { - key: ComputedRef; -} export interface PubKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256k1.PubKey"; value: Uint8Array; @@ -37,9 +33,6 @@ export interface PubKeyAminoMsg { export interface PrivKey { key: Uint8Array; } -export interface ReactivePrivKey { - key: ComputedRef; -} export interface PrivKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256k1.PrivKey"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/crypto/secp256r1/keys.ts b/libs/injective-vue/src/cosmos/crypto/secp256r1/keys.ts index 664aac01..6b1edf68 100644 --- a/libs/injective-vue/src/cosmos/crypto/secp256r1/keys.ts +++ b/libs/injective-vue/src/cosmos/crypto/secp256r1/keys.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** PubKey defines a secp256r1 ECDSA public key. */ export interface PubKey { /** @@ -10,9 +9,6 @@ export interface PubKey { */ key: Uint8Array; } -export interface ReactivePubKey { - key: ComputedRef; -} export interface PubKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256r1.PubKey"; value: Uint8Array; @@ -34,9 +30,6 @@ export interface PrivKey { /** secret number serialized using big-endian encoding */ secret: Uint8Array; } -export interface ReactivePrivKey { - secret: ComputedRef; -} export interface PrivKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256r1.PrivKey"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/distribution/v1beta1/distribution.ts b/libs/injective-vue/src/cosmos/distribution/v1beta1/distribution.ts index 53b3e942..fdf747a5 100644 --- a/libs/injective-vue/src/cosmos/distribution/v1beta1/distribution.ts +++ b/libs/injective-vue/src/cosmos/distribution/v1beta1/distribution.ts @@ -2,7 +2,6 @@ import { DecCoin, DecCoinAmino, Coin, CoinAmino } from "../../base/v1beta1/coin" import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Params defines the set of params for the distribution module. */ export interface Params { communityTax: string; @@ -20,12 +19,6 @@ export interface Params { bonusProposerReward: string; withdrawAddrEnabled: boolean; } -export interface ReactiveParams { - communityTax: ComputedRef; - baseProposerReward: ComputedRef; - bonusProposerReward: ComputedRef; - withdrawAddrEnabled: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.Params"; value: Uint8Array; @@ -69,10 +62,6 @@ export interface ValidatorHistoricalRewards { cumulativeRewardRatio: DecCoin[]; referenceCount: number; } -export interface ReactiveValidatorHistoricalRewards { - cumulativeRewardRatio: ComputedRef; - referenceCount: ComputedRef; -} export interface ValidatorHistoricalRewardsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards"; value: Uint8Array; @@ -108,10 +97,6 @@ export interface ValidatorCurrentRewards { rewards: DecCoin[]; period: bigint; } -export interface ReactiveValidatorCurrentRewards { - rewards: ComputedRef; - period: ComputedRef; -} export interface ValidatorCurrentRewardsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards"; value: Uint8Array; @@ -136,9 +121,6 @@ export interface ValidatorCurrentRewardsAminoMsg { export interface ValidatorAccumulatedCommission { commission: DecCoin[]; } -export interface ReactiveValidatorAccumulatedCommission { - commission: ComputedRef; -} export interface ValidatorAccumulatedCommissionProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"; value: Uint8Array; @@ -161,9 +143,6 @@ export interface ValidatorAccumulatedCommissionAminoMsg { export interface ValidatorOutstandingRewards { rewards: DecCoin[]; } -export interface ReactiveValidatorOutstandingRewards { - rewards: ComputedRef; -} export interface ValidatorOutstandingRewardsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards"; value: Uint8Array; @@ -189,10 +168,6 @@ export interface ValidatorSlashEvent { validatorPeriod: bigint; fraction: string; } -export interface ReactiveValidatorSlashEvent { - validatorPeriod: ComputedRef; - fraction: ComputedRef; -} export interface ValidatorSlashEventProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent"; value: Uint8Array; @@ -215,9 +190,6 @@ export interface ValidatorSlashEventAminoMsg { export interface ValidatorSlashEvents { validatorSlashEvents: ValidatorSlashEvent[]; } -export interface ReactiveValidatorSlashEvents { - validatorSlashEvents: ComputedRef; -} export interface ValidatorSlashEventsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents"; value: Uint8Array; @@ -234,9 +206,6 @@ export interface ValidatorSlashEventsAminoMsg { export interface FeePool { communityPool: DecCoin[]; } -export interface ReactiveFeePool { - communityPool: ComputedRef; -} export interface FeePoolProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.FeePool"; value: Uint8Array; @@ -266,12 +235,6 @@ export interface CommunityPoolSpendProposal { recipient: string; amount: Coin[]; } -export interface ReactiveCommunityPoolSpendProposal { - title: ComputedRef; - description: ComputedRef; - recipient: ComputedRef; - amount: ComputedRef; -} export interface CommunityPoolSpendProposalProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; value: Uint8Array; @@ -310,11 +273,6 @@ export interface DelegatorStartingInfo { stake: string; height: bigint; } -export interface ReactiveDelegatorStartingInfo { - previousPeriod: ComputedRef; - stake: ComputedRef; - height: ComputedRef; -} export interface DelegatorStartingInfoProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo"; value: Uint8Array; @@ -344,10 +302,6 @@ export interface DelegationDelegatorReward { validatorAddress: string; reward: DecCoin[]; } -export interface ReactiveDelegationDelegatorReward { - validatorAddress: ComputedRef; - reward: ComputedRef; -} export interface DelegationDelegatorRewardProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward"; value: Uint8Array; @@ -375,13 +329,6 @@ export interface CommunityPoolSpendProposalWithDeposit { amount: string; deposit: string; } -export interface ReactiveCommunityPoolSpendProposalWithDeposit { - title: ComputedRef; - description: ComputedRef; - recipient: ComputedRef; - amount: ComputedRef; - deposit: ComputedRef; -} export interface CommunityPoolSpendProposalWithDepositProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.amino.ts b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.amino.ts deleted file mode 100644 index 34f6bac6..00000000 --- a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; -export const AminoConverter = { - "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { - aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", - toAmino: MsgSetWithdrawAddress.toAmino, - fromAmino: MsgSetWithdrawAddress.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": { - aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", - toAmino: MsgWithdrawDelegatorReward.toAmino, - fromAmino: MsgWithdrawDelegatorReward.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": { - aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", - toAmino: MsgWithdrawValidatorCommission.toAmino, - fromAmino: MsgWithdrawValidatorCommission.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgFundCommunityPool": { - aminoType: "cosmos-sdk/MsgFundCommunityPool", - toAmino: MsgFundCommunityPool.toAmino, - fromAmino: MsgFundCommunityPool.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/distribution/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend": { - aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", - toAmino: MsgCommunityPoolSpend.toAmino, - fromAmino: MsgCommunityPoolSpend.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool": { - aminoType: "cosmos-sdk/distr/MsgDepositValRewards", - toAmino: MsgDepositValidatorRewardsPool.toAmino, - fromAmino: MsgDepositValidatorRewardsPool.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..0323b14d --- /dev/null +++ b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetWithdrawAddress.typeUrl, + encoders: toEncoders(MsgSetWithdrawAddress), + converters: toConverters(MsgSetWithdrawAddress) +}); +export const createWithdrawDelegatorReward = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawDelegatorReward.typeUrl, + encoders: toEncoders(MsgWithdrawDelegatorReward), + converters: toConverters(MsgWithdrawDelegatorReward) +}); +export const createWithdrawValidatorCommission = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawValidatorCommission.typeUrl, + encoders: toEncoders(MsgWithdrawValidatorCommission), + converters: toConverters(MsgWithdrawValidatorCommission) +}); +export const createFundCommunityPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgFundCommunityPool.typeUrl, + encoders: toEncoders(MsgFundCommunityPool), + converters: toConverters(MsgFundCommunityPool) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCommunityPoolSpend.typeUrl, + encoders: toEncoders(MsgCommunityPoolSpend), + converters: toConverters(MsgCommunityPoolSpend) +}); +export const createDepositValidatorRewardsPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDepositValidatorRewardsPool.typeUrl, + encoders: toEncoders(MsgDepositValidatorRewardsPool), + converters: toConverters(MsgDepositValidatorRewardsPool) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index a6dd2617..00000000 --- a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgDepositValidatorRewardsPool, MsgDepositValidatorRewardsPoolResponse } from "./tx"; -/** Msg defines the distribution Msg service. */ -export interface Msg { - /** - * SetWithdrawAddress defines a method to change the withdraw address - * for a delegator (or validator self-delegation). - */ - setWithdrawAddress(request: MsgSetWithdrawAddress): Promise; - /** - * WithdrawDelegatorReward defines a method to withdraw rewards of delegator - * from a single validator. - */ - withdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; - /** - * WithdrawValidatorCommission defines a method to withdraw the - * full commission to the validator address. - */ - withdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise; - /** - * FundCommunityPool defines a method to allow an account to directly - * fund the community pool. - */ - 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; - /** - * DepositValidatorRewardsPool defines a method to provide additional rewards - * to delegators to a specific validator. - * - * Since: cosmos-sdk 0.50 - */ - depositValidatorRewardsPool(request: MsgDepositValidatorRewardsPool): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SetWithdrawAddress defines a method to change the withdraw address - for a delegator (or validator self-delegation). */ - setWithdrawAddress = async (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 BinaryReader(data))); - }; - /* WithdrawDelegatorReward defines a method to withdraw rewards of delegator - from a single validator. */ - withdrawDelegatorReward = async (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 BinaryReader(data))); - }; - /* WithdrawValidatorCommission defines a method to withdraw the - full commission to the validator address. */ - withdrawValidatorCommission = async (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 BinaryReader(data))); - }; - /* FundCommunityPool defines a method to allow an account to directly - fund the community pool. */ - fundCommunityPool = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* DepositValidatorRewardsPool defines a method to provide additional rewards - to delegators to a specific validator. - - Since: cosmos-sdk 0.50 */ - depositValidatorRewardsPool = async (request: MsgDepositValidatorRewardsPool): Promise => { - const data = MsgDepositValidatorRewardsPool.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "DepositValidatorRewardsPool", data); - return promise.then(data => MsgDepositValidatorRewardsPoolResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..51d3ad25 --- /dev/null +++ b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +export const useSetWithdrawAddress = buildUseVueMutation({ + builderMutationFn: createSetWithdrawAddress +}); +export const useWithdrawDelegatorReward = buildUseVueMutation({ + builderMutationFn: createWithdrawDelegatorReward +}); +export const useWithdrawValidatorCommission = buildUseVueMutation({ + builderMutationFn: createWithdrawValidatorCommission +}); +export const useFundCommunityPool = buildUseVueMutation({ + builderMutationFn: createFundCommunityPool +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useCommunityPoolSpend = buildUseVueMutation({ + builderMutationFn: createCommunityPoolSpend +}); +export const useDepositValidatorRewardsPool = buildUseVueMutation({ + builderMutationFn: createDepositValidatorRewardsPool +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.ts index ceb1dff7..64517d0b 100644 --- a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Params, ParamsAmino } from "./distribution"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgSetWithdrawAddress sets the withdraw address for * a delegator (or validator self-delegation). @@ -12,10 +11,6 @@ export interface MsgSetWithdrawAddress { delegatorAddress: string; withdrawAddress: string; } -export interface ReactiveMsgSetWithdrawAddress { - delegatorAddress: ComputedRef; - withdrawAddress: ComputedRef; -} export interface MsgSetWithdrawAddressProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress"; value: Uint8Array; @@ -37,7 +32,6 @@ export interface MsgSetWithdrawAddressAminoMsg { * type. */ export interface MsgSetWithdrawAddressResponse {} -export interface ReactiveMsgSetWithdrawAddressResponse {} export interface MsgSetWithdrawAddressResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse"; value: Uint8Array; @@ -59,10 +53,6 @@ export interface MsgWithdrawDelegatorReward { delegatorAddress: string; validatorAddress: string; } -export interface ReactiveMsgWithdrawDelegatorReward { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; -} export interface MsgWithdrawDelegatorRewardProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"; value: Uint8Array; @@ -87,9 +77,6 @@ export interface MsgWithdrawDelegatorRewardResponse { /** Since: cosmos-sdk 0.46 */ amount: Coin[]; } -export interface ReactiveMsgWithdrawDelegatorRewardResponse { - amount: ComputedRef; -} export interface MsgWithdrawDelegatorRewardResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse"; value: Uint8Array; @@ -113,9 +100,6 @@ export interface MsgWithdrawDelegatorRewardResponseAminoMsg { export interface MsgWithdrawValidatorCommission { validatorAddress: string; } -export interface ReactiveMsgWithdrawValidatorCommission { - validatorAddress: ComputedRef; -} export interface MsgWithdrawValidatorCommissionProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"; value: Uint8Array; @@ -139,9 +123,6 @@ export interface MsgWithdrawValidatorCommissionResponse { /** Since: cosmos-sdk 0.46 */ amount: Coin[]; } -export interface ReactiveMsgWithdrawValidatorCommissionResponse { - amount: ComputedRef; -} export interface MsgWithdrawValidatorCommissionResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse"; value: Uint8Array; @@ -166,10 +147,6 @@ export interface MsgFundCommunityPool { amount: Coin[]; depositor: string; } -export interface ReactiveMsgFundCommunityPool { - amount: ComputedRef; - depositor: ComputedRef; -} export interface MsgFundCommunityPoolProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool"; value: Uint8Array; @@ -188,7 +165,6 @@ export interface MsgFundCommunityPoolAminoMsg { } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ export interface MsgFundCommunityPoolResponse {} -export interface ReactiveMsgFundCommunityPoolResponse {} export interface MsgFundCommunityPoolResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse"; value: Uint8Array; @@ -214,10 +190,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -248,7 +220,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -277,11 +248,6 @@ export interface MsgCommunityPoolSpend { recipient: string; amount: Coin[]; } -export interface ReactiveMsgCommunityPoolSpend { - authority: ComputedRef; - recipient: ComputedRef; - amount: ComputedRef; -} export interface MsgCommunityPoolSpendProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend"; value: Uint8Array; @@ -310,7 +276,6 @@ export interface MsgCommunityPoolSpendAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgCommunityPoolSpendResponse {} -export interface ReactiveMsgCommunityPoolSpendResponse {} export interface MsgCommunityPoolSpendResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse"; value: Uint8Array; @@ -337,11 +302,6 @@ export interface MsgDepositValidatorRewardsPool { validatorAddress: string; amount: Coin[]; } -export interface ReactiveMsgDepositValidatorRewardsPool { - depositor: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgDepositValidatorRewardsPoolProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool"; value: Uint8Array; @@ -368,7 +328,6 @@ export interface MsgDepositValidatorRewardsPoolAminoMsg { * Since: cosmos-sdk 0.50 */ export interface MsgDepositValidatorRewardsPoolResponse {} -export interface ReactiveMsgDepositValidatorRewardsPoolResponse {} export interface MsgDepositValidatorRewardsPoolResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts deleted file mode 100644 index abc5f21a..00000000 --- a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; -export const AminoConverter = { - "/cosmos.feegrant.v1beta1.MsgGrantAllowance": { - aminoType: "cosmos-sdk/MsgGrantAllowance", - toAmino: MsgGrantAllowance.toAmino, - fromAmino: MsgGrantAllowance.fromAmino - }, - "/cosmos.feegrant.v1beta1.MsgRevokeAllowance": { - aminoType: "cosmos-sdk/MsgRevokeAllowance", - toAmino: MsgRevokeAllowance.toAmino, - fromAmino: MsgRevokeAllowance.fromAmino - }, - "/cosmos.feegrant.v1beta1.MsgPruneAllowances": { - aminoType: "cosmos-sdk/MsgPruneAllowances", - toAmino: MsgPruneAllowances.toAmino, - fromAmino: MsgPruneAllowances.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..aa73f97f --- /dev/null +++ b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +export const createGrantAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrantAllowance.typeUrl, + encoders: toEncoders(MsgGrantAllowance), + converters: toConverters(MsgGrantAllowance) +}); +export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeAllowance.typeUrl, + encoders: toEncoders(MsgRevokeAllowance), + converters: toConverters(MsgRevokeAllowance) +}); +export const createPruneAllowances = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAllowances.typeUrl, + encoders: toEncoders(MsgPruneAllowances), + converters: toConverters(MsgPruneAllowances) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 8f227710..00000000 --- a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse, MsgPruneAllowances, MsgPruneAllowancesResponse } from "./tx"; -/** Msg defines the feegrant msg service. */ -export interface Msg { - /** - * GrantAllowance grants fee allowance to the grantee on the granter's - * account with the provided expiration time. - */ - grantAllowance(request: MsgGrantAllowance): Promise; - /** - * RevokeAllowance revokes any fee allowance of granter's account that - * has been granted to the grantee. - */ - revokeAllowance(request: MsgRevokeAllowance): Promise; - /** - * PruneAllowances prunes expired fee allowances, currently up to 75 at a time. - * - * Since cosmos-sdk 0.50 - */ - pruneAllowances(request: MsgPruneAllowances): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* GrantAllowance grants fee allowance to the grantee on the granter's - account with the provided expiration time. */ - grantAllowance = async (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 BinaryReader(data))); - }; - /* RevokeAllowance revokes any fee allowance of granter's account that - has been granted to the grantee. */ - revokeAllowance = async (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 BinaryReader(data))); - }; - /* PruneAllowances prunes expired fee allowances, currently up to 75 at a time. - - Since cosmos-sdk 0.50 */ - pruneAllowances = async (request: MsgPruneAllowances): Promise => { - const data = MsgPruneAllowances.encode(request).finish(); - const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "PruneAllowances", data); - return promise.then(data => MsgPruneAllowancesResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..1cf9e374 --- /dev/null +++ b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,12 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +export const useGrantAllowance = buildUseVueMutation({ + builderMutationFn: createGrantAllowance +}); +export const useRevokeAllowance = buildUseVueMutation({ + builderMutationFn: createRevokeAllowance +}); +export const usePruneAllowances = buildUseVueMutation({ + builderMutationFn: createPruneAllowances +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.ts index 249479d9..bdf80e94 100644 --- a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.ts @@ -2,7 +2,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgGrantAllowance adds permission for Grantee to spend up to Allowance * of fees from the account of Granter. @@ -15,11 +14,6 @@ export interface MsgGrantAllowance { /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: Any | undefined; } -export interface ReactiveMsgGrantAllowance { - granter: ComputedRef; - grantee: ComputedRef; - allowance?: ComputedRef; -} export interface MsgGrantAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; value: Uint8Array; @@ -45,7 +39,6 @@ export interface MsgGrantAllowanceAminoMsg { } /** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ export interface MsgGrantAllowanceResponse {} -export interface ReactiveMsgGrantAllowanceResponse {} export interface MsgGrantAllowanceResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse"; value: Uint8Array; @@ -63,10 +56,6 @@ export interface MsgRevokeAllowance { /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; } -export interface ReactiveMsgRevokeAllowance { - granter: ComputedRef; - grantee: ComputedRef; -} export interface MsgRevokeAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance"; value: Uint8Array; @@ -84,7 +73,6 @@ export interface MsgRevokeAllowanceAminoMsg { } /** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ export interface MsgRevokeAllowanceResponse {} -export interface ReactiveMsgRevokeAllowanceResponse {} export interface MsgRevokeAllowanceResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse"; value: Uint8Array; @@ -104,9 +92,6 @@ export interface MsgPruneAllowances { /** pruner is the address of the user pruning expired allowances. */ pruner: string; } -export interface ReactiveMsgPruneAllowances { - pruner: ComputedRef; -} export interface MsgPruneAllowancesProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances"; value: Uint8Array; @@ -130,7 +115,6 @@ export interface MsgPruneAllowancesAminoMsg { * Since cosmos-sdk 0.50 */ export interface MsgPruneAllowancesResponse {} -export interface ReactiveMsgPruneAllowancesResponse {} export interface MsgPruneAllowancesResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/gov/v1/gov.ts b/libs/injective-vue/src/cosmos/gov/v1/gov.ts index 0cfe2aa1..434920f3 100644 --- a/libs/injective-vue/src/cosmos/gov/v1/gov.ts +++ b/libs/injective-vue/src/cosmos/gov/v1/gov.ts @@ -5,7 +5,6 @@ import { Duration, DurationAmino } from "../../../google/protobuf/duration"; import { isSet, DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** 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. */ @@ -145,10 +144,6 @@ export interface WeightedVoteOption { /** weight is the vote weight associated with the vote option. */ weight: string; } -export interface ReactiveWeightedVoteOption { - option: ComputedRef; - weight: ComputedRef; -} export interface WeightedVoteOptionProtoMsg { typeUrl: "/cosmos.gov.v1.WeightedVoteOption"; value: Uint8Array; @@ -176,11 +171,6 @@ export interface Deposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface DepositProtoMsg { typeUrl: "/cosmos.gov.v1.Deposit"; value: Uint8Array; @@ -262,23 +252,6 @@ export interface Proposal { */ failedReason: string; } -export interface ReactiveProposal { - id: ComputedRef; - messages: ComputedRef; - status: ComputedRef; - finalTallyResult?: ComputedRef; - submitTime?: ComputedRef; - depositEndTime?: ComputedRef; - totalDeposit: ComputedRef; - votingStartTime?: ComputedRef; - votingEndTime?: ComputedRef; - metadata: ComputedRef; - title: ComputedRef; - summary: ComputedRef; - proposer: ComputedRef; - expedited: ComputedRef; - failedReason: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/cosmos.gov.v1.Proposal"; value: Uint8Array; @@ -359,12 +332,6 @@ export interface TallyResult { /** no_with_veto_count is the number of no with veto votes on a proposal. */ noWithVetoCount: string; } -export interface ReactiveTallyResult { - yesCount: ComputedRef; - abstainCount: ComputedRef; - noCount: ComputedRef; - noWithVetoCount: ComputedRef; -} export interface TallyResultProtoMsg { typeUrl: "/cosmos.gov.v1.TallyResult"; value: Uint8Array; @@ -401,12 +368,6 @@ export interface Vote { */ metadata: string; } -export interface ReactiveVote { - proposalId: ComputedRef; - voter: ComputedRef; - options: ComputedRef; - metadata: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/cosmos.gov.v1.Vote"; value: Uint8Array; @@ -443,10 +404,6 @@ export interface DepositParams { */ maxDepositPeriod?: Duration; } -export interface ReactiveDepositParams { - minDeposit: ComputedRef; - maxDepositPeriod?: ComputedRef; -} export interface DepositParamsProtoMsg { typeUrl: "/cosmos.gov.v1.DepositParams"; value: Uint8Array; @@ -472,9 +429,6 @@ export interface VotingParams { /** Duration of the voting period. */ votingPeriod?: Duration; } -export interface ReactiveVotingParams { - votingPeriod?: ComputedRef; -} export interface VotingParamsProtoMsg { typeUrl: "/cosmos.gov.v1.VotingParams"; value: Uint8Array; @@ -505,11 +459,6 @@ export interface TallyParams { */ vetoThreshold: string; } -export interface ReactiveTallyParams { - quorum: ComputedRef; - threshold: ComputedRef; - vetoThreshold: ComputedRef; -} export interface TallyParamsProtoMsg { typeUrl: "/cosmos.gov.v1.TallyParams"; value: Uint8Array; @@ -605,24 +554,6 @@ export interface Params { */ minDepositRatio: string; } -export interface ReactiveParams { - minDeposit: ComputedRef; - maxDepositPeriod?: ComputedRef; - votingPeriod?: ComputedRef; - quorum: ComputedRef; - threshold: ComputedRef; - vetoThreshold: ComputedRef; - minInitialDepositRatio: ComputedRef; - proposalCancelRatio: ComputedRef; - proposalCancelDest: ComputedRef; - expeditedVotingPeriod?: ComputedRef; - expeditedThreshold: ComputedRef; - expeditedMinDeposit: ComputedRef; - burnVoteQuorum: ComputedRef; - burnProposalDepositPrevote: ComputedRef; - burnVoteVeto: ComputedRef; - minDepositRatio: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.gov.v1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/gov/v1/tx.amino.ts b/libs/injective-vue/src/cosmos/gov/v1/tx.amino.ts deleted file mode 100644 index 6b91907b..00000000 --- a/libs/injective-vue/src/cosmos/gov/v1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; -export const AminoConverter = { - "/cosmos.gov.v1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/v1/MsgSubmitProposal", - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino - }, - "/cosmos.gov.v1.MsgExecLegacyContent": { - aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", - toAmino: MsgExecLegacyContent.toAmino, - fromAmino: MsgExecLegacyContent.fromAmino - }, - "/cosmos.gov.v1.MsgVote": { - aminoType: "cosmos-sdk/v1/MsgVote", - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino - }, - "/cosmos.gov.v1.MsgVoteWeighted": { - aminoType: "cosmos-sdk/v1/MsgVoteWeighted", - toAmino: MsgVoteWeighted.toAmino, - fromAmino: MsgVoteWeighted.fromAmino - }, - "/cosmos.gov.v1.MsgDeposit": { - aminoType: "cosmos-sdk/v1/MsgDeposit", - toAmino: MsgDeposit.toAmino, - fromAmino: MsgDeposit.fromAmino - }, - "/cosmos.gov.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/gov/v1/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmos.gov.v1.MsgCancelProposal": { - aminoType: "cosmos-sdk/v1/MsgCancelProposal", - toAmino: MsgCancelProposal.toAmino, - fromAmino: MsgCancelProposal.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.func.ts new file mode 100644 index 00000000..0fe35d3a --- /dev/null +++ b/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createExecLegacyContent = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecLegacyContent.typeUrl, + encoders: toEncoders(MsgExecLegacyContent), + converters: toConverters(MsgExecLegacyContent) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCancelProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelProposal.typeUrl, + encoders: toEncoders(MsgCancelProposal), + converters: toConverters(MsgCancelProposal) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.msg.ts deleted file mode 100644 index 9112b3d9..00000000 --- a/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgExecLegacyContent, MsgExecLegacyContentResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCancelProposal, MsgCancelProposalResponse } from "./tx"; -/** 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; - /** - * CancelProposal defines a method to cancel governance proposal - * - * Since: cosmos-sdk 0.50 - */ - cancelProposal(request: MsgCancelProposal): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SubmitProposal defines a method to create new proposal given the messages. */ - submitProposal = async (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 BinaryReader(data))); - }; - /* ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - to execute a legacy content-based proposal. */ - execLegacyContent = async (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 BinaryReader(data))); - }; - /* Vote defines a method to add a vote on a specific proposal. */ - vote = async (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 BinaryReader(data))); - }; - /* VoteWeighted defines a method to add a weighted vote on a specific proposal. */ - voteWeighted = async (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 BinaryReader(data))); - }; - /* Deposit defines a method to add deposit on a specific proposal. */ - deposit = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* CancelProposal defines a method to cancel governance proposal - - Since: cosmos-sdk 0.50 */ - cancelProposal = async (request: MsgCancelProposal): Promise => { - const data = MsgCancelProposal.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1.Msg", "CancelProposal", data); - return promise.then(data => MsgCancelProposalResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..603f5139 --- /dev/null +++ b/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseVueMutation({ + builderMutationFn: createSubmitProposal +}); +export const useExecLegacyContent = buildUseVueMutation({ + builderMutationFn: createExecLegacyContent +}); +export const useVote = buildUseVueMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseVueMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseVueMutation({ + builderMutationFn: createDeposit +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useCancelProposal = buildUseVueMutation({ + builderMutationFn: createCancelProposal +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1/tx.ts b/libs/injective-vue/src/cosmos/gov/v1/tx.ts index 77c8588b..d01c6807 100644 --- a/libs/injective-vue/src/cosmos/gov/v1/tx.ts +++ b/libs/injective-vue/src/cosmos/gov/v1/tx.ts @@ -14,7 +14,6 @@ import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposa import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. @@ -47,15 +46,6 @@ export interface MsgSubmitProposal { */ expedited: boolean; } -export interface ReactiveMsgSubmitProposal { - messages: ComputedRef; - initialDeposit: ComputedRef; - proposer: ComputedRef; - metadata: ComputedRef; - title: ComputedRef; - summary: ComputedRef; - expedited: ComputedRef; -} export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal"; value: Uint8Array; @@ -101,9 +91,6 @@ export interface MsgSubmitProposalResponse { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveMsgSubmitProposalResponse { - proposalId: ComputedRef; -} export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; value: Uint8Array; @@ -127,10 +114,6 @@ export interface MsgExecLegacyContent { /** authority must be the gov module address. */ authority: string; } -export interface ReactiveMsgExecLegacyContent { - content?: ComputedRef; - authority: ComputedRef; -} export interface MsgExecLegacyContentProtoMsg { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; value: Uint8Array; @@ -154,7 +137,6 @@ export interface MsgExecLegacyContentAminoMsg { } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponse {} -export interface ReactiveMsgExecLegacyContentResponse {} export interface MsgExecLegacyContentResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; value: Uint8Array; @@ -176,12 +158,6 @@ export interface MsgVote { /** metadata is any arbitrary metadata attached to the Vote. */ metadata: string; } -export interface ReactiveMsgVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - metadata: ComputedRef; -} export interface MsgVoteProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVote"; value: Uint8Array; @@ -203,7 +179,6 @@ export interface MsgVoteAminoMsg { } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponse {} -export interface ReactiveMsgVoteResponse {} export interface MsgVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; value: Uint8Array; @@ -225,12 +200,6 @@ export interface MsgVoteWeighted { /** metadata is any arbitrary metadata attached to the VoteWeighted. */ metadata: string; } -export interface ReactiveMsgVoteWeighted { - proposalId: ComputedRef; - voter: ComputedRef; - options: ComputedRef; - metadata: ComputedRef; -} export interface MsgVoteWeightedProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted"; value: Uint8Array; @@ -252,7 +221,6 @@ export interface MsgVoteWeightedAminoMsg { } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponse {} -export interface ReactiveMsgVoteWeightedResponse {} export interface MsgVoteWeightedResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; value: Uint8Array; @@ -272,11 +240,6 @@ export interface MsgDeposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveMsgDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface MsgDepositProtoMsg { typeUrl: "/cosmos.gov.v1.MsgDeposit"; value: Uint8Array; @@ -296,7 +259,6 @@ export interface MsgDepositAminoMsg { } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponse {} -export interface ReactiveMsgDepositResponse {} export interface MsgDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; value: Uint8Array; @@ -322,10 +284,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.gov.v1.MsgUpdateParams"; value: Uint8Array; @@ -356,7 +314,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -383,10 +340,6 @@ export interface MsgCancelProposal { /** proposer is the account address of the proposer. */ proposer: string; } -export interface ReactiveMsgCancelProposal { - proposalId: ComputedRef; - proposer: ComputedRef; -} export interface MsgCancelProposalProtoMsg { typeUrl: "/cosmos.gov.v1.MsgCancelProposal"; value: Uint8Array; @@ -420,11 +373,6 @@ export interface MsgCancelProposalResponse { /** canceled_height defines the block height at which the proposal is canceled. */ canceledHeight: bigint; } -export interface ReactiveMsgCancelProposalResponse { - proposalId: ComputedRef; - canceledTime: ComputedRef; - canceledHeight: ComputedRef; -} export interface MsgCancelProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/gov.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/gov.ts index 97a6e80a..cf660d2d 100644 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/gov.ts +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/gov.ts @@ -13,7 +13,6 @@ import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposa import { isSet, DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** 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. */ @@ -157,10 +156,6 @@ export interface WeightedVoteOption { /** weight is the vote weight associated with the vote option. */ weight: string; } -export interface ReactiveWeightedVoteOption { - option: ComputedRef; - weight: ComputedRef; -} export interface WeightedVoteOptionProtoMsg { typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption"; value: Uint8Array; @@ -190,10 +185,6 @@ export interface TextProposal { /** description associated with the proposal. */ description: string; } -export interface ReactiveTextProposal { - title: ComputedRef; - description: ComputedRef; -} export interface TextProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TextProposal"; value: Uint8Array; @@ -224,11 +215,6 @@ export interface Deposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface DepositProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Deposit"; value: Uint8Array; @@ -274,17 +260,6 @@ export interface Proposal { /** voting_end_time is the end time of voting on a proposal. */ votingEndTime: Date; } -export interface ReactiveProposal { - proposalId: ComputedRef; - content?: ComputedRef; - status: ComputedRef; - finalTallyResult: ComputedRef; - submitTime: ComputedRef; - depositEndTime: ComputedRef; - totalDeposit: ComputedRef; - votingStartTime: ComputedRef; - votingEndTime: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Proposal"; value: Uint8Array; @@ -332,12 +307,6 @@ export interface TallyResult { /** no_with_veto is the number of no with veto votes on a proposal. */ noWithVeto: string; } -export interface ReactiveTallyResult { - yes: ComputedRef; - abstain: ComputedRef; - no: ComputedRef; - noWithVeto: ComputedRef; -} export interface TallyResultProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TallyResult"; value: Uint8Array; @@ -380,12 +349,6 @@ export interface Vote { */ options: WeightedVoteOption[]; } -export interface ReactiveVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - options: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Vote"; value: Uint8Array; @@ -427,10 +390,6 @@ export interface DepositParams { */ maxDepositPeriod: Duration; } -export interface ReactiveDepositParams { - minDeposit: ComputedRef; - maxDepositPeriod: ComputedRef; -} export interface DepositParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.DepositParams"; value: Uint8Array; @@ -454,9 +413,6 @@ export interface VotingParams { /** Duration of the voting period. */ votingPeriod: Duration; } -export interface ReactiveVotingParams { - votingPeriod: ComputedRef; -} export interface VotingParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.VotingParams"; value: Uint8Array; @@ -485,11 +441,6 @@ export interface TallyParams { */ vetoThreshold: Uint8Array; } -export interface ReactiveTallyParams { - quorum: ComputedRef; - threshold: ComputedRef; - vetoThreshold: ComputedRef; -} export interface TallyParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TallyParams"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 0312b968..00000000 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,360 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse, ReactiveQueryProposalRequest, ReactiveQueryProposalsRequest, ReactiveQueryVoteRequest, ReactiveQueryVotesRequest, ReactiveQueryParamsRequest, ReactiveQueryDepositRequest, ReactiveQueryDepositsRequest, ReactiveQueryTallyResultRequest } from "./query"; -/** 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 on proposalID, depositor address. */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Proposal queries proposal details based on ProposalID. */ - proposal = async (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 BinaryReader(data))); - }; - /* Proposals queries all proposals based on given status. */ - proposals = async (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 BinaryReader(data))); - }; - /* Vote queries voted information based on proposalID, voterAddr. */ - vote = async (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 BinaryReader(data))); - }; - /* Votes queries votes of a given proposal. */ - votes = async (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 BinaryReader(data))); - }; - /* Params queries all parameters of the gov module. */ - params = async (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 BinaryReader(data))); - }; - /* Deposit queries single deposit information based on proposalID, depositor address. */ - deposit = async (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 BinaryReader(data))); - }; - /* Deposits queries all deposits of a single proposal. */ - deposits = async (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 BinaryReader(data))); - }; - /* TallyResult queries the tally of a proposal vote. */ - tallyResult = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - proposal(request: QueryProposalRequest): Promise { - return queryService.proposal(request); - }, - proposals(request: QueryProposalsRequest): Promise { - return queryService.proposals(request); - }, - vote(request: QueryVoteRequest): Promise { - return queryService.vote(request); - }, - votes(request: QueryVotesRequest): Promise { - return queryService.votes(request); - }, - params(request: QueryParamsRequest): Promise { - return queryService.params(request); - }, - deposit(request: QueryDepositRequest): Promise { - return queryService.deposit(request); - }, - deposits(request: QueryDepositsRequest): Promise { - return queryService.deposits(request); - }, - tallyResult(request: QueryTallyResultRequest): Promise { - return queryService.tallyResult(request); - } - }; -}; -export interface UseProposalQuery extends VueQueryParams { - request: ReactiveQueryProposalRequest; -} -export interface UseProposalsQuery extends VueQueryParams { - request: ReactiveQueryProposalsRequest; -} -export interface UseVoteQuery extends VueQueryParams { - request: ReactiveQueryVoteRequest; -} -export interface UseVotesQuery extends VueQueryParams { - request: ReactiveQueryVotesRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request: ReactiveQueryParamsRequest; -} -export interface UseDepositQuery extends VueQueryParams { - request: ReactiveQueryDepositRequest; -} -export interface UseDepositsQuery extends VueQueryParams { - request: ReactiveQueryDepositsRequest; -} -export interface UseTallyResultQuery extends VueQueryParams { - request: ReactiveQueryTallyResultRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useProposal = ({ - request, - options - }: UseProposalQuery) => { - const queryKey = ["proposalQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposal(params); - }, - ...options - }); - }; - const useProposals = ({ - request, - options - }: UseProposalsQuery) => { - const queryKey = ["proposalsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposals(params); - }, - ...options - }); - }; - const useVote = ({ - request, - options - }: UseVoteQuery) => { - const queryKey = ["voteQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.vote(params); - }, - ...options - }); - }; - const useVotes = ({ - request, - options - }: UseVotesQuery) => { - const queryKey = ["votesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.votes(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useDeposit = ({ - request, - options - }: UseDepositQuery) => { - const queryKey = ["depositQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.deposit(params); - }, - ...options - }); - }; - const useDeposits = ({ - request, - options - }: UseDepositsQuery) => { - const queryKey = ["depositsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.deposits(params); - }, - ...options - }); - }; - const useTallyResult = ({ - request, - options - }: UseTallyResultQuery) => { - const queryKey = ["tallyResultQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.tallyResult(params); - }, - ...options - }); - }; - return { - /** Proposal queries proposal details based on ProposalID. */useProposal, - /** Proposals queries all proposals based on given status. */useProposals, - /** Vote queries voted information based on proposalID, voterAddr. */useVote, - /** Votes queries votes of a given proposal. */useVotes, - /** Params queries all parameters of the gov module. */useParams, - /** Deposit queries single deposit information based on proposalID, depositor address. */useDeposit, - /** Deposits queries all deposits of a single proposal. */useDeposits, - /** TallyResult queries the tally of a proposal vote. */useTallyResult - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..eadeddd8 --- /dev/null +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts @@ -0,0 +1,58 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalRequest.encode, + decode: QueryProposalResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposal", + clientResolver +}); +export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalsRequest.encode, + decode: QueryProposalsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposals", + clientResolver +}); +export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVoteRequest.encode, + decode: QueryVoteResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Vote", + clientResolver +}); +export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVotesRequest.encode, + decode: QueryVotesResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Votes", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositRequest.encode, + decode: QueryDepositResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposit", + clientResolver +}); +export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositsRequest.encode, + decode: QueryDepositsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposits", + clientResolver +}); +export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTallyResultRequest.encode, + decode: QueryTallyResultResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "TallyResult", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..1771e4a1 --- /dev/null +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts @@ -0,0 +1,35 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +export const useGetProposal = buildUseVueQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposals = buildUseVueQuery({ + builderQueryFn: createGetProposals, + queryKeyPrefix: "ProposalsQuery" +}); +export const useGetVote = buildUseVueQuery({ + builderQueryFn: createGetVote, + queryKeyPrefix: "VoteQuery" +}); +export const useGetVotes = buildUseVueQuery({ + builderQueryFn: createGetVotes, + queryKeyPrefix: "VotesQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDeposit = buildUseVueQuery({ + builderQueryFn: createGetDeposit, + queryKeyPrefix: "DepositQuery" +}); +export const useGetDeposits = buildUseVueQuery({ + builderQueryFn: createGetDeposits, + queryKeyPrefix: "DepositsQuery" +}); +export const useGetTallyResult = buildUseVueQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/query.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/query.ts index c209f318..15053043 100644 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/query.ts +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/query.ts @@ -3,15 +3,11 @@ import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from " import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveQueryProposalRequest { - proposalId: ComputedRef; -} export interface QueryProposalRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest"; value: Uint8Array; @@ -29,9 +25,6 @@ export interface QueryProposalRequestAminoMsg { export interface QueryProposalResponse { proposal: Proposal; } -export interface ReactiveQueryProposalResponse { - proposal: ComputedRef; -} export interface QueryProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse"; value: Uint8Array; @@ -55,12 +48,6 @@ export interface QueryProposalsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryProposalsRequest { - proposalStatus: ComputedRef; - voter: ComputedRef; - depositor: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest"; value: Uint8Array; @@ -90,10 +77,6 @@ export interface QueryProposalsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryProposalsResponse { - proposals: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse"; value: Uint8Array; @@ -119,10 +102,6 @@ export interface QueryVoteRequest { /** voter defines the voter address for the proposals. */ voter: string; } -export interface ReactiveQueryVoteRequest { - proposalId: ComputedRef; - voter: ComputedRef; -} export interface QueryVoteRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest"; value: Uint8Array; @@ -143,9 +122,6 @@ export interface QueryVoteResponse { /** vote defines the queried vote. */ vote: Vote; } -export interface ReactiveQueryVoteResponse { - vote: ComputedRef; -} export interface QueryVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse"; value: Uint8Array; @@ -166,10 +142,6 @@ export interface QueryVotesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryVotesRequest { - proposalId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest"; value: Uint8Array; @@ -192,10 +164,6 @@ export interface QueryVotesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryVotesResponse { - votes: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse"; value: Uint8Array; @@ -219,9 +187,6 @@ export interface QueryParamsRequest { */ paramsType: string; } -export interface ReactiveQueryParamsRequest { - paramsType: ComputedRef; -} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -247,11 +212,6 @@ export interface QueryParamsResponse { /** tally_params defines the parameters related to tally. */ tallyParams: TallyParams; } -export interface ReactiveQueryParamsResponse { - votingParams: ComputedRef; - depositParams: ComputedRef; - tallyParams: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -276,10 +236,6 @@ export interface QueryDepositRequest { /** depositor defines the deposit addresses from the proposals. */ depositor: string; } -export interface ReactiveQueryDepositRequest { - proposalId: ComputedRef; - depositor: ComputedRef; -} export interface QueryDepositRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest"; value: Uint8Array; @@ -300,9 +256,6 @@ export interface QueryDepositResponse { /** deposit defines the requested deposit. */ deposit: Deposit; } -export interface ReactiveQueryDepositResponse { - deposit: ComputedRef; -} export interface QueryDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse"; value: Uint8Array; @@ -323,10 +276,6 @@ export interface QueryDepositsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDepositsRequest { - proposalId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDepositsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest"; value: Uint8Array; @@ -349,10 +298,6 @@ export interface QueryDepositsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDepositsResponse { - deposits: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDepositsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse"; value: Uint8Array; @@ -373,9 +318,6 @@ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveQueryTallyResultRequest { - proposalId: ComputedRef; -} export interface QueryTallyResultRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest"; value: Uint8Array; @@ -394,9 +336,6 @@ export interface QueryTallyResultResponse { /** tally defines the requested tally. */ tally: TallyResult; } -export interface ReactiveQueryTallyResultResponse { - tally: ComputedRef; -} export interface QueryTallyResultResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.amino.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.amino.ts deleted file mode 100644 index 1d618905..00000000 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.amino.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; -export const AminoConverter = { - "/cosmos.gov.v1beta1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/MsgSubmitProposal", - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino - }, - "/cosmos.gov.v1beta1.MsgVote": { - aminoType: "cosmos-sdk/MsgVote", - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino - }, - "/cosmos.gov.v1beta1.MsgVoteWeighted": { - aminoType: "cosmos-sdk/MsgVoteWeighted", - toAmino: MsgVoteWeighted.toAmino, - fromAmino: MsgVoteWeighted.fromAmino - }, - "/cosmos.gov.v1beta1.MsgDeposit": { - aminoType: "cosmos-sdk/MsgDeposit", - toAmino: MsgDeposit.toAmino, - fromAmino: MsgDeposit.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..222ecb6c --- /dev/null +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 32f0d24f..00000000 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; -/** Msg defines the gov Msg service. */ -export interface Msg { - /** SubmitProposal defines a method to create new proposal given a content. */ - submitProposal(request: MsgSubmitProposal): 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. - * - * Since: cosmos-sdk 0.43 - */ - voteWeighted(request: MsgVoteWeighted): Promise; - /** Deposit defines a method to add deposit on a specific proposal. */ - deposit(request: MsgDeposit): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SubmitProposal defines a method to create new proposal given a content. */ - submitProposal = async (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 BinaryReader(data))); - }; - /* Vote defines a method to add a vote on a specific proposal. */ - vote = async (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 BinaryReader(data))); - }; - /* VoteWeighted defines a method to add a weighted vote on a specific proposal. - - Since: cosmos-sdk 0.43 */ - voteWeighted = async (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 BinaryReader(data))); - }; - /* Deposit defines a method to add deposit on a specific proposal. */ - deposit = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..f1bc66da --- /dev/null +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseVueMutation({ + builderMutationFn: createSubmitProposal +}); +export const useVote = buildUseVueMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseVueMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseVueMutation({ + builderMutationFn: createDeposit +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.ts index ac0d0b07..978a265a 100644 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.ts @@ -12,7 +12,6 @@ import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposa import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. @@ -25,11 +24,6 @@ export interface MsgSubmitProposal { /** proposer is the account address of the proposer. */ proposer: string; } -export interface ReactiveMsgSubmitProposal { - content?: ComputedRef; - initialDeposit: ComputedRef; - proposer: ComputedRef; -} export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; value: Uint8Array; @@ -58,9 +52,6 @@ export interface MsgSubmitProposalResponse { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveMsgSubmitProposalResponse { - proposalId: ComputedRef; -} export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse"; value: Uint8Array; @@ -83,11 +74,6 @@ export interface MsgVote { /** option defines the vote option. */ option: VoteOption; } -export interface ReactiveMsgVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; -} export interface MsgVoteProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVote"; value: Uint8Array; @@ -107,7 +93,6 @@ export interface MsgVoteAminoMsg { } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponse {} -export interface ReactiveMsgVoteResponse {} export interface MsgVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse"; value: Uint8Array; @@ -131,11 +116,6 @@ export interface MsgVoteWeighted { /** options defines the weighted vote options. */ options: WeightedVoteOption[]; } -export interface ReactiveMsgVoteWeighted { - proposalId: ComputedRef; - voter: ComputedRef; - options: ComputedRef; -} export interface MsgVoteWeightedProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted"; value: Uint8Array; @@ -163,7 +143,6 @@ export interface MsgVoteWeightedAminoMsg { * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeightedResponse {} -export interface ReactiveMsgVoteWeightedResponse {} export interface MsgVoteWeightedResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse"; value: Uint8Array; @@ -187,11 +166,6 @@ export interface MsgDeposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveMsgDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface MsgDepositProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit"; value: Uint8Array; @@ -211,7 +185,6 @@ export interface MsgDepositAminoMsg { } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponse {} -export interface ReactiveMsgDepositResponse {} export interface MsgDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/group/v1/tx.amino.ts b/libs/injective-vue/src/cosmos/group/v1/tx.amino.ts deleted file mode 100644 index 3a5c0e59..00000000 --- a/libs/injective-vue/src/cosmos/group/v1/tx.amino.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; -export const AminoConverter = { - "/cosmos.group.v1.MsgCreateGroup": { - aminoType: "cosmos-sdk/MsgCreateGroup", - toAmino: MsgCreateGroup.toAmino, - fromAmino: MsgCreateGroup.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupMembers": { - aminoType: "cosmos-sdk/MsgUpdateGroupMembers", - toAmino: MsgUpdateGroupMembers.toAmino, - fromAmino: MsgUpdateGroupMembers.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupAdmin": { - aminoType: "cosmos-sdk/MsgUpdateGroupAdmin", - toAmino: MsgUpdateGroupAdmin.toAmino, - fromAmino: MsgUpdateGroupAdmin.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupMetadata": { - aminoType: "cosmos-sdk/MsgUpdateGroupMetadata", - toAmino: MsgUpdateGroupMetadata.toAmino, - fromAmino: MsgUpdateGroupMetadata.fromAmino - }, - "/cosmos.group.v1.MsgCreateGroupPolicy": { - aminoType: "cosmos-sdk/MsgCreateGroupPolicy", - toAmino: MsgCreateGroupPolicy.toAmino, - fromAmino: MsgCreateGroupPolicy.fromAmino - }, - "/cosmos.group.v1.MsgCreateGroupWithPolicy": { - aminoType: "cosmos-sdk/MsgCreateGroupWithPolicy", - toAmino: MsgCreateGroupWithPolicy.toAmino, - fromAmino: MsgCreateGroupWithPolicy.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin": { - aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", - toAmino: MsgUpdateGroupPolicyAdmin.toAmino, - fromAmino: MsgUpdateGroupPolicyAdmin.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy": { - aminoType: "cosmos-sdk/MsgUpdateGroupDecisionPolicy", - toAmino: MsgUpdateGroupPolicyDecisionPolicy.toAmino, - fromAmino: MsgUpdateGroupPolicyDecisionPolicy.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata": { - aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", - toAmino: MsgUpdateGroupPolicyMetadata.toAmino, - fromAmino: MsgUpdateGroupPolicyMetadata.fromAmino - }, - "/cosmos.group.v1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/group/MsgSubmitProposal", - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino - }, - "/cosmos.group.v1.MsgWithdrawProposal": { - aminoType: "cosmos-sdk/group/MsgWithdrawProposal", - toAmino: MsgWithdrawProposal.toAmino, - fromAmino: MsgWithdrawProposal.fromAmino - }, - "/cosmos.group.v1.MsgVote": { - aminoType: "cosmos-sdk/group/MsgVote", - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino - }, - "/cosmos.group.v1.MsgExec": { - aminoType: "cosmos-sdk/group/MsgExec", - toAmino: MsgExec.toAmino, - fromAmino: MsgExec.fromAmino - }, - "/cosmos.group.v1.MsgLeaveGroup": { - aminoType: "cosmos-sdk/group/MsgLeaveGroup", - toAmino: MsgLeaveGroup.toAmino, - fromAmino: MsgLeaveGroup.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/group/v1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/group/v1/tx.rpc.func.ts new file mode 100644 index 00000000..28648bdd --- /dev/null +++ b/libs/injective-vue/src/cosmos/group/v1/tx.rpc.func.ts @@ -0,0 +1,87 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const createCreateGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroup.typeUrl, + encoders: toEncoders(MsgCreateGroup), + converters: toConverters(MsgCreateGroup) +}); +export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMembers.typeUrl, + encoders: toEncoders(MsgUpdateGroupMembers), + converters: toConverters(MsgUpdateGroupMembers) +}); +export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupAdmin), + converters: toConverters(MsgUpdateGroupAdmin) +}); +export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupMetadata), + converters: toConverters(MsgUpdateGroupMetadata) +}); +export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupPolicy), + converters: toConverters(MsgCreateGroupPolicy) +}); +export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupWithPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupWithPolicy), + converters: toConverters(MsgCreateGroupWithPolicy) +}); +export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyAdmin), + converters: toConverters(MsgUpdateGroupPolicyAdmin) +}); +export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyDecisionPolicy.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyDecisionPolicy), + converters: toConverters(MsgUpdateGroupPolicyDecisionPolicy) +}); +export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyMetadata), + converters: toConverters(MsgUpdateGroupPolicyMetadata) +}); +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createWithdrawProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawProposal.typeUrl, + encoders: toEncoders(MsgWithdrawProposal), + converters: toConverters(MsgWithdrawProposal) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const createLeaveGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgLeaveGroup.typeUrl, + encoders: toEncoders(MsgLeaveGroup), + converters: toConverters(MsgLeaveGroup) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/group/v1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/group/v1/tx.rpc.msg.ts deleted file mode 100644 index 46e7fb32..00000000 --- a/libs/injective-vue/src/cosmos/group/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateGroup, MsgCreateGroupResponse, MsgUpdateGroupMembers, MsgUpdateGroupMembersResponse, MsgUpdateGroupAdmin, MsgUpdateGroupAdminResponse, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataResponse, MsgCreateGroupPolicy, MsgCreateGroupPolicyResponse, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicyResponse, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminResponse, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicyResponse, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataResponse, MsgSubmitProposal, MsgSubmitProposalResponse, MsgWithdrawProposal, MsgWithdrawProposalResponse, MsgVote, MsgVoteResponse, MsgExec, MsgExecResponse, MsgLeaveGroup, MsgLeaveGroupResponse } from "./tx"; -/** Msg is the cosmos.group.v1 Msg service. */ -export interface Msg { - /** CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. */ - createGroup(request: MsgCreateGroup): Promise; - /** UpdateGroupMembers updates the group members with given group id and admin address. */ - updateGroupMembers(request: MsgUpdateGroupMembers): Promise; - /** UpdateGroupAdmin updates the group admin with given group id and previous admin address. */ - updateGroupAdmin(request: MsgUpdateGroupAdmin): Promise; - /** UpdateGroupMetadata updates the group metadata with given group id and admin address. */ - updateGroupMetadata(request: MsgUpdateGroupMetadata): Promise; - /** CreateGroupPolicy creates a new group policy using given DecisionPolicy. */ - createGroupPolicy(request: MsgCreateGroupPolicy): Promise; - /** CreateGroupWithPolicy creates a new group with policy. */ - createGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise; - /** UpdateGroupPolicyAdmin updates a group policy admin. */ - updateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise; - /** UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. */ - updateGroupPolicyDecisionPolicy(request: MsgUpdateGroupPolicyDecisionPolicy): Promise; - /** UpdateGroupPolicyMetadata updates a group policy metadata. */ - updateGroupPolicyMetadata(request: MsgUpdateGroupPolicyMetadata): Promise; - /** SubmitProposal submits a new proposal. */ - submitProposal(request: MsgSubmitProposal): Promise; - /** WithdrawProposal withdraws a proposal. */ - withdrawProposal(request: MsgWithdrawProposal): Promise; - /** Vote allows a voter to vote on a proposal. */ - vote(request: MsgVote): Promise; - /** Exec executes a proposal. */ - exec(request: MsgExec): Promise; - /** LeaveGroup allows a group member to leave the group. */ - leaveGroup(request: MsgLeaveGroup): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. */ - createGroup = async (request: MsgCreateGroup): Promise => { - const data = MsgCreateGroup.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroup", data); - return promise.then(data => MsgCreateGroupResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupMembers updates the group members with given group id and admin address. */ - updateGroupMembers = async (request: MsgUpdateGroupMembers): Promise => { - const data = MsgUpdateGroupMembers.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMembers", data); - return promise.then(data => MsgUpdateGroupMembersResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupAdmin updates the group admin with given group id and previous admin address. */ - updateGroupAdmin = async (request: MsgUpdateGroupAdmin): Promise => { - const data = MsgUpdateGroupAdmin.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupAdmin", data); - return promise.then(data => MsgUpdateGroupAdminResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupMetadata updates the group metadata with given group id and admin address. */ - updateGroupMetadata = async (request: MsgUpdateGroupMetadata): Promise => { - const data = MsgUpdateGroupMetadata.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMetadata", data); - return promise.then(data => MsgUpdateGroupMetadataResponse.decode(new BinaryReader(data))); - }; - /* CreateGroupPolicy creates a new group policy using given DecisionPolicy. */ - createGroupPolicy = async (request: MsgCreateGroupPolicy): Promise => { - const data = MsgCreateGroupPolicy.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupPolicy", data); - return promise.then(data => MsgCreateGroupPolicyResponse.decode(new BinaryReader(data))); - }; - /* CreateGroupWithPolicy creates a new group with policy. */ - createGroupWithPolicy = async (request: MsgCreateGroupWithPolicy): Promise => { - const data = MsgCreateGroupWithPolicy.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupWithPolicy", data); - return promise.then(data => MsgCreateGroupWithPolicyResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupPolicyAdmin updates a group policy admin. */ - updateGroupPolicyAdmin = async (request: MsgUpdateGroupPolicyAdmin): Promise => { - const data = MsgUpdateGroupPolicyAdmin.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyAdmin", data); - return promise.then(data => MsgUpdateGroupPolicyAdminResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. */ - updateGroupPolicyDecisionPolicy = async (request: MsgUpdateGroupPolicyDecisionPolicy): Promise => { - const data = MsgUpdateGroupPolicyDecisionPolicy.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyDecisionPolicy", data); - return promise.then(data => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupPolicyMetadata updates a group policy metadata. */ - updateGroupPolicyMetadata = async (request: MsgUpdateGroupPolicyMetadata): Promise => { - const data = MsgUpdateGroupPolicyMetadata.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyMetadata", data); - return promise.then(data => MsgUpdateGroupPolicyMetadataResponse.decode(new BinaryReader(data))); - }; - /* SubmitProposal submits a new proposal. */ - submitProposal = async (request: MsgSubmitProposal): Promise => { - const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "SubmitProposal", data); - return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); - }; - /* WithdrawProposal withdraws a proposal. */ - withdrawProposal = async (request: MsgWithdrawProposal): Promise => { - const data = MsgWithdrawProposal.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "WithdrawProposal", data); - return promise.then(data => MsgWithdrawProposalResponse.decode(new BinaryReader(data))); - }; - /* Vote allows a voter to vote on a proposal. */ - vote = async (request: MsgVote): Promise => { - const data = MsgVote.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "Vote", data); - return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); - }; - /* Exec executes a proposal. */ - exec = async (request: MsgExec): Promise => { - const data = MsgExec.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "Exec", data); - return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); - }; - /* LeaveGroup allows a group member to leave the group. */ - leaveGroup = async (request: MsgLeaveGroup): Promise => { - const data = MsgLeaveGroup.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "LeaveGroup", data); - return promise.then(data => MsgLeaveGroupResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..ed9a30e0 --- /dev/null +++ b/libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts @@ -0,0 +1,45 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +export const useCreateGroup = buildUseVueMutation({ + builderMutationFn: createCreateGroup +}); +export const useUpdateGroupMembers = buildUseVueMutation({ + builderMutationFn: createUpdateGroupMembers +}); +export const useUpdateGroupAdmin = buildUseVueMutation({ + builderMutationFn: createUpdateGroupAdmin +}); +export const useUpdateGroupMetadata = buildUseVueMutation({ + builderMutationFn: createUpdateGroupMetadata +}); +export const useCreateGroupPolicy = buildUseVueMutation({ + builderMutationFn: createCreateGroupPolicy +}); +export const useCreateGroupWithPolicy = buildUseVueMutation({ + builderMutationFn: createCreateGroupWithPolicy +}); +export const useUpdateGroupPolicyAdmin = buildUseVueMutation({ + builderMutationFn: createUpdateGroupPolicyAdmin +}); +export const useUpdateGroupPolicyDecisionPolicy = buildUseVueMutation({ + builderMutationFn: createUpdateGroupPolicyDecisionPolicy +}); +export const useUpdateGroupPolicyMetadata = buildUseVueMutation({ + builderMutationFn: createUpdateGroupPolicyMetadata +}); +export const useSubmitProposal = buildUseVueMutation({ + builderMutationFn: createSubmitProposal +}); +export const useWithdrawProposal = buildUseVueMutation({ + builderMutationFn: createWithdrawProposal +}); +export const useVote = buildUseVueMutation({ + builderMutationFn: createVote +}); +export const useExec = buildUseVueMutation({ + builderMutationFn: createExec +}); +export const useLeaveGroup = buildUseVueMutation({ + builderMutationFn: createLeaveGroup +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/group/v1/tx.ts b/libs/injective-vue/src/cosmos/group/v1/tx.ts index 636a0e89..492b0084 100644 --- a/libs/injective-vue/src/cosmos/group/v1/tx.ts +++ b/libs/injective-vue/src/cosmos/group/v1/tx.ts @@ -3,7 +3,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Exec defines modes of execution of a proposal on creation or on new vote. */ export enum Exec { /** @@ -55,11 +54,6 @@ export interface MsgCreateGroup { /** metadata is any arbitrary metadata to attached to the group. */ metadata: string; } -export interface ReactiveMsgCreateGroup { - admin: ComputedRef; - members: ComputedRef; - metadata: ComputedRef; -} export interface MsgCreateGroupProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroup"; value: Uint8Array; @@ -82,9 +76,6 @@ export interface MsgCreateGroupResponse { /** group_id is the unique ID of the newly created group. */ groupId: bigint; } -export interface ReactiveMsgCreateGroupResponse { - groupId: ComputedRef; -} export interface MsgCreateGroupResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse"; value: Uint8Array; @@ -110,11 +101,6 @@ export interface MsgUpdateGroupMembers { */ memberUpdates: MemberRequest[]; } -export interface ReactiveMsgUpdateGroupMembers { - admin: ComputedRef; - groupId: ComputedRef; - memberUpdates: ComputedRef; -} export interface MsgUpdateGroupMembersProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers"; value: Uint8Array; @@ -137,7 +123,6 @@ export interface MsgUpdateGroupMembersAminoMsg { } /** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ export interface MsgUpdateGroupMembersResponse {} -export interface ReactiveMsgUpdateGroupMembersResponse {} export interface MsgUpdateGroupMembersResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse"; value: Uint8Array; @@ -157,11 +142,6 @@ export interface MsgUpdateGroupAdmin { /** new_admin is the group new admin account address. */ newAdmin: string; } -export interface ReactiveMsgUpdateGroupAdmin { - admin: ComputedRef; - groupId: ComputedRef; - newAdmin: ComputedRef; -} export interface MsgUpdateGroupAdminProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin"; value: Uint8Array; @@ -181,7 +161,6 @@ export interface MsgUpdateGroupAdminAminoMsg { } /** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ export interface MsgUpdateGroupAdminResponse {} -export interface ReactiveMsgUpdateGroupAdminResponse {} export interface MsgUpdateGroupAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse"; value: Uint8Array; @@ -201,11 +180,6 @@ export interface MsgUpdateGroupMetadata { /** metadata is the updated group's metadata. */ metadata: string; } -export interface ReactiveMsgUpdateGroupMetadata { - admin: ComputedRef; - groupId: ComputedRef; - metadata: ComputedRef; -} export interface MsgUpdateGroupMetadataProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata"; value: Uint8Array; @@ -225,7 +199,6 @@ export interface MsgUpdateGroupMetadataAminoMsg { } /** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ export interface MsgUpdateGroupMetadataResponse {} -export interface ReactiveMsgUpdateGroupMetadataResponse {} export interface MsgUpdateGroupMetadataResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse"; value: Uint8Array; @@ -247,12 +220,6 @@ export interface MsgCreateGroupPolicy { /** decision_policy specifies the group policy's decision policy. */ decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; } -export interface ReactiveMsgCreateGroupPolicy { - admin: ComputedRef; - groupId: ComputedRef; - metadata: ComputedRef; - decisionPolicy?: ComputedRef; -} export interface MsgCreateGroupPolicyProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; value: Uint8Array; @@ -280,9 +247,6 @@ export interface MsgCreateGroupPolicyResponse { /** address is the account address of the newly created group policy. */ address: string; } -export interface ReactiveMsgCreateGroupPolicyResponse { - address: ComputedRef; -} export interface MsgCreateGroupPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse"; value: Uint8Array; @@ -305,11 +269,6 @@ export interface MsgUpdateGroupPolicyAdmin { /** new_admin is the new group policy admin. */ newAdmin: string; } -export interface ReactiveMsgUpdateGroupPolicyAdmin { - admin: ComputedRef; - groupPolicyAddress: ComputedRef; - newAdmin: ComputedRef; -} export interface MsgUpdateGroupPolicyAdminProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin"; value: Uint8Array; @@ -329,7 +288,6 @@ export interface MsgUpdateGroupPolicyAdminAminoMsg { } /** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ export interface MsgUpdateGroupPolicyAdminResponse {} -export interface ReactiveMsgUpdateGroupPolicyAdminResponse {} export interface MsgUpdateGroupPolicyAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse"; value: Uint8Array; @@ -358,14 +316,6 @@ export interface MsgCreateGroupWithPolicy { /** decision_policy specifies the group policy's decision policy. */ decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; } -export interface ReactiveMsgCreateGroupWithPolicy { - admin: ComputedRef; - members: ComputedRef; - groupMetadata: ComputedRef; - groupPolicyMetadata: ComputedRef; - groupPolicyAsAdmin: ComputedRef; - decisionPolicy?: ComputedRef; -} export interface MsgCreateGroupWithPolicyProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy"; value: Uint8Array; @@ -402,10 +352,6 @@ export interface MsgCreateGroupWithPolicyResponse { /** group_policy_address is the account address of the newly created group policy. */ groupPolicyAddress: string; } -export interface ReactiveMsgCreateGroupWithPolicyResponse { - groupId: ComputedRef; - groupPolicyAddress: ComputedRef; -} export interface MsgCreateGroupWithPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse"; value: Uint8Array; @@ -430,11 +376,6 @@ export interface MsgUpdateGroupPolicyDecisionPolicy { /** decision_policy is the updated group policy's decision policy. */ decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; } -export interface ReactiveMsgUpdateGroupPolicyDecisionPolicy { - admin: ComputedRef; - groupPolicyAddress: ComputedRef; - decisionPolicy?: ComputedRef; -} export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy"; value: Uint8Array; @@ -457,7 +398,6 @@ export interface MsgUpdateGroupPolicyDecisionPolicyAminoMsg { } /** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ export interface MsgUpdateGroupPolicyDecisionPolicyResponse {} -export interface ReactiveMsgUpdateGroupPolicyDecisionPolicyResponse {} export interface MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse"; value: Uint8Array; @@ -477,11 +417,6 @@ export interface MsgUpdateGroupPolicyMetadata { /** metadata is the group policy metadata to be updated. */ metadata: string; } -export interface ReactiveMsgUpdateGroupPolicyMetadata { - admin: ComputedRef; - groupPolicyAddress: ComputedRef; - metadata: ComputedRef; -} export interface MsgUpdateGroupPolicyMetadataProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata"; value: Uint8Array; @@ -501,7 +436,6 @@ export interface MsgUpdateGroupPolicyMetadataAminoMsg { } /** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ export interface MsgUpdateGroupPolicyMetadataResponse {} -export interface ReactiveMsgUpdateGroupPolicyMetadataResponse {} export interface MsgUpdateGroupPolicyMetadataResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse"; value: Uint8Array; @@ -544,15 +478,6 @@ export interface MsgSubmitProposal { */ summary: string; } -export interface ReactiveMsgSubmitProposal { - groupPolicyAddress: ComputedRef; - proposers: ComputedRef; - metadata: ComputedRef; - messages: ComputedRef; - exec: ComputedRef; - title: ComputedRef; - summary: ComputedRef; -} export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.group.v1.MsgSubmitProposal"; value: Uint8Array; @@ -598,9 +523,6 @@ export interface MsgSubmitProposalResponse { /** proposal is the unique ID of the proposal. */ proposalId: bigint; } -export interface ReactiveMsgSubmitProposalResponse { - proposalId: ComputedRef; -} export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse"; value: Uint8Array; @@ -621,10 +543,6 @@ export interface MsgWithdrawProposal { /** address is the admin of the group policy or one of the proposer of the proposal. */ address: string; } -export interface ReactiveMsgWithdrawProposal { - proposalId: ComputedRef; - address: ComputedRef; -} export interface MsgWithdrawProposalProtoMsg { typeUrl: "/cosmos.group.v1.MsgWithdrawProposal"; value: Uint8Array; @@ -642,7 +560,6 @@ export interface MsgWithdrawProposalAminoMsg { } /** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ export interface MsgWithdrawProposalResponse {} -export interface ReactiveMsgWithdrawProposalResponse {} export interface MsgWithdrawProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse"; value: Uint8Array; @@ -669,13 +586,6 @@ export interface MsgVote { */ exec: Exec; } -export interface ReactiveMsgVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - metadata: ComputedRef; - exec: ComputedRef; -} export interface MsgVoteProtoMsg { typeUrl: "/cosmos.group.v1.MsgVote"; value: Uint8Array; @@ -702,7 +612,6 @@ export interface MsgVoteAminoMsg { } /** MsgVoteResponse is the Msg/Vote response type. */ export interface MsgVoteResponse {} -export interface ReactiveMsgVoteResponse {} export interface MsgVoteResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgVoteResponse"; value: Uint8Array; @@ -720,10 +629,6 @@ export interface MsgExec { /** executor is the account address used to execute the proposal. */ executor: string; } -export interface ReactiveMsgExec { - proposalId: ComputedRef; - executor: ComputedRef; -} export interface MsgExecProtoMsg { typeUrl: "/cosmos.group.v1.MsgExec"; value: Uint8Array; @@ -744,9 +649,6 @@ export interface MsgExecResponse { /** result is the final result of the proposal execution. */ result: ProposalExecutorResult; } -export interface ReactiveMsgExecResponse { - result: ComputedRef; -} export interface MsgExecResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgExecResponse"; value: Uint8Array; @@ -767,10 +669,6 @@ export interface MsgLeaveGroup { /** group_id is the unique ID of the group. */ groupId: bigint; } -export interface ReactiveMsgLeaveGroup { - address: ComputedRef; - groupId: ComputedRef; -} export interface MsgLeaveGroupProtoMsg { typeUrl: "/cosmos.group.v1.MsgLeaveGroup"; value: Uint8Array; @@ -788,7 +686,6 @@ export interface MsgLeaveGroupAminoMsg { } /** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ export interface MsgLeaveGroupResponse {} -export interface ReactiveMsgLeaveGroupResponse {} export interface MsgLeaveGroupResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/group/v1/types.ts b/libs/injective-vue/src/cosmos/group/v1/types.ts index 1c1a10b4..f8e9c860 100644 --- a/libs/injective-vue/src/cosmos/group/v1/types.ts +++ b/libs/injective-vue/src/cosmos/group/v1/types.ts @@ -4,7 +4,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** VoteOption enumerates the valid vote options for a given proposal. */ export enum VoteOption { /** @@ -199,12 +198,6 @@ export interface Member { /** added_at is a timestamp specifying when a member was added. */ addedAt: Date; } -export interface ReactiveMember { - address: ComputedRef; - weight: ComputedRef; - metadata: ComputedRef; - addedAt: ComputedRef; -} export interface MemberProtoMsg { typeUrl: "/cosmos.group.v1.Member"; value: Uint8Array; @@ -240,11 +233,6 @@ export interface MemberRequest { /** metadata is any arbitrary metadata attached to the member. */ metadata: string; } -export interface ReactiveMemberRequest { - address: ComputedRef; - weight: ComputedRef; - metadata: ComputedRef; -} export interface MemberRequestProtoMsg { typeUrl: "/cosmos.group.v1.MemberRequest"; value: Uint8Array; @@ -283,10 +271,6 @@ export interface ThresholdDecisionPolicy { /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindows; } -export interface ReactiveThresholdDecisionPolicy { - threshold: ComputedRef; - windows?: ComputedRef; -} export interface ThresholdDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy"; value: Uint8Array; @@ -329,10 +313,6 @@ export interface PercentageDecisionPolicy { /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindows; } -export interface ReactivePercentageDecisionPolicy { - percentage: ComputedRef; - windows?: ComputedRef; -} export interface PercentageDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy"; value: Uint8Array; @@ -380,10 +360,6 @@ export interface DecisionPolicyWindows { */ minExecutionPeriod: Duration; } -export interface ReactiveDecisionPolicyWindows { - votingPeriod: ComputedRef; - minExecutionPeriod: ComputedRef; -} export interface DecisionPolicyWindowsProtoMsg { typeUrl: "/cosmos.group.v1.DecisionPolicyWindows"; value: Uint8Array; @@ -437,14 +413,6 @@ export interface GroupInfo { /** created_at is a timestamp specifying when a group was created. */ createdAt: Date; } -export interface ReactiveGroupInfo { - id: ComputedRef; - admin: ComputedRef; - metadata: ComputedRef; - version: ComputedRef; - totalWeight: ComputedRef; - createdAt: ComputedRef; -} export interface GroupInfoProtoMsg { typeUrl: "/cosmos.group.v1.GroupInfo"; value: Uint8Array; @@ -483,10 +451,6 @@ export interface GroupMember { /** member is the member data. */ member?: Member; } -export interface ReactiveGroupMember { - groupId: ComputedRef; - member?: ComputedRef; -} export interface GroupMemberProtoMsg { typeUrl: "/cosmos.group.v1.GroupMember"; value: Uint8Array; @@ -526,15 +490,6 @@ export interface GroupPolicyInfo { /** created_at is a timestamp specifying when a group policy was created. */ createdAt: Date; } -export interface ReactiveGroupPolicyInfo { - address: ComputedRef; - groupId: ComputedRef; - admin: ComputedRef; - metadata: ComputedRef; - version: ComputedRef; - decisionPolicy?: ComputedRef; - createdAt: ComputedRef; -} export interface GroupPolicyInfoProtoMsg { typeUrl: "/cosmos.group.v1.GroupPolicyInfo"; value: Uint8Array; @@ -637,22 +592,6 @@ export interface Proposal { */ summary: string; } -export interface ReactiveProposal { - id: ComputedRef; - groupPolicyAddress: ComputedRef; - metadata: ComputedRef; - proposers: ComputedRef; - submitTime: ComputedRef; - groupVersion: ComputedRef; - groupPolicyVersion: ComputedRef; - status: ComputedRef; - finalTallyResult: ComputedRef; - votingPeriodEnd: ComputedRef; - executorResult: ComputedRef; - messages: ComputedRef; - title: ComputedRef; - summary: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/cosmos.group.v1.Proposal"; value: Uint8Array; @@ -739,12 +678,6 @@ export interface TallyResult { /** no_with_veto_count is the weighted sum of veto. */ noWithVetoCount: string; } -export interface ReactiveTallyResult { - yesCount: ComputedRef; - abstainCount: ComputedRef; - noCount: ComputedRef; - noWithVetoCount: ComputedRef; -} export interface TallyResultProtoMsg { typeUrl: "/cosmos.group.v1.TallyResult"; value: Uint8Array; @@ -780,13 +713,6 @@ export interface Vote { /** submit_time is the timestamp when the vote was submitted. */ submitTime: Date; } -export interface ReactiveVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - metadata: ComputedRef; - submitTime: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/cosmos.group.v1.Vote"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/ics23/v1/proofs.ts b/libs/injective-vue/src/cosmos/ics23/v1/proofs.ts index bdefd7f7..30e1bc14 100644 --- a/libs/injective-vue/src/cosmos/ics23/v1/proofs.ts +++ b/libs/injective-vue/src/cosmos/ics23/v1/proofs.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; 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, @@ -198,12 +197,6 @@ export interface ExistenceProof { leaf?: LeafOp; path: InnerOp[]; } -export interface ReactiveExistenceProof { - key: ComputedRef; - value: ComputedRef; - leaf?: ComputedRef; - path: ComputedRef; -} export interface ExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.ExistenceProof"; value: Uint8Array; @@ -250,11 +243,6 @@ export interface NonExistenceProof { left?: ExistenceProof; right?: ExistenceProof; } -export interface ReactiveNonExistenceProof { - key: ComputedRef; - left?: ComputedRef; - right?: ComputedRef; -} export interface NonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.NonExistenceProof"; value: Uint8Array; @@ -281,12 +269,6 @@ export interface CommitmentProof { batch?: BatchProof; compressed?: CompressedBatchProof; } -export interface ReactiveCommitmentProof { - exist?: ComputedRef; - nonexist?: ComputedRef; - batch?: ComputedRef; - compressed?: ComputedRef; -} export interface CommitmentProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CommitmentProof"; value: Uint8Array; @@ -329,13 +311,6 @@ export interface LeafOp { */ prefix: Uint8Array; } -export interface ReactiveLeafOp { - hash: ComputedRef; - prehashKey: ComputedRef; - prehashValue: ComputedRef; - length: ComputedRef; - prefix: ComputedRef; -} export interface LeafOpProtoMsg { typeUrl: "/cosmos.ics23.v1.LeafOp"; value: Uint8Array; @@ -393,11 +368,6 @@ export interface InnerOp { prefix: Uint8Array; suffix: Uint8Array; } -export interface ReactiveInnerOp { - hash: ComputedRef; - prefix: ComputedRef; - suffix: ComputedRef; -} export interface InnerOpProtoMsg { typeUrl: "/cosmos.ics23.v1.InnerOp"; value: Uint8Array; @@ -461,13 +431,6 @@ export interface ProofSpec { */ prehashKeyBeforeComparison: boolean; } -export interface ReactiveProofSpec { - leafSpec?: ComputedRef; - innerSpec?: ComputedRef; - maxDepth: ComputedRef; - minDepth: ComputedRef; - prehashKeyBeforeComparison: ComputedRef; -} export interface ProofSpecProtoMsg { typeUrl: "/cosmos.ics23.v1.ProofSpec"; value: Uint8Array; @@ -535,14 +498,6 @@ export interface InnerSpec { /** hash is the algorithm that must be used for each InnerOp */ hash: HashOp; } -export interface ReactiveInnerSpec { - childOrder: ComputedRef; - childSize: ComputedRef; - minPrefixLength: ComputedRef; - maxPrefixLength: ComputedRef; - emptyChild: ComputedRef; - hash: ComputedRef; -} export interface InnerSpecProtoMsg { typeUrl: "/cosmos.ics23.v1.InnerSpec"; value: Uint8Array; @@ -581,9 +536,6 @@ export interface InnerSpecAminoMsg { export interface BatchProof { entries: BatchEntry[]; } -export interface ReactiveBatchProof { - entries: ComputedRef; -} export interface BatchProofProtoMsg { typeUrl: "/cosmos.ics23.v1.BatchProof"; value: Uint8Array; @@ -601,10 +553,6 @@ export interface BatchEntry { exist?: ExistenceProof; nonexist?: NonExistenceProof; } -export interface ReactiveBatchEntry { - exist?: ComputedRef; - nonexist?: ComputedRef; -} export interface BatchEntryProtoMsg { typeUrl: "/cosmos.ics23.v1.BatchEntry"; value: Uint8Array; @@ -622,10 +570,6 @@ export interface CompressedBatchProof { entries: CompressedBatchEntry[]; lookupInners: InnerOp[]; } -export interface ReactiveCompressedBatchProof { - entries: ComputedRef; - lookupInners: ComputedRef; -} export interface CompressedBatchProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedBatchProof"; value: Uint8Array; @@ -643,10 +587,6 @@ export interface CompressedBatchEntry { exist?: CompressedExistenceProof; nonexist?: CompressedNonExistenceProof; } -export interface ReactiveCompressedBatchEntry { - exist?: ComputedRef; - nonexist?: ComputedRef; -} export interface CompressedBatchEntryProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry"; value: Uint8Array; @@ -667,12 +607,6 @@ export interface CompressedExistenceProof { /** these are indexes into the lookup_inners table in CompressedBatchProof */ path: number[]; } -export interface ReactiveCompressedExistenceProof { - key: ComputedRef; - value: ComputedRef; - leaf?: ComputedRef; - path: ComputedRef; -} export interface CompressedExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof"; value: Uint8Array; @@ -694,11 +628,6 @@ export interface CompressedNonExistenceProof { left?: CompressedExistenceProof; right?: CompressedExistenceProof; } -export interface ReactiveCompressedNonExistenceProof { - key: ComputedRef; - left?: ComputedRef; - right?: ComputedRef; -} export interface CompressedNonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/rpc.query.ts b/libs/injective-vue/src/cosmos/rpc.query.ts deleted file mode 100644 index a650d80e..00000000 --- a/libs/injective-vue/src/cosmos/rpc.query.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import { QueryClient } from "@cosmjs/stargate"; -export const createRPCQueryClient = async ({ - rpcEndpoint -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - cosmos: { - auth: { - v1beta1: (await import("./auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - bank: { - v1beta1: (await import("./bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - gov: { - v1beta1: (await import("./gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - staking: { - v1beta1: (await import("./staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - tx: { - v1beta1: (await import("./tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) - } - } - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/rpc.tx.ts b/libs/injective-vue/src/cosmos/rpc.tx.ts deleted file mode 100644 index 983ebb25..00000000 --- a/libs/injective-vue/src/cosmos/rpc.tx.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - authz: { - v1beta1: new (await import("./authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("./bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("./distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("./feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("./gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("./gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("./group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("./staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("./vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - } -}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 9ffb8eb9..00000000 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,720 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse, ReactiveQueryValidatorsRequest, ReactiveQueryValidatorRequest, ReactiveQueryValidatorDelegationsRequest, ReactiveQueryValidatorUnbondingDelegationsRequest, ReactiveQueryDelegationRequest, ReactiveQueryUnbondingDelegationRequest, ReactiveQueryDelegatorDelegationsRequest, ReactiveQueryDelegatorUnbondingDelegationsRequest, ReactiveQueryRedelegationsRequest, ReactiveQueryDelegatorValidatorsRequest, ReactiveQueryDelegatorValidatorRequest, ReactiveQueryHistoricalInfoRequest, ReactiveQueryPoolRequest, ReactiveQueryParamsRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * 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. - * - * 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): Promise; - /** Delegation queries delegate info for given validator delegator pair. */ - delegation(request: QueryDelegationRequest): Promise; - /** - * UnbondingDelegation queries unbonding info for given validator delegator - * pair. - */ - 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): 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; - /** - * DelegatorValidator queries validator info for given delegator validator - * pair. - */ - delegatorValidator(request: QueryDelegatorValidatorRequest): Promise; - /** HistoricalInfo queries the historical info for given height. */ - historicalInfo(request: QueryHistoricalInfoRequest): Promise; - /** Pool queries the pool info. */ - pool(request?: QueryPoolRequest): Promise; - /** Parameters queries the staking parameters. */ - params(request?: QueryParamsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* 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 = async (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 BinaryReader(data))); - }; - /* Validator queries validator info for given validator address. */ - validator = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* Delegation queries delegate info for given validator delegator pair. */ - delegation = async (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 BinaryReader(data))); - }; - /* UnbondingDelegation queries unbonding info for given validator delegator - pair. */ - unbondingDelegation = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* DelegatorValidator queries validator info for given delegator validator - pair. */ - delegatorValidator = async (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 BinaryReader(data))); - }; - /* HistoricalInfo queries the historical info for given height. */ - historicalInfo = async (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 BinaryReader(data))); - }; - /* Pool queries the pool info. */ - pool = async (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 BinaryReader(data))); - }; - /* Parameters queries the staking parameters. */ - params = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - validators(request: QueryValidatorsRequest): Promise { - return queryService.validators(request); - }, - validator(request: QueryValidatorRequest): Promise { - return queryService.validator(request); - }, - validatorDelegations(request: QueryValidatorDelegationsRequest): Promise { - return queryService.validatorDelegations(request); - }, - validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise { - return queryService.validatorUnbondingDelegations(request); - }, - delegation(request: QueryDelegationRequest): Promise { - return queryService.delegation(request); - }, - unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { - return queryService.unbondingDelegation(request); - }, - delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise { - return queryService.delegatorDelegations(request); - }, - delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise { - return queryService.delegatorUnbondingDelegations(request); - }, - redelegations(request: QueryRedelegationsRequest): Promise { - return queryService.redelegations(request); - }, - delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { - return queryService.delegatorValidators(request); - }, - delegatorValidator(request: QueryDelegatorValidatorRequest): Promise { - return queryService.delegatorValidator(request); - }, - historicalInfo(request: QueryHistoricalInfoRequest): Promise { - return queryService.historicalInfo(request); - }, - pool(request?: QueryPoolRequest): Promise { - return queryService.pool(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - } - }; -}; -export interface UseValidatorsQuery extends VueQueryParams { - request: ReactiveQueryValidatorsRequest; -} -export interface UseValidatorQuery extends VueQueryParams { - request: ReactiveQueryValidatorRequest; -} -export interface UseValidatorDelegationsQuery extends VueQueryParams { - request: ReactiveQueryValidatorDelegationsRequest; -} -export interface UseValidatorUnbondingDelegationsQuery extends VueQueryParams { - request: ReactiveQueryValidatorUnbondingDelegationsRequest; -} -export interface UseDelegationQuery extends VueQueryParams { - request: ReactiveQueryDelegationRequest; -} -export interface UseUnbondingDelegationQuery extends VueQueryParams { - request: ReactiveQueryUnbondingDelegationRequest; -} -export interface UseDelegatorDelegationsQuery extends VueQueryParams { - request: ReactiveQueryDelegatorDelegationsRequest; -} -export interface UseDelegatorUnbondingDelegationsQuery extends VueQueryParams { - request: ReactiveQueryDelegatorUnbondingDelegationsRequest; -} -export interface UseRedelegationsQuery extends VueQueryParams { - request: ReactiveQueryRedelegationsRequest; -} -export interface UseDelegatorValidatorsQuery extends VueQueryParams { - request: ReactiveQueryDelegatorValidatorsRequest; -} -export interface UseDelegatorValidatorQuery extends VueQueryParams { - request: ReactiveQueryDelegatorValidatorRequest; -} -export interface UseHistoricalInfoQuery extends VueQueryParams { - request: ReactiveQueryHistoricalInfoRequest; -} -export interface UsePoolQuery extends VueQueryParams { - request?: ReactiveQueryPoolRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useValidators = ({ - request, - options - }: UseValidatorsQuery) => { - const queryKey = ["validatorsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validators(params); - }, - ...options - }); - }; - const useValidator = ({ - request, - options - }: UseValidatorQuery) => { - const queryKey = ["validatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validator(params); - }, - ...options - }); - }; - const useValidatorDelegations = ({ - request, - options - }: UseValidatorDelegationsQuery) => { - const queryKey = ["validatorDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorDelegations(params); - }, - ...options - }); - }; - const useValidatorUnbondingDelegations = ({ - request, - options - }: UseValidatorUnbondingDelegationsQuery) => { - const queryKey = ["validatorUnbondingDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorUnbondingDelegations(params); - }, - ...options - }); - }; - const useDelegation = ({ - request, - options - }: UseDelegationQuery) => { - const queryKey = ["delegationQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegation(params); - }, - ...options - }); - }; - const useUnbondingDelegation = ({ - request, - options - }: UseUnbondingDelegationQuery) => { - const queryKey = ["unbondingDelegationQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.unbondingDelegation(params); - }, - ...options - }); - }; - const useDelegatorDelegations = ({ - request, - options - }: UseDelegatorDelegationsQuery) => { - const queryKey = ["delegatorDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorDelegations(params); - }, - ...options - }); - }; - const useDelegatorUnbondingDelegations = ({ - request, - options - }: UseDelegatorUnbondingDelegationsQuery) => { - const queryKey = ["delegatorUnbondingDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorUnbondingDelegations(params); - }, - ...options - }); - }; - const useRedelegations = ({ - request, - options - }: UseRedelegationsQuery) => { - const queryKey = ["redelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.redelegations(params); - }, - ...options - }); - }; - const useDelegatorValidators = ({ - request, - options - }: UseDelegatorValidatorsQuery) => { - const queryKey = ["delegatorValidatorsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorValidators(params); - }, - ...options - }); - }; - const useDelegatorValidator = ({ - request, - options - }: UseDelegatorValidatorQuery) => { - const queryKey = ["delegatorValidatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorValidator(params); - }, - ...options - }); - }; - const useHistoricalInfo = ({ - request, - options - }: UseHistoricalInfoQuery) => { - const queryKey = ["historicalInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.historicalInfo(params); - }, - ...options - }); - }; - const usePool = ({ - request, - options - }: UsePoolQuery) => { - const queryKey = ["poolQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pool(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - return { - /** - * 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. - */ - useValidators, - /** Validator queries validator info for given validator address. */useValidator, - /** - * 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. - */ - useValidatorDelegations, - /** - * 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. - */ - useValidatorUnbondingDelegations, - /** Delegation queries delegate info for given validator delegator pair. */useDelegation, - /** - * UnbondingDelegation queries unbonding info for given validator delegator - * pair. - */ - useUnbondingDelegation, - /** - * 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. - */ - useDelegatorDelegations, - /** - * 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. - */ - useDelegatorUnbondingDelegations, - /** - * 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. - */ - useRedelegations, - /** - * 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. - */ - useDelegatorValidators, - /** - * DelegatorValidator queries validator info for given delegator validator - * pair. - */ - useDelegatorValidator, - /** HistoricalInfo queries the historical info for given height. */useHistoricalInfo, - /** Pool queries the pool info. */usePool, - /** Parameters queries the staking parameters. */useParams - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..d870abdc --- /dev/null +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts @@ -0,0 +1,100 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorsRequest.encode, + decode: QueryValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validators", + clientResolver +}); +export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorRequest.encode, + decode: QueryValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validator", + clientResolver +}); +export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorDelegationsRequest.encode, + decode: QueryValidatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorDelegations", + clientResolver +}); +export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorUnbondingDelegationsRequest.encode, + decode: QueryValidatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorUnbondingDelegations", + clientResolver +}); +export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegationRequest.encode, + decode: QueryDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Delegation", + clientResolver +}); +export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryUnbondingDelegationRequest.encode, + decode: QueryUnbondingDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "UnbondingDelegation", + clientResolver +}); +export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorDelegationsRequest.encode, + decode: QueryDelegatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorDelegations", + clientResolver +}); +export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorUnbondingDelegationsRequest.encode, + decode: QueryDelegatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorUnbondingDelegations", + clientResolver +}); +export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRedelegationsRequest.encode, + decode: QueryRedelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Redelegations", + clientResolver +}); +export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorsRequest.encode, + decode: QueryDelegatorValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidators", + clientResolver +}); +export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorRequest.encode, + decode: QueryDelegatorValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidator", + clientResolver +}); +export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalInfoRequest.encode, + decode: QueryHistoricalInfoResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "HistoricalInfo", + clientResolver +}); +export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPoolRequest.encode, + decode: QueryPoolResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Pool", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Params", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..92fc3c20 --- /dev/null +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts @@ -0,0 +1,59 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +export const useGetValidators = buildUseVueQuery({ + builderQueryFn: createGetValidators, + queryKeyPrefix: "ValidatorsQuery" +}); +export const useGetValidator = buildUseVueQuery({ + builderQueryFn: createGetValidator, + queryKeyPrefix: "ValidatorQuery" +}); +export const useGetValidatorDelegations = buildUseVueQuery({ + builderQueryFn: createGetValidatorDelegations, + queryKeyPrefix: "ValidatorDelegationsQuery" +}); +export const useGetValidatorUnbondingDelegations = buildUseVueQuery({ + builderQueryFn: createGetValidatorUnbondingDelegations, + queryKeyPrefix: "ValidatorUnbondingDelegationsQuery" +}); +export const useGetDelegation = buildUseVueQuery({ + builderQueryFn: createGetDelegation, + queryKeyPrefix: "DelegationQuery" +}); +export const useGetUnbondingDelegation = buildUseVueQuery({ + builderQueryFn: createGetUnbondingDelegation, + queryKeyPrefix: "UnbondingDelegationQuery" +}); +export const useGetDelegatorDelegations = buildUseVueQuery({ + builderQueryFn: createGetDelegatorDelegations, + queryKeyPrefix: "DelegatorDelegationsQuery" +}); +export const useGetDelegatorUnbondingDelegations = buildUseVueQuery({ + builderQueryFn: createGetDelegatorUnbondingDelegations, + queryKeyPrefix: "DelegatorUnbondingDelegationsQuery" +}); +export const useGetRedelegations = buildUseVueQuery({ + builderQueryFn: createGetRedelegations, + queryKeyPrefix: "RedelegationsQuery" +}); +export const useGetDelegatorValidators = buildUseVueQuery({ + builderQueryFn: createGetDelegatorValidators, + queryKeyPrefix: "DelegatorValidatorsQuery" +}); +export const useGetDelegatorValidator = buildUseVueQuery({ + builderQueryFn: createGetDelegatorValidator, + queryKeyPrefix: "DelegatorValidatorQuery" +}); +export const useGetHistoricalInfo = buildUseVueQuery({ + builderQueryFn: createGetHistoricalInfo, + queryKeyPrefix: "HistoricalInfoQuery" +}); +export const useGetPool = buildUseVueQuery({ + builderQueryFn: createGetPool, + queryKeyPrefix: "PoolQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/query.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/query.ts index e81b1e3e..35f76c74 100644 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/query.ts +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/query.ts @@ -3,7 +3,6 @@ import { Validator, ValidatorAmino, DelegationResponse, DelegationResponseAmino, import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequest { /** status enables to query for validators matching a given status. */ @@ -11,10 +10,6 @@ export interface QueryValidatorsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryValidatorsRequest { - status: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; value: Uint8Array; @@ -37,10 +32,6 @@ export interface QueryValidatorsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryValidatorsResponse { - validators: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; value: Uint8Array; @@ -61,9 +52,6 @@ export interface QueryValidatorRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryValidatorRequest { - validatorAddr: ComputedRef; -} export interface QueryValidatorRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest"; value: Uint8Array; @@ -82,9 +70,6 @@ export interface QueryValidatorResponse { /** validator defines the validator info. */ validator: Validator; } -export interface ReactiveQueryValidatorResponse { - validator: ComputedRef; -} export interface QueryValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse"; value: Uint8Array; @@ -108,10 +93,6 @@ export interface QueryValidatorDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryValidatorDelegationsRequest { - validatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; value: Uint8Array; @@ -139,10 +120,6 @@ export interface QueryValidatorDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryValidatorDelegationsResponse { - delegationResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; value: Uint8Array; @@ -170,10 +147,6 @@ export interface QueryValidatorUnbondingDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryValidatorUnbondingDelegationsRequest { - validatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; value: Uint8Array; @@ -201,10 +174,6 @@ export interface QueryValidatorUnbondingDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryValidatorUnbondingDelegationsResponse { - unbondingResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; value: Uint8Array; @@ -229,10 +198,6 @@ export interface QueryDelegationRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryDelegationRequest { - delegatorAddr: ComputedRef; - validatorAddr: ComputedRef; -} export interface QueryDelegationRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest"; value: Uint8Array; @@ -253,9 +218,6 @@ export interface QueryDelegationResponse { /** delegation_responses defines the delegation info of a delegation. */ delegationResponse?: DelegationResponse; } -export interface ReactiveQueryDelegationResponse { - delegationResponse?: ComputedRef; -} export interface QueryDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; value: Uint8Array; @@ -279,10 +241,6 @@ export interface QueryUnbondingDelegationRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryUnbondingDelegationRequest { - delegatorAddr: ComputedRef; - validatorAddr: ComputedRef; -} export interface QueryUnbondingDelegationRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest"; value: Uint8Array; @@ -309,9 +267,6 @@ export interface QueryUnbondingDelegationResponse { /** unbond defines the unbonding information of a delegation. */ unbond: UnbondingDelegation; } -export interface ReactiveQueryUnbondingDelegationResponse { - unbond: ComputedRef; -} export interface QueryUnbondingDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse"; value: Uint8Array; @@ -338,10 +293,6 @@ export interface QueryDelegatorDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDelegatorDelegationsRequest { - delegatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; value: Uint8Array; @@ -370,10 +321,6 @@ export interface QueryDelegatorDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDelegatorDelegationsResponse { - delegationResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; value: Uint8Array; @@ -402,10 +349,6 @@ export interface QueryDelegatorUnbondingDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDelegatorUnbondingDelegationsRequest { - delegatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; value: Uint8Array; @@ -433,10 +376,6 @@ export interface QueryDelegatorUnbondingDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDelegatorUnbondingDelegationsResponse { - unbondingResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; value: Uint8Array; @@ -468,12 +407,6 @@ export interface QueryRedelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryRedelegationsRequest { - delegatorAddr: ComputedRef; - srcValidatorAddr: ComputedRef; - dstValidatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryRedelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; value: Uint8Array; @@ -505,10 +438,6 @@ export interface QueryRedelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryRedelegationsResponse { - redelegationResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryRedelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; value: Uint8Array; @@ -536,10 +465,6 @@ export interface QueryDelegatorValidatorsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDelegatorValidatorsRequest { - delegatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; value: Uint8Array; @@ -568,10 +493,6 @@ export interface QueryDelegatorValidatorsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDelegatorValidatorsResponse { - validators: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; value: Uint8Array; @@ -600,10 +521,6 @@ export interface QueryDelegatorValidatorRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryDelegatorValidatorRequest { - delegatorAddr: ComputedRef; - validatorAddr: ComputedRef; -} export interface QueryDelegatorValidatorRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest"; value: Uint8Array; @@ -630,9 +547,6 @@ export interface QueryDelegatorValidatorResponse { /** validator defines the validator info. */ validator: Validator; } -export interface ReactiveQueryDelegatorValidatorResponse { - validator: ComputedRef; -} export interface QueryDelegatorValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse"; value: Uint8Array; @@ -657,9 +571,6 @@ export interface QueryHistoricalInfoRequest { /** height defines at which height to query the historical info. */ height: bigint; } -export interface ReactiveQueryHistoricalInfoRequest { - height: ComputedRef; -} export interface QueryHistoricalInfoRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest"; value: Uint8Array; @@ -684,9 +595,6 @@ export interface QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ hist?: HistoricalInfo; } -export interface ReactiveQueryHistoricalInfoResponse { - hist?: ComputedRef; -} export interface QueryHistoricalInfoResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; value: Uint8Array; @@ -705,7 +613,6 @@ export interface QueryHistoricalInfoResponseAminoMsg { } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ export interface QueryPoolRequest {} -export interface ReactiveQueryPoolRequest {} export interface QueryPoolRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest"; value: Uint8Array; @@ -721,9 +628,6 @@ export interface QueryPoolResponse { /** pool defines the pool info. */ pool: Pool; } -export interface ReactiveQueryPoolResponse { - pool: ComputedRef; -} export interface QueryPoolResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse"; value: Uint8Array; @@ -739,7 +643,6 @@ export interface QueryPoolResponseAminoMsg { } /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -755,9 +658,6 @@ export interface QueryParamsResponse { /** params holds all the parameters of this module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/staking.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/staking.ts index d99e2c80..2a5589fe 100644 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/staking.ts +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/staking.ts @@ -8,7 +8,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, toTimestamp, fromTimestamp, isSet } from "../../../helpers"; import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; -import { ComputedRef } from "vue"; /** BondStatus is the status of a validator. */ export enum BondStatus { /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ @@ -108,10 +107,6 @@ export interface HistoricalInfo { header: Header; valset: Validator[]; } -export interface ReactiveHistoricalInfo { - header: ComputedRef
; - valset: ComputedRef; -} export interface HistoricalInfoProtoMsg { typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo"; value: Uint8Array; @@ -142,11 +137,6 @@ export interface CommissionRates { /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ maxChangeRate: string; } -export interface ReactiveCommissionRates { - rate: ComputedRef; - maxRate: ComputedRef; - maxChangeRate: ComputedRef; -} export interface CommissionRatesProtoMsg { typeUrl: "/cosmos.staking.v1beta1.CommissionRates"; value: Uint8Array; @@ -174,10 +164,6 @@ export interface Commission { /** update_time is the last time the commission rate was changed. */ updateTime: Date; } -export interface ReactiveCommission { - commissionRates: ComputedRef; - updateTime: ComputedRef; -} export interface CommissionProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Commission"; value: Uint8Array; @@ -206,13 +192,6 @@ export interface Description { /** details define other optional details. */ details: string; } -export interface ReactiveDescription { - moniker: ComputedRef; - identity: ComputedRef; - website: ComputedRef; - securityContact: ComputedRef; - details: ComputedRef; -} export interface DescriptionProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Description"; value: Uint8Array; @@ -276,21 +255,6 @@ export interface Validator { /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ unbondingIds: bigint[]; } -export interface ReactiveValidator { - operatorAddress: ComputedRef; - consensusPubkey?: ComputedRef; - jailed: ComputedRef; - status: ComputedRef; - tokens: ComputedRef; - delegatorShares: ComputedRef; - description: ComputedRef; - unbondingHeight: ComputedRef; - unbondingTime: ComputedRef; - commission: ComputedRef; - minSelfDelegation: ComputedRef; - unbondingOnHoldRefCount: ComputedRef; - unbondingIds: ComputedRef; -} export interface ValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Validator"; value: Uint8Array; @@ -348,9 +312,6 @@ export interface ValidatorAminoMsg { export interface ValAddresses { addresses: string[]; } -export interface ReactiveValAddresses { - addresses: ComputedRef; -} export interface ValAddressesProtoMsg { typeUrl: "/cosmos.staking.v1beta1.ValAddresses"; value: Uint8Array; @@ -372,10 +333,6 @@ export interface DVPair { delegatorAddress: string; validatorAddress: string; } -export interface ReactiveDVPair { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; -} export interface DVPairProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVPair"; value: Uint8Array; @@ -397,9 +354,6 @@ export interface DVPairAminoMsg { export interface DVPairs { pairs: DVPair[]; } -export interface ReactiveDVPairs { - pairs: ComputedRef; -} export interface DVPairsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVPairs"; value: Uint8Array; @@ -423,11 +377,6 @@ export interface DVVTriplet { validatorSrcAddress: string; validatorDstAddress: string; } -export interface ReactiveDVVTriplet { - delegatorAddress: ComputedRef; - validatorSrcAddress: ComputedRef; - validatorDstAddress: ComputedRef; -} export interface DVVTripletProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVVTriplet"; value: Uint8Array; @@ -451,9 +400,6 @@ export interface DVVTripletAminoMsg { export interface DVVTriplets { triplets: DVVTriplet[]; } -export interface ReactiveDVVTriplets { - triplets: ComputedRef; -} export interface DVVTripletsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVVTriplets"; value: Uint8Array; @@ -479,11 +425,6 @@ export interface Delegation { /** shares define the delegation shares received. */ shares: string; } -export interface ReactiveDelegation { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - shares: ComputedRef; -} export interface DelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Delegation"; value: Uint8Array; @@ -517,11 +458,6 @@ export interface UnbondingDelegation { /** entries are the unbonding delegation entries. */ entries: UnbondingDelegationEntry[]; } -export interface ReactiveUnbondingDelegation { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - entries: ComputedRef; -} export interface UnbondingDelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation"; value: Uint8Array; @@ -557,14 +493,6 @@ export interface UnbondingDelegationEntry { /** Strictly positive if this entry's unbonding has been stopped by external modules */ unbondingOnHoldRefCount: bigint; } -export interface ReactiveUnbondingDelegationEntry { - creationHeight: ComputedRef; - completionTime: ComputedRef; - initialBalance: ComputedRef; - balance: ComputedRef; - unbondingId: ComputedRef; - unbondingOnHoldRefCount: ComputedRef; -} export interface UnbondingDelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry"; value: Uint8Array; @@ -603,14 +531,6 @@ export interface RedelegationEntry { /** Strictly positive if this entry's unbonding has been stopped by external modules */ unbondingOnHoldRefCount: bigint; } -export interface ReactiveRedelegationEntry { - creationHeight: ComputedRef; - completionTime: ComputedRef; - initialBalance: ComputedRef; - sharesDst: ComputedRef; - unbondingId: ComputedRef; - unbondingOnHoldRefCount: ComputedRef; -} export interface RedelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry"; value: Uint8Array; @@ -648,12 +568,6 @@ export interface Redelegation { /** entries are the redelegation entries. */ entries: RedelegationEntry[]; } -export interface ReactiveRedelegation { - delegatorAddress: ComputedRef; - validatorSrcAddress: ComputedRef; - validatorDstAddress: ComputedRef; - entries: ComputedRef; -} export interface RedelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Redelegation"; value: Uint8Array; @@ -691,14 +605,6 @@ export interface Params { /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ minCommissionRate: string; } -export interface ReactiveParams { - unbondingTime: ComputedRef; - maxValidators: ComputedRef; - maxEntries: ComputedRef; - historicalEntries: ComputedRef; - bondDenom: ComputedRef; - minCommissionRate: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Params"; value: Uint8Array; @@ -730,10 +636,6 @@ export interface DelegationResponse { delegation: Delegation; balance: Coin; } -export interface ReactiveDelegationResponse { - delegation: ComputedRef; - balance: ComputedRef; -} export interface DelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DelegationResponse"; value: Uint8Array; @@ -759,10 +661,6 @@ export interface RedelegationEntryResponse { redelegationEntry: RedelegationEntry; balance: string; } -export interface ReactiveRedelegationEntryResponse { - redelegationEntry: ComputedRef; - balance: ComputedRef; -} export interface RedelegationEntryResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse"; value: Uint8Array; @@ -789,10 +687,6 @@ export interface RedelegationResponse { redelegation: Redelegation; entries: RedelegationEntryResponse[]; } -export interface ReactiveRedelegationResponse { - redelegation: ComputedRef; - entries: ComputedRef; -} export interface RedelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse"; value: Uint8Array; @@ -818,10 +712,6 @@ export interface Pool { notBondedTokens: string; bondedTokens: string; } -export interface ReactivePool { - notBondedTokens: ComputedRef; - bondedTokens: ComputedRef; -} export interface PoolProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Pool"; value: Uint8Array; @@ -845,9 +735,6 @@ export interface PoolAminoMsg { export interface ValidatorUpdates { updates: ValidatorUpdate[]; } -export interface ReactiveValidatorUpdates { - updates: ComputedRef; -} export interface ValidatorUpdatesProtoMsg { typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.amino.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.amino.ts deleted file mode 100644 index ab2985b9..00000000 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/cosmos.staking.v1beta1.MsgCreateValidator": { - aminoType: "cosmos-sdk/MsgCreateValidator", - toAmino: MsgCreateValidator.toAmino, - fromAmino: MsgCreateValidator.fromAmino - }, - "/cosmos.staking.v1beta1.MsgEditValidator": { - aminoType: "cosmos-sdk/MsgEditValidator", - toAmino: MsgEditValidator.toAmino, - fromAmino: MsgEditValidator.fromAmino - }, - "/cosmos.staking.v1beta1.MsgDelegate": { - aminoType: "cosmos-sdk/MsgDelegate", - toAmino: MsgDelegate.toAmino, - fromAmino: MsgDelegate.fromAmino - }, - "/cosmos.staking.v1beta1.MsgBeginRedelegate": { - aminoType: "cosmos-sdk/MsgBeginRedelegate", - toAmino: MsgBeginRedelegate.toAmino, - fromAmino: MsgBeginRedelegate.fromAmino - }, - "/cosmos.staking.v1beta1.MsgUndelegate": { - aminoType: "cosmos-sdk/MsgUndelegate", - toAmino: MsgUndelegate.toAmino, - fromAmino: MsgUndelegate.fromAmino - }, - "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": { - aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", - toAmino: MsgCancelUnbondingDelegation.toAmino, - fromAmino: MsgCancelUnbondingDelegation.fromAmino - }, - "/cosmos.staking.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..81244bbe --- /dev/null +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +export const createCreateValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateValidator.typeUrl, + encoders: toEncoders(MsgCreateValidator), + converters: toConverters(MsgCreateValidator) +}); +export const createEditValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgEditValidator.typeUrl, + encoders: toEncoders(MsgEditValidator), + converters: toConverters(MsgEditValidator) +}); +export const createDelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDelegate.typeUrl, + encoders: toEncoders(MsgDelegate), + converters: toConverters(MsgDelegate) +}); +export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBeginRedelegate.typeUrl, + encoders: toEncoders(MsgBeginRedelegate), + converters: toConverters(MsgBeginRedelegate) +}); +export const createUndelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUndelegate.typeUrl, + encoders: toEncoders(MsgUndelegate), + converters: toConverters(MsgUndelegate) +}); +export const createCancelUnbondingDelegation = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelUnbondingDelegation.typeUrl, + encoders: toEncoders(MsgCancelUnbondingDelegation), + converters: toConverters(MsgCancelUnbondingDelegation) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index fa4b898f..00000000 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the staking Msg service. */ -export interface Msg { - /** CreateValidator defines a method for creating a new validator. */ - createValidator(request: MsgCreateValidator): Promise; - /** EditValidator defines a method for editing an existing validator. */ - editValidator(request: MsgEditValidator): Promise; - /** - * Delegate defines a method for performing a delegation of coins - * from a delegator to a validator. - */ - delegate(request: MsgDelegate): Promise; - /** - * BeginRedelegate defines a method for performing a redelegation - * of coins from a delegator and source validator to a destination validator. - */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateValidator defines a method for creating a new validator. */ - createValidator = async (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 BinaryReader(data))); - }; - /* EditValidator defines a method for editing an existing validator. */ - editValidator = async (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 BinaryReader(data))); - }; - /* Delegate defines a method for performing a delegation of coins - from a delegator to a validator. */ - delegate = async (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 BinaryReader(data))); - }; - /* BeginRedelegate defines a method for performing a redelegation - of coins from a delegator and source validator to a destination validator. */ - beginRedelegate = async (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 BinaryReader(data))); - }; - /* Undelegate defines a method for performing an undelegation from a - delegate and a validator. */ - undelegate = async (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 BinaryReader(data))); - }; - /* CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - and delegate back to previous validator. - - Since: cosmos-sdk 0.46 */ - cancelUnbondingDelegation = async (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 BinaryReader(data))); - }; - /* UpdateParams defines an operation for updating the x/staking module - parameters. - Since: cosmos-sdk 0.47 */ - updateParams = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..57a83c0e --- /dev/null +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateValidator = buildUseVueMutation({ + builderMutationFn: createCreateValidator +}); +export const useEditValidator = buildUseVueMutation({ + builderMutationFn: createEditValidator +}); +export const useDelegate = buildUseVueMutation({ + builderMutationFn: createDelegate +}); +export const useBeginRedelegate = buildUseVueMutation({ + builderMutationFn: createBeginRedelegate +}); +export const useUndelegate = buildUseVueMutation({ + builderMutationFn: createUndelegate +}); +export const useCancelUnbondingDelegation = buildUseVueMutation({ + builderMutationFn: createCancelUnbondingDelegation +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.ts index 02daad17..f533f6f9 100644 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.ts @@ -6,7 +6,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; -import { ComputedRef } from "vue"; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { description: Description; @@ -23,15 +22,6 @@ export interface MsgCreateValidator { pubkey?: Any | undefined; value: Coin; } -export interface ReactiveMsgCreateValidator { - description: ComputedRef; - commission: ComputedRef; - minSelfDelegation: ComputedRef; - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - pubkey?: ComputedRef; - value: ComputedRef; -} export interface MsgCreateValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator"; value: Uint8Array; @@ -61,7 +51,6 @@ export interface MsgCreateValidatorAminoMsg { } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ export interface MsgCreateValidatorResponse {} -export interface ReactiveMsgCreateValidatorResponse {} export interface MsgCreateValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse"; value: Uint8Array; @@ -85,12 +74,6 @@ export interface MsgEditValidator { commissionRate: string; minSelfDelegation: string; } -export interface ReactiveMsgEditValidator { - description: ComputedRef; - validatorAddress: ComputedRef; - commissionRate: ComputedRef; - minSelfDelegation: ComputedRef; -} export interface MsgEditValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator"; value: Uint8Array; @@ -114,7 +97,6 @@ export interface MsgEditValidatorAminoMsg { } /** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ export interface MsgEditValidatorResponse {} -export interface ReactiveMsgEditValidatorResponse {} export interface MsgEditValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse"; value: Uint8Array; @@ -134,11 +116,6 @@ export interface MsgDelegate { validatorAddress: string; amount: Coin; } -export interface ReactiveMsgDelegate { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgDelegateProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate"; value: Uint8Array; @@ -158,7 +135,6 @@ export interface MsgDelegateAminoMsg { } /** MsgDelegateResponse defines the Msg/Delegate response type. */ export interface MsgDelegateResponse {} -export interface ReactiveMsgDelegateResponse {} export interface MsgDelegateResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse"; value: Uint8Array; @@ -179,12 +155,6 @@ export interface MsgBeginRedelegate { validatorDstAddress: string; amount: Coin; } -export interface ReactiveMsgBeginRedelegate { - delegatorAddress: ComputedRef; - validatorSrcAddress: ComputedRef; - validatorDstAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgBeginRedelegateProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate"; value: Uint8Array; @@ -207,9 +177,6 @@ export interface MsgBeginRedelegateAminoMsg { export interface MsgBeginRedelegateResponse { completionTime: Date; } -export interface ReactiveMsgBeginRedelegateResponse { - completionTime: ComputedRef; -} export interface MsgBeginRedelegateResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse"; value: Uint8Array; @@ -231,11 +198,6 @@ export interface MsgUndelegate { validatorAddress: string; amount: Coin; } -export interface ReactiveMsgUndelegate { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgUndelegateProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate"; value: Uint8Array; @@ -263,10 +225,6 @@ export interface MsgUndelegateResponse { */ amount: Coin; } -export interface ReactiveMsgUndelegateResponse { - completionTime: ComputedRef; - amount: ComputedRef; -} export interface MsgUndelegateResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse"; value: Uint8Array; @@ -298,12 +256,6 @@ export interface MsgCancelUnbondingDelegation { /** creation_height is the height which the unbonding took place. */ creationHeight: bigint; } -export interface ReactiveMsgCancelUnbondingDelegation { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; - creationHeight: ComputedRef; -} export interface MsgCancelUnbondingDelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"; value: Uint8Array; @@ -331,7 +283,6 @@ export interface MsgCancelUnbondingDelegationAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCancelUnbondingDelegationResponse {} -export interface ReactiveMsgCancelUnbondingDelegationResponse {} export interface MsgCancelUnbondingDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse"; value: Uint8Array; @@ -361,10 +312,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -395,7 +342,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/tx/signing/v1beta1/signing.ts b/libs/injective-vue/src/cosmos/tx/signing/v1beta1/signing.ts index a9eaac18..8c90655f 100644 --- a/libs/injective-vue/src/cosmos/tx/signing/v1beta1/signing.ts +++ b/libs/injective-vue/src/cosmos/tx/signing/v1beta1/signing.ts @@ -3,7 +3,6 @@ import { Any, AnyAmino } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * SignMode represents a signing mode with its own security guarantees. * @@ -112,9 +111,6 @@ export interface SignatureDescriptors { /** signatures are the signature descriptors */ signatures: SignatureDescriptor[]; } -export interface ReactiveSignatureDescriptors { - signatures: ComputedRef; -} export interface SignatureDescriptorsProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors"; value: Uint8Array; @@ -145,11 +141,6 @@ export interface SignatureDescriptor { */ sequence: bigint; } -export interface ReactiveSignatureDescriptor { - publicKey?: ComputedRef; - data?: ComputedRef; - sequence: ComputedRef; -} export interface SignatureDescriptorProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor"; value: Uint8Array; @@ -182,10 +173,6 @@ export interface SignatureDescriptor_Data { /** multi represents a multisig signer */ multi?: SignatureDescriptor_Data_Multi; } -export interface ReactiveSignatureDescriptor_Data { - single?: ComputedRef; - multi?: ComputedRef; -} export interface SignatureDescriptor_DataProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.Data"; value: Uint8Array; @@ -208,10 +195,6 @@ export interface SignatureDescriptor_Data_Single { /** signature is the raw signature bytes */ signature: Uint8Array; } -export interface ReactiveSignatureDescriptor_Data_Single { - mode: ComputedRef; - signature: ComputedRef; -} export interface SignatureDescriptor_Data_SingleProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.Single"; value: Uint8Array; @@ -234,10 +217,6 @@ export interface SignatureDescriptor_Data_Multi { /** signatures is the signatures of the multi-signature */ signatures: SignatureDescriptor_Data[]; } -export interface ReactiveSignatureDescriptor_Data_Multi { - bitarray?: ComputedRef; - signatures: ComputedRef; -} export interface SignatureDescriptor_Data_MultiProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.Multi"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts b/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts deleted file mode 100644 index fca7a223..00000000 --- a/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts +++ /dev/null @@ -1,455 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; -/** Service defines a gRPC service for interacting with transactions. */ -export interface Service { - /** Simulate simulates executing a transaction for estimating gas usage. */ - simulate(request: SimulateRequest): Promise; - /** GetTx fetches a tx by hash. */ - getTx(request: GetTxRequest): Promise; - /** BroadcastTx broadcast transaction. */ - broadcastTx(request: BroadcastTxRequest): Promise; - /** GetTxsEvent fetches txs by event. */ - getTxsEvent(request: GetTxsEventRequest): Promise; - /** - * GetBlockWithTxs fetches a block with decoded txs. - * - * Since: cosmos-sdk 0.45.2 - */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Simulate simulates executing a transaction for estimating gas usage. */ - simulate = async (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 BinaryReader(data))); - }; - /* GetTx fetches a tx by hash. */ - getTx = async (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 BinaryReader(data))); - }; - /* BroadcastTx broadcast transaction. */ - broadcastTx = async (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 BinaryReader(data))); - }; - /* GetTxsEvent fetches txs by event. */ - getTxsEvent = async (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 BinaryReader(data))); - }; - /* GetBlockWithTxs fetches a block with decoded txs. - - Since: cosmos-sdk 0.45.2 */ - getBlockWithTxs = async (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 BinaryReader(data))); - }; - /* TxDecode decodes the transaction. - - Since: cosmos-sdk 0.47 */ - txDecode = async (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 BinaryReader(data))); - }; - /* TxEncode encodes the transaction. - - Since: cosmos-sdk 0.47 */ - txEncode = async (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 BinaryReader(data))); - }; - /* TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - - Since: cosmos-sdk 0.47 */ - txEncodeAmino = async (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 BinaryReader(data))); - }; - /* TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - - Since: cosmos-sdk 0.47 */ - txDecodeAmino = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new ServiceClientImpl(rpc); - return { - simulate(request: SimulateRequest): Promise { - return queryService.simulate(request); - }, - getTx(request: GetTxRequest): Promise { - return queryService.getTx(request); - }, - broadcastTx(request: BroadcastTxRequest): Promise { - return queryService.broadcastTx(request); - }, - getTxsEvent(request: GetTxsEventRequest): Promise { - return queryService.getTxsEvent(request); - }, - getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { - return queryService.getBlockWithTxs(request); - }, - txDecode(request: TxDecodeRequest): Promise { - return queryService.txDecode(request); - }, - txEncode(request: TxEncodeRequest): Promise { - return queryService.txEncode(request); - }, - txEncodeAmino(request: TxEncodeAminoRequest): Promise { - return queryService.txEncodeAmino(request); - }, - txDecodeAmino(request: TxDecodeAminoRequest): Promise { - return queryService.txDecodeAmino(request); - } - }; -}; -export interface UseSimulateQuery extends VueQueryParams { - request: ReactiveSimulateRequest; -} -export interface UseGetTxQuery extends VueQueryParams { - request: ReactiveGetTxRequest; -} -export interface UseBroadcastTxQuery extends VueQueryParams { - request: ReactiveBroadcastTxRequest; -} -export interface UseGetTxsEventQuery extends VueQueryParams { - request: ReactiveGetTxsEventRequest; -} -export interface UseGetBlockWithTxsQuery extends VueQueryParams { - request: ReactiveGetBlockWithTxsRequest; -} -export interface UseTxDecodeQuery extends VueQueryParams { - request: ReactiveTxDecodeRequest; -} -export interface UseTxEncodeQuery extends VueQueryParams { - request: ReactiveTxEncodeRequest; -} -export interface UseTxEncodeAminoQuery extends VueQueryParams { - request: ReactiveTxEncodeAminoRequest; -} -export interface UseTxDecodeAminoQuery extends VueQueryParams { - request: ReactiveTxDecodeAminoRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new ServiceClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useSimulate = ({ - request, - options - }: UseSimulateQuery) => { - const queryKey = ["simulateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.simulate(params); - }, - ...options - }); - }; - const useGetTx = ({ - request, - options - }: UseGetTxQuery) => { - const queryKey = ["getTxQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getTx(params); - }, - ...options - }); - }; - const useBroadcastTx = ({ - request, - options - }: UseBroadcastTxQuery) => { - const queryKey = ["broadcastTxQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.broadcastTx(params); - }, - ...options - }); - }; - const useGetTxsEvent = ({ - request, - options - }: UseGetTxsEventQuery) => { - const queryKey = ["getTxsEventQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getTxsEvent(params); - }, - ...options - }); - }; - const useGetBlockWithTxs = ({ - request, - options - }: UseGetBlockWithTxsQuery) => { - const queryKey = ["getBlockWithTxsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getBlockWithTxs(params); - }, - ...options - }); - }; - const useTxDecode = ({ - request, - options - }: UseTxDecodeQuery) => { - const queryKey = ["txDecodeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txDecode(params); - }, - ...options - }); - }; - const useTxEncode = ({ - request, - options - }: UseTxEncodeQuery) => { - const queryKey = ["txEncodeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txEncode(params); - }, - ...options - }); - }; - const useTxEncodeAmino = ({ - request, - options - }: UseTxEncodeAminoQuery) => { - const queryKey = ["txEncodeAminoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txEncodeAmino(params); - }, - ...options - }); - }; - const useTxDecodeAmino = ({ - request, - options - }: UseTxDecodeAminoQuery) => { - const queryKey = ["txDecodeAminoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txDecodeAmino(params); - }, - ...options - }); - }; - return { - /** Simulate simulates executing a transaction for estimating gas usage. */useSimulate, - /** GetTx fetches a tx by hash. */useGetTx, - /** BroadcastTx broadcast transaction. */useBroadcastTx, - /** GetTxsEvent fetches txs by event. */useGetTxsEvent, - /** - * GetBlockWithTxs fetches a block with decoded txs. - * - * Since: cosmos-sdk 0.45.2 - */ - useGetBlockWithTxs, - /** - * TxDecode decodes the transaction. - * - * Since: cosmos-sdk 0.47 - */ - useTxDecode, - /** - * TxEncode encodes the transaction. - * - * Since: cosmos-sdk 0.47 - */ - useTxEncode, - /** - * TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - * - * Since: cosmos-sdk 0.47 - */ - useTxEncodeAmino, - /** - * TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - * - * Since: cosmos-sdk 0.47 - */ - useTxDecodeAmino - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts b/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts new file mode 100644 index 00000000..a13635e1 --- /dev/null +++ b/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts @@ -0,0 +1,65 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ + encode: SimulateRequest.encode, + decode: SimulateResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "Simulate", + clientResolver +}); +export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxRequest.encode, + decode: GetTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTx", + clientResolver +}); +export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: BroadcastTxRequest.encode, + decode: BroadcastTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "BroadcastTx", + clientResolver +}); +export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxsEventRequest.encode, + decode: GetTxsEventResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTxsEvent", + clientResolver +}); +export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetBlockWithTxsRequest.encode, + decode: GetBlockWithTxsResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetBlockWithTxs", + clientResolver +}); +export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeRequest.encode, + decode: TxDecodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecode", + clientResolver +}); +export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeRequest.encode, + decode: TxEncodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncode", + clientResolver +}); +export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeAminoRequest.encode, + decode: TxEncodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncodeAmino", + clientResolver +}); +export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeAminoRequest.encode, + decode: TxDecodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecodeAmino", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts b/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts new file mode 100644 index 00000000..c3e8714b --- /dev/null +++ b/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts @@ -0,0 +1,39 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +export const useGetSimulate = buildUseVueQuery({ + builderQueryFn: createGetSimulate, + queryKeyPrefix: "SimulateQuery" +}); +export const useGetGetTx = buildUseVueQuery({ + builderQueryFn: createGetGetTx, + queryKeyPrefix: "GetTxQuery" +}); +export const useGetBroadcastTx = buildUseVueQuery({ + builderQueryFn: createGetBroadcastTx, + queryKeyPrefix: "BroadcastTxQuery" +}); +export const useGetGetTxsEvent = buildUseVueQuery({ + builderQueryFn: createGetGetTxsEvent, + queryKeyPrefix: "GetTxsEventQuery" +}); +export const useGetGetBlockWithTxs = buildUseVueQuery({ + builderQueryFn: createGetGetBlockWithTxs, + queryKeyPrefix: "GetBlockWithTxsQuery" +}); +export const useGetTxDecode = buildUseVueQuery({ + builderQueryFn: createGetTxDecode, + queryKeyPrefix: "TxDecodeQuery" +}); +export const useGetTxEncode = buildUseVueQuery({ + builderQueryFn: createGetTxEncode, + queryKeyPrefix: "TxEncodeQuery" +}); +export const useGetTxEncodeAmino = buildUseVueQuery({ + builderQueryFn: createGetTxEncodeAmino, + queryKeyPrefix: "TxEncodeAminoQuery" +}); +export const useGetTxDecodeAmino = buildUseVueQuery({ + builderQueryFn: createGetTxDecodeAmino, + queryKeyPrefix: "TxDecodeAminoQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/tx/v1beta1/service.ts b/libs/injective-vue/src/cosmos/tx/v1beta1/service.ts index fe1d7763..9c0eaf31 100644 --- a/libs/injective-vue/src/cosmos/tx/v1beta1/service.ts +++ b/libs/injective-vue/src/cosmos/tx/v1beta1/service.ts @@ -6,7 +6,6 @@ import { Block, BlockAmino } from "../../../tendermint/types/block"; import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** OrderBy defines the sorting order */ export enum OrderBy { /** @@ -148,14 +147,6 @@ export interface GetTxsEventRequest { */ query: string; } -export interface ReactiveGetTxsEventRequest { - events: ComputedRef; - pagination?: ComputedRef; - orderBy: ComputedRef; - page: ComputedRef; - limit: ComputedRef; - query: ComputedRef; -} export interface GetTxsEventRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest"; value: Uint8Array; @@ -219,12 +210,6 @@ export interface GetTxsEventResponse { /** total is total number of results available */ total: bigint; } -export interface ReactiveGetTxsEventResponse { - txs: ComputedRef; - txResponses: ComputedRef; - pagination?: ComputedRef; - total: ComputedRef; -} export interface GetTxsEventResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse"; value: Uint8Array; @@ -260,10 +245,6 @@ export interface BroadcastTxRequest { txBytes: Uint8Array; mode: BroadcastMode; } -export interface ReactiveBroadcastTxRequest { - txBytes: ComputedRef; - mode: ComputedRef; -} export interface BroadcastTxRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest"; value: Uint8Array; @@ -289,9 +270,6 @@ export interface BroadcastTxResponse { /** tx_response is the queried TxResponses. */ txResponse?: TxResponse; } -export interface ReactiveBroadcastTxResponse { - txResponse?: ComputedRef; -} export interface BroadcastTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; value: Uint8Array; @@ -326,10 +304,6 @@ export interface SimulateRequest { */ txBytes: Uint8Array; } -export interface ReactiveSimulateRequest { - tx?: ComputedRef; - txBytes: ComputedRef; -} export interface SimulateRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SimulateRequest"; value: Uint8Array; @@ -366,10 +340,6 @@ export interface SimulateResponse { /** result is the result of the simulation. */ result?: Result; } -export interface ReactiveSimulateResponse { - gasInfo?: ComputedRef; - result?: ComputedRef; -} export interface SimulateResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; value: Uint8Array; @@ -396,9 +366,6 @@ export interface GetTxRequest { /** hash is the tx hash to query, encoded as a hex string. */ hash: string; } -export interface ReactiveGetTxRequest { - hash: ComputedRef; -} export interface GetTxRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxRequest"; value: Uint8Array; @@ -422,10 +389,6 @@ export interface GetTxResponse { /** tx_response is the queried TxResponses. */ txResponse?: TxResponse; } -export interface ReactiveGetTxResponse { - tx?: ComputedRef; - txResponse?: ComputedRef; -} export interface GetTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; value: Uint8Array; @@ -453,10 +416,6 @@ export interface GetBlockWithTxsRequest { /** pagination defines a pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveGetBlockWithTxsRequest { - height: ComputedRef; - pagination?: ComputedRef; -} export interface GetBlockWithTxsRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; value: Uint8Array; @@ -491,12 +450,6 @@ export interface GetBlockWithTxsResponse { /** pagination defines a pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveGetBlockWithTxsResponse { - txs: ComputedRef; - blockId?: ComputedRef; - block?: ComputedRef; - pagination?: ComputedRef; -} export interface GetBlockWithTxsResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; value: Uint8Array; @@ -529,9 +482,6 @@ export interface TxDecodeRequest { /** tx_bytes is the raw transaction. */ txBytes: Uint8Array; } -export interface ReactiveTxDecodeRequest { - txBytes: ComputedRef; -} export interface TxDecodeRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest"; value: Uint8Array; @@ -560,9 +510,6 @@ export interface TxDecodeResponse { /** tx is the decoded transaction. */ tx?: Tx; } -export interface ReactiveTxDecodeResponse { - tx?: ComputedRef; -} export interface TxDecodeResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse"; value: Uint8Array; @@ -591,9 +538,6 @@ export interface TxEncodeRequest { /** tx is the transaction to encode. */ tx?: Tx; } -export interface ReactiveTxEncodeRequest { - tx?: ComputedRef; -} export interface TxEncodeRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest"; value: Uint8Array; @@ -622,9 +566,6 @@ export interface TxEncodeResponse { /** tx_bytes is the encoded transaction bytes. */ txBytes: Uint8Array; } -export interface ReactiveTxEncodeResponse { - txBytes: ComputedRef; -} export interface TxEncodeResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse"; value: Uint8Array; @@ -652,9 +593,6 @@ export interface TxEncodeResponseAminoMsg { export interface TxEncodeAminoRequest { aminoJson: string; } -export interface ReactiveTxEncodeAminoRequest { - aminoJson: ComputedRef; -} export interface TxEncodeAminoRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest"; value: Uint8Array; @@ -681,9 +619,6 @@ export interface TxEncodeAminoRequestAminoMsg { export interface TxEncodeAminoResponse { aminoBinary: Uint8Array; } -export interface ReactiveTxEncodeAminoResponse { - aminoBinary: ComputedRef; -} export interface TxEncodeAminoResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse"; value: Uint8Array; @@ -710,9 +645,6 @@ export interface TxEncodeAminoResponseAminoMsg { export interface TxDecodeAminoRequest { aminoBinary: Uint8Array; } -export interface ReactiveTxDecodeAminoRequest { - aminoBinary: ComputedRef; -} export interface TxDecodeAminoRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest"; value: Uint8Array; @@ -739,9 +671,6 @@ export interface TxDecodeAminoRequestAminoMsg { export interface TxDecodeAminoResponse { aminoJson: string; } -export interface ReactiveTxDecodeAminoResponse { - aminoJson: ComputedRef; -} export interface TxDecodeAminoResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/tx/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/tx/v1beta1/tx.ts index 480c8921..904ccf41 100644 --- a/libs/injective-vue/src/cosmos/tx/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/tx/v1beta1/tx.ts @@ -5,7 +5,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; /** Tx is the standard type used for broadcasting transactions. */ export interface Tx { /** body is the processable content of the transaction */ @@ -22,11 +21,6 @@ export interface Tx { */ signatures: Uint8Array[]; } -export interface ReactiveTx { - body?: ComputedRef; - authInfo?: ComputedRef; - signatures: ComputedRef; -} export interface TxProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Tx"; value: Uint8Array; @@ -76,11 +70,6 @@ export interface TxRaw { */ signatures: Uint8Array[]; } -export interface ReactiveTxRaw { - bodyBytes: ComputedRef; - authInfoBytes: ComputedRef; - signatures: ComputedRef; -} export interface TxRawProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxRaw"; value: Uint8Array; @@ -135,12 +124,6 @@ export interface SignDoc { /** account_number is the account number of the account in state */ accountNumber: bigint; } -export interface ReactiveSignDoc { - bodyBytes: ComputedRef; - authInfoBytes: ComputedRef; - chainId: ComputedRef; - accountNumber: ComputedRef; -} export interface SignDocProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignDoc"; value: Uint8Array; @@ -198,14 +181,6 @@ export interface SignDocDirectAux { /** @deprecated */ tip?: Tip; } -export interface ReactiveSignDocDirectAux { - bodyBytes: ComputedRef; - publicKey?: ComputedRef; - chainId: ComputedRef; - accountNumber: ComputedRef; - sequence: ComputedRef; - tip?: ComputedRef; -} export interface SignDocDirectAuxProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux"; value: Uint8Array; @@ -278,13 +253,6 @@ export interface TxBody { */ nonCriticalExtensionOptions: Any[]; } -export interface ReactiveTxBody { - messages: ComputedRef; - memo: ComputedRef; - timeoutHeight: ComputedRef; - extensionOptions: ComputedRef; - nonCriticalExtensionOptions: ComputedRef; -} export interface TxBodyProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxBody"; value: Uint8Array; @@ -359,11 +327,6 @@ export interface AuthInfo { /** @deprecated */ tip?: Tip; } -export interface ReactiveAuthInfo { - signerInfos: ComputedRef; - fee?: ComputedRef; - tip?: ComputedRef; -} export interface AuthInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuthInfo"; value: Uint8Array; @@ -425,11 +388,6 @@ export interface SignerInfo { */ sequence: bigint; } -export interface ReactiveSignerInfo { - publicKey?: ComputedRef; - modeInfo?: ComputedRef; - sequence: ComputedRef; -} export interface SignerInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignerInfo"; value: Uint8Array; @@ -468,10 +426,6 @@ export interface ModeInfo { /** multi represents a nested multisig signer */ multi?: ModeInfo_Multi; } -export interface ReactiveModeInfo { - single?: ComputedRef; - multi?: ComputedRef; -} export interface ModeInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.ModeInfo"; value: Uint8Array; @@ -496,9 +450,6 @@ export interface ModeInfo_Single { /** mode is the signing mode of the single signer */ mode: SignMode; } -export interface ReactiveModeInfo_Single { - mode: ComputedRef; -} export interface ModeInfo_SingleProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Single"; value: Uint8Array; @@ -526,10 +477,6 @@ export interface ModeInfo_Multi { */ modeInfos: ModeInfo[]; } -export interface ReactiveModeInfo_Multi { - bitarray?: ComputedRef; - modeInfos: ComputedRef; -} export interface ModeInfo_MultiProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Multi"; value: Uint8Array; @@ -574,12 +521,6 @@ export interface Fee { */ granter: string; } -export interface ReactiveFee { - amount: ComputedRef; - gasLimit: ComputedRef; - payer: ComputedRef; - granter: ComputedRef; -} export interface FeeProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Fee"; value: Uint8Array; @@ -626,10 +567,6 @@ export interface Tip { /** tipper is the address of the account paying for the tip */ tipper: string; } -export interface ReactiveTip { - amount: ComputedRef; - tipper: ComputedRef; -} export interface TipProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Tip"; value: Uint8Array; @@ -676,12 +613,6 @@ export interface AuxSignerData { /** sig is the signature of the sign doc. */ sig: Uint8Array; } -export interface ReactiveAuxSignerData { - address: ComputedRef; - signDoc?: ComputedRef; - mode: ComputedRef; - sig: ComputedRef; -} export interface AuxSignerDataProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuxSignerData"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/upgrade/v1beta1/upgrade.ts b/libs/injective-vue/src/cosmos/upgrade/v1beta1/upgrade.ts index a4795bc0..c2adfcb7 100644 --- a/libs/injective-vue/src/cosmos/upgrade/v1beta1/upgrade.ts +++ b/libs/injective-vue/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -3,7 +3,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Plan specifies information about a planned upgrade and when it should occur. */ export interface Plan { /** @@ -38,13 +37,6 @@ export interface Plan { /** @deprecated */ upgradedClientState?: Any; } -export interface ReactivePlan { - name: ComputedRef; - time: ComputedRef; - height: ComputedRef; - info: ComputedRef; - upgradedClientState?: ComputedRef; -} export interface PlanProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.Plan"; value: Uint8Array; @@ -102,11 +94,6 @@ export interface SoftwareUpgradeProposal { /** plan of the proposal */ plan: Plan; } -export interface ReactiveSoftwareUpgradeProposal { - title: ComputedRef; - description: ComputedRef; - plan: ComputedRef; -} export interface SoftwareUpgradeProposalProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; value: Uint8Array; @@ -143,10 +130,6 @@ export interface CancelSoftwareUpgradeProposal { /** description of the proposal */ description: string; } -export interface ReactiveCancelSoftwareUpgradeProposal { - title: ComputedRef; - description: ComputedRef; -} export interface CancelSoftwareUpgradeProposalProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; value: Uint8Array; @@ -179,10 +162,6 @@ export interface ModuleVersion { /** consensus version of the app module */ version: bigint; } -export interface ReactiveModuleVersion { - name: ComputedRef; - version: ComputedRef; -} export interface ModuleVersionProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.amino.ts b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.amino.ts deleted file mode 100644 index 3085e0b1..00000000 --- a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; -export const AminoConverter = { - "/cosmos.vesting.v1beta1.MsgCreateVestingAccount": { - aminoType: "cosmos-sdk/MsgCreateVestingAccount", - toAmino: MsgCreateVestingAccount.toAmino, - fromAmino: MsgCreateVestingAccount.fromAmino - }, - "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount": { - aminoType: "cosmos-sdk/MsgCreatePermLockedAccount", - toAmino: MsgCreatePermanentLockedAccount.toAmino, - fromAmino: MsgCreatePermanentLockedAccount.fromAmino - }, - "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount": { - aminoType: "cosmos-sdk/MsgCreatePeriodVestAccount", - toAmino: MsgCreatePeriodicVestingAccount.toAmino, - fromAmino: MsgCreatePeriodicVestingAccount.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..49328086 --- /dev/null +++ b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +export const createCreateVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateVestingAccount.typeUrl, + encoders: toEncoders(MsgCreateVestingAccount), + converters: toConverters(MsgCreateVestingAccount) +}); +export const createCreatePermanentLockedAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePermanentLockedAccount.typeUrl, + encoders: toEncoders(MsgCreatePermanentLockedAccount), + converters: toConverters(MsgCreatePermanentLockedAccount) +}); +export const createCreatePeriodicVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePeriodicVestingAccount.typeUrl, + encoders: toEncoders(MsgCreatePeriodicVestingAccount), + converters: toConverters(MsgCreatePeriodicVestingAccount) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index fba8f175..00000000 --- a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateVestingAccount, MsgCreateVestingAccountResponse, MsgCreatePermanentLockedAccount, MsgCreatePermanentLockedAccountResponse, MsgCreatePeriodicVestingAccount, MsgCreatePeriodicVestingAccountResponse } from "./tx"; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** - * CreateVestingAccount defines a method that enables creating a vesting - * account. - */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateVestingAccount defines a method that enables creating a vesting - account. */ - createVestingAccount = async (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 BinaryReader(data))); - }; - /* CreatePermanentLockedAccount defines a method that enables creating a permanent - locked account. - - Since: cosmos-sdk 0.46 */ - createPermanentLockedAccount = async (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 BinaryReader(data))); - }; - /* CreatePeriodicVestingAccount defines a method that enables creating a - periodic vesting account. - - Since: cosmos-sdk 0.46 */ - createPeriodicVestingAccount = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..a5ff2e80 --- /dev/null +++ b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,12 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +export const useCreateVestingAccount = buildUseVueMutation({ + builderMutationFn: createCreateVestingAccount +}); +export const useCreatePermanentLockedAccount = buildUseVueMutation({ + builderMutationFn: createCreatePermanentLockedAccount +}); +export const useCreatePeriodicVestingAccount = buildUseVueMutation({ + builderMutationFn: createCreatePeriodicVestingAccount +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.ts b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.ts index 59f9c356..4e9fcb3f 100644 --- a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.ts +++ b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Period, PeriodAmino } from "./vesting"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. @@ -16,13 +15,6 @@ export interface MsgCreateVestingAccount { endTime: bigint; delayed: boolean; } -export interface ReactiveMsgCreateVestingAccount { - fromAddress: ComputedRef; - toAddress: ComputedRef; - amount: ComputedRef; - endTime: ComputedRef; - delayed: ComputedRef; -} export interface MsgCreateVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount"; value: Uint8Array; @@ -45,7 +37,6 @@ export interface MsgCreateVestingAccountAminoMsg { } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ export interface MsgCreateVestingAccountResponse {} -export interface ReactiveMsgCreateVestingAccountResponse {} export interface MsgCreateVestingAccountResponseProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse"; value: Uint8Array; @@ -67,11 +58,6 @@ export interface MsgCreatePermanentLockedAccount { toAddress: string; amount: Coin[]; } -export interface ReactiveMsgCreatePermanentLockedAccount { - fromAddress: ComputedRef; - toAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgCreatePermanentLockedAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount"; value: Uint8Array; @@ -97,7 +83,6 @@ export interface MsgCreatePermanentLockedAccountAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCreatePermanentLockedAccountResponse {} -export interface ReactiveMsgCreatePermanentLockedAccountResponse {} export interface MsgCreatePermanentLockedAccountResponseProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse"; value: Uint8Array; @@ -125,12 +110,6 @@ export interface MsgCreatePeriodicVestingAccount { startTime: bigint; vestingPeriods: Period[]; } -export interface ReactiveMsgCreatePeriodicVestingAccount { - fromAddress: ComputedRef; - toAddress: ComputedRef; - startTime: ComputedRef; - vestingPeriods: ComputedRef; -} export interface MsgCreatePeriodicVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount"; value: Uint8Array; @@ -159,7 +138,6 @@ export interface MsgCreatePeriodicVestingAccountAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCreatePeriodicVestingAccountResponse {} -export interface ReactiveMsgCreatePeriodicVestingAccountResponse {} export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos/vesting/v1beta1/vesting.ts b/libs/injective-vue/src/cosmos/vesting/v1beta1/vesting.ts index 3e4118c2..47cbe3b6 100644 --- a/libs/injective-vue/src/cosmos/vesting/v1beta1/vesting.ts +++ b/libs/injective-vue/src/cosmos/vesting/v1beta1/vesting.ts @@ -3,7 +3,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * BaseVestingAccount implements the VestingAccount interface. It contains all * the necessary fields needed for any vesting account implementation. @@ -16,13 +15,6 @@ export interface BaseVestingAccount { /** Vesting end time, as unix timestamp (in seconds). */ endTime: bigint; } -export interface ReactiveBaseVestingAccount { - baseAccount?: ComputedRef; - originalVesting: ComputedRef; - delegatedFree: ComputedRef; - delegatedVesting: ComputedRef; - endTime: ComputedRef; -} export interface BaseVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount"; value: Uint8Array; @@ -52,10 +44,6 @@ export interface ContinuousVestingAccount { /** Vesting start time, as unix timestamp (in seconds). */ startTime: bigint; } -export interface ReactiveContinuousVestingAccount { - baseVestingAccount?: ComputedRef; - startTime: ComputedRef; -} export interface ContinuousVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount"; value: Uint8Array; @@ -81,9 +69,6 @@ export interface ContinuousVestingAccountAminoMsg { export interface DelayedVestingAccount { baseVestingAccount?: BaseVestingAccount; } -export interface ReactiveDelayedVestingAccount { - baseVestingAccount?: ComputedRef; -} export interface DelayedVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount"; value: Uint8Array; @@ -106,10 +91,6 @@ export interface Period { length: bigint; amount: Coin[]; } -export interface ReactivePeriod { - length: ComputedRef; - amount: ComputedRef; -} export interface PeriodProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.Period"; value: Uint8Array; @@ -133,11 +114,6 @@ export interface PeriodicVestingAccount { startTime: bigint; vestingPeriods: Period[]; } -export interface ReactivePeriodicVestingAccount { - baseVestingAccount?: ComputedRef; - startTime: ComputedRef; - vestingPeriods: ComputedRef; -} export interface PeriodicVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount"; value: Uint8Array; @@ -165,9 +141,6 @@ export interface PeriodicVestingAccountAminoMsg { export interface PermanentLockedAccount { baseVestingAccount?: BaseVestingAccount; } -export interface ReactivePermanentLockedAccount { - baseVestingAccount?: ComputedRef; -} export interface PermanentLockedAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmos_proto/cosmos.ts b/libs/injective-vue/src/cosmos_proto/cosmos.ts index d558ab50..0a97877f 100644 --- a/libs/injective-vue/src/cosmos_proto/cosmos.ts +++ b/libs/injective-vue/src/cosmos_proto/cosmos.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../binary"; import { DeepPartial } from "../helpers"; import { GlobalDecoderRegistry } from "../registry"; -import { ComputedRef } from "vue"; export enum ScalarType { SCALAR_TYPE_UNSPECIFIED = 0, SCALAR_TYPE_STRING = 1, @@ -57,10 +56,6 @@ export interface InterfaceDescriptor { */ description: string; } -export interface ReactiveInterfaceDescriptor { - name: ComputedRef; - description: ComputedRef; -} export interface InterfaceDescriptorProtoMsg { typeUrl: "/cosmos_proto.InterfaceDescriptor"; value: Uint8Array; @@ -118,11 +113,6 @@ export interface ScalarDescriptor { */ fieldType: ScalarType[]; } -export interface ReactiveScalarDescriptor { - name: ComputedRef; - description: ComputedRef; - fieldType: ComputedRef; -} export interface ScalarDescriptorProtoMsg { typeUrl: "/cosmos_proto.ScalarDescriptor"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmwasm/rpc.query.ts b/libs/injective-vue/src/cosmwasm/rpc.query.ts deleted file mode 100644 index e302bcf3..00000000 --- a/libs/injective-vue/src/cosmwasm/rpc.query.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import { QueryClient } from "@cosmjs/stargate"; -export const createRPCQueryClient = async ({ - rpcEndpoint -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - cosmos: { - auth: { - v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - bank: { - v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - gov: { - v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - staking: { - v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - tx: { - v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) - } - }, - cosmwasm: { - wasm: { - v1: (await import("./wasm/v1/query.rpc.Query")).createRpcQueryExtension(client) - } - } - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/rpc.tx.ts b/libs/injective-vue/src/cosmwasm/rpc.tx.ts deleted file mode 100644 index 26661193..00000000 --- a/libs/injective-vue/src/cosmwasm/rpc.tx.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - authz: { - v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - cosmwasm: { - wasm: { - v1: new (await import("./wasm/v1/tx.rpc.msg")).MsgClientImpl(rpc) - } - } -}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/proposal_legacy.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/proposal_legacy.ts index a957e537..a8b1c4f2 100644 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/proposal_legacy.ts +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/proposal_legacy.ts @@ -4,7 +4,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; -import { ComputedRef } from "vue"; /** * 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, @@ -38,17 +37,6 @@ export interface StoreCodeProposal { */ codeHash: Uint8Array; } -export interface ReactiveStoreCodeProposal { - title: ComputedRef; - description: ComputedRef; - runAs: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; - unpinCode: ComputedRef; - source: ComputedRef; - builder: ComputedRef; - codeHash: ComputedRef; -} export interface StoreCodeProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal"; value: Uint8Array; @@ -115,16 +103,6 @@ export interface InstantiateContractProposal { /** Funds coins that are transferred to the contract on instantiation */ funds: Coin[]; } -export interface ReactiveInstantiateContractProposal { - title: ComputedRef; - description: ComputedRef; - runAs: ComputedRef; - admin: ComputedRef; - codeId: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; -} export interface InstantiateContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal"; value: Uint8Array; @@ -190,18 +168,6 @@ export interface InstantiateContract2Proposal { */ fixMsg: boolean; } -export interface ReactiveInstantiateContract2Proposal { - title: ComputedRef; - description: ComputedRef; - runAs: ComputedRef; - admin: ComputedRef; - codeId: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; - salt: ComputedRef; - fixMsg: ComputedRef; -} export interface InstantiateContract2ProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; value: Uint8Array; @@ -261,13 +227,6 @@ export interface MigrateContractProposal { /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } -export interface ReactiveMigrateContractProposal { - title: ComputedRef; - description: ComputedRef; - contract: ComputedRef; - codeId: ComputedRef; - msg: ComputedRef; -} export interface MigrateContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal"; value: Uint8Array; @@ -312,12 +271,6 @@ export interface SudoContractProposal { /** Msg json encoded message to be passed to the contract as sudo */ msg: Uint8Array; } -export interface ReactiveSudoContractProposal { - title: ComputedRef; - description: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; -} export interface SudoContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal"; value: Uint8Array; @@ -364,14 +317,6 @@ export interface ExecuteContractProposal { /** Funds coins that are transferred to the contract on instantiation */ funds: Coin[]; } -export interface ReactiveExecuteContractProposal { - title: ComputedRef; - description: ComputedRef; - runAs: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; -} export interface ExecuteContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal"; value: Uint8Array; @@ -418,12 +363,6 @@ export interface UpdateAdminProposal { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveUpdateAdminProposal { - title: ComputedRef; - description: ComputedRef; - newAdmin: ComputedRef; - contract: ComputedRef; -} export interface UpdateAdminProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal"; value: Uint8Array; @@ -464,11 +403,6 @@ export interface ClearAdminProposal { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveClearAdminProposal { - title: ComputedRef; - description: ComputedRef; - contract: ComputedRef; -} export interface ClearAdminProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal"; value: Uint8Array; @@ -507,11 +441,6 @@ export interface PinCodesProposal { /** CodeIDs references the new WASM codes */ codeIds: bigint[]; } -export interface ReactivePinCodesProposal { - title: ComputedRef; - description: ComputedRef; - codeIds: ComputedRef; -} export interface PinCodesProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal"; value: Uint8Array; @@ -550,11 +479,6 @@ export interface UnpinCodesProposal { /** CodeIDs references the WASM codes */ codeIds: bigint[]; } -export interface ReactiveUnpinCodesProposal { - title: ComputedRef; - description: ComputedRef; - codeIds: ComputedRef; -} export interface UnpinCodesProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal"; value: Uint8Array; @@ -588,10 +512,6 @@ export interface AccessConfigUpdate { /** InstantiatePermission to apply to the set of code ids */ instantiatePermission: AccessConfig; } -export interface ReactiveAccessConfigUpdate { - codeId: ComputedRef; - instantiatePermission: ComputedRef; -} export interface AccessConfigUpdateProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate"; value: Uint8Array; @@ -628,11 +548,6 @@ export interface UpdateInstantiateConfigProposal { */ accessConfigUpdates: AccessConfigUpdate[]; } -export interface ReactiveUpdateInstantiateConfigProposal { - title: ComputedRef; - description: ComputedRef; - accessConfigUpdates: ComputedRef; -} export interface UpdateInstantiateConfigProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; value: Uint8Array; @@ -700,21 +615,6 @@ export interface StoreAndInstantiateContractProposal { */ codeHash: Uint8Array; } -export interface ReactiveStoreAndInstantiateContractProposal { - title: ComputedRef; - description: ComputedRef; - runAs: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; - unpinCode: ComputedRef; - admin: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; - source: ComputedRef; - builder: ComputedRef; - codeHash: ComputedRef; -} export interface StoreAndInstantiateContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts deleted file mode 100644 index 2120533e..00000000 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts +++ /dev/null @@ -1,612 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse, ReactiveQueryContractInfoRequest, ReactiveQueryContractHistoryRequest, ReactiveQueryContractsByCodeRequest, ReactiveQueryAllContractStateRequest, ReactiveQueryRawContractStateRequest, ReactiveQuerySmartContractStateRequest, ReactiveQueryCodeRequest, ReactiveQueryCodesRequest, ReactiveQueryCodeInfoRequest, ReactiveQueryPinnedCodesRequest, ReactiveQueryParamsRequest, ReactiveQueryContractsByCreatorRequest, ReactiveQueryWasmLimitsConfigRequest, ReactiveQueryBuildAddressRequest } from "./query"; -/** Query provides defines the gRPC querier service */ -export interface Query { - /** ContractInfo gets the contract meta data */ - contractInfo(request: QueryContractInfoRequest): Promise; - /** ContractHistory gets the contract code history */ - contractHistory(request: QueryContractHistoryRequest): Promise; - /** ContractsByCode lists all smart contracts for a code id */ - contractsByCode(request: QueryContractsByCodeRequest): Promise; - /** AllContractState gets all raw store data for a single contract */ - allContractState(request: QueryAllContractStateRequest): Promise; - /** RawContractState gets single key from the raw store data of a contract */ - rawContractState(request: QueryRawContractStateRequest): Promise; - /** SmartContractState get smart query result from the contract */ - smartContractState(request: QuerySmartContractStateRequest): Promise; - /** Code gets the binary code and metadata for a single wasm code */ - code(request: QueryCodeRequest): Promise; - /** Codes gets the metadata for all stored wasm codes */ - codes(request?: QueryCodesRequest): Promise; - /** CodeInfo gets the metadata for a single wasm code */ - codeInfo(request: QueryCodeInfoRequest): Promise; - /** PinnedCodes gets the pinned code ids */ - pinnedCodes(request?: QueryPinnedCodesRequest): Promise; - /** Params gets the module params */ - params(request?: QueryParamsRequest): Promise; - /** ContractsByCreator gets the contracts by creator */ - contractsByCreator(request: QueryContractsByCreatorRequest): Promise; - /** - * WasmLimitsConfig gets the configured limits for static validation of Wasm - * files, encoded in JSON. - */ - wasmLimitsConfig(request?: QueryWasmLimitsConfigRequest): Promise; - /** BuildAddress builds a contract address */ - buildAddress(request: QueryBuildAddressRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* ContractInfo gets the contract meta data */ - contractInfo = async (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 BinaryReader(data))); - }; - /* ContractHistory gets the contract code history */ - contractHistory = async (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 BinaryReader(data))); - }; - /* ContractsByCode lists all smart contracts for a code id */ - contractsByCode = async (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 BinaryReader(data))); - }; - /* AllContractState gets all raw store data for a single contract */ - allContractState = async (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 BinaryReader(data))); - }; - /* RawContractState gets single key from the raw store data of a contract */ - rawContractState = async (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 BinaryReader(data))); - }; - /* SmartContractState get smart query result from the contract */ - smartContractState = async (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 BinaryReader(data))); - }; - /* Code gets the binary code and metadata for a single wasm code */ - code = async (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 BinaryReader(data))); - }; - /* Codes gets the metadata for all stored wasm codes */ - codes = async (request: QueryCodesRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* CodeInfo gets the metadata for a single wasm code */ - codeInfo = async (request: QueryCodeInfoRequest): Promise => { - const data = QueryCodeInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "CodeInfo", data); - return promise.then(data => QueryCodeInfoResponse.decode(new BinaryReader(data))); - }; - /* PinnedCodes gets the pinned code ids */ - pinnedCodes = async (request: QueryPinnedCodesRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* Params gets the module params */ - params = async (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 BinaryReader(data))); - }; - /* ContractsByCreator gets the contracts by creator */ - contractsByCreator = async (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 BinaryReader(data))); - }; - /* WasmLimitsConfig gets the configured limits for static validation of Wasm - files, encoded in JSON. */ - wasmLimitsConfig = async (request: QueryWasmLimitsConfigRequest = {}): Promise => { - const data = QueryWasmLimitsConfigRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "WasmLimitsConfig", data); - return promise.then(data => QueryWasmLimitsConfigResponse.decode(new BinaryReader(data))); - }; - /* BuildAddress builds a contract address */ - buildAddress = async (request: QueryBuildAddressRequest): Promise => { - const data = QueryBuildAddressRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "BuildAddress", data); - return promise.then(data => QueryBuildAddressResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - contractInfo(request: QueryContractInfoRequest): Promise { - return queryService.contractInfo(request); - }, - contractHistory(request: QueryContractHistoryRequest): Promise { - return queryService.contractHistory(request); - }, - contractsByCode(request: QueryContractsByCodeRequest): Promise { - return queryService.contractsByCode(request); - }, - allContractState(request: QueryAllContractStateRequest): Promise { - return queryService.allContractState(request); - }, - rawContractState(request: QueryRawContractStateRequest): Promise { - return queryService.rawContractState(request); - }, - smartContractState(request: QuerySmartContractStateRequest): Promise { - return queryService.smartContractState(request); - }, - code(request: QueryCodeRequest): Promise { - return queryService.code(request); - }, - codes(request?: QueryCodesRequest): Promise { - return queryService.codes(request); - }, - codeInfo(request: QueryCodeInfoRequest): Promise { - return queryService.codeInfo(request); - }, - pinnedCodes(request?: QueryPinnedCodesRequest): Promise { - return queryService.pinnedCodes(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - contractsByCreator(request: QueryContractsByCreatorRequest): Promise { - return queryService.contractsByCreator(request); - }, - wasmLimitsConfig(request?: QueryWasmLimitsConfigRequest): Promise { - return queryService.wasmLimitsConfig(request); - }, - buildAddress(request: QueryBuildAddressRequest): Promise { - return queryService.buildAddress(request); - } - }; -}; -export interface UseContractInfoQuery extends VueQueryParams { - request: ReactiveQueryContractInfoRequest; -} -export interface UseContractHistoryQuery extends VueQueryParams { - request: ReactiveQueryContractHistoryRequest; -} -export interface UseContractsByCodeQuery extends VueQueryParams { - request: ReactiveQueryContractsByCodeRequest; -} -export interface UseAllContractStateQuery extends VueQueryParams { - request: ReactiveQueryAllContractStateRequest; -} -export interface UseRawContractStateQuery extends VueQueryParams { - request: ReactiveQueryRawContractStateRequest; -} -export interface UseSmartContractStateQuery extends VueQueryParams { - request: ReactiveQuerySmartContractStateRequest; -} -export interface UseCodeQuery extends VueQueryParams { - request: ReactiveQueryCodeRequest; -} -export interface UseCodesQuery extends VueQueryParams { - request?: ReactiveQueryCodesRequest; -} -export interface UseCodeInfoQuery extends VueQueryParams { - request: ReactiveQueryCodeInfoRequest; -} -export interface UsePinnedCodesQuery extends VueQueryParams { - request?: ReactiveQueryPinnedCodesRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseContractsByCreatorQuery extends VueQueryParams { - request: ReactiveQueryContractsByCreatorRequest; -} -export interface UseWasmLimitsConfigQuery extends VueQueryParams { - request?: ReactiveQueryWasmLimitsConfigRequest; -} -export interface UseBuildAddressQuery extends VueQueryParams { - request: ReactiveQueryBuildAddressRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useContractInfo = ({ - request, - options - }: UseContractInfoQuery) => { - const queryKey = ["contractInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractInfo(params); - }, - ...options - }); - }; - const useContractHistory = ({ - request, - options - }: UseContractHistoryQuery) => { - const queryKey = ["contractHistoryQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractHistory(params); - }, - ...options - }); - }; - const useContractsByCode = ({ - request, - options - }: UseContractsByCodeQuery) => { - const queryKey = ["contractsByCodeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractsByCode(params); - }, - ...options - }); - }; - const useAllContractState = ({ - request, - options - }: UseAllContractStateQuery) => { - const queryKey = ["allContractStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allContractState(params); - }, - ...options - }); - }; - const useRawContractState = ({ - request, - options - }: UseRawContractStateQuery) => { - const queryKey = ["rawContractStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.rawContractState(params); - }, - ...options - }); - }; - const useSmartContractState = ({ - request, - options - }: UseSmartContractStateQuery) => { - const queryKey = ["smartContractStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.smartContractState(params); - }, - ...options - }); - }; - const useCode = ({ - request, - options - }: UseCodeQuery) => { - const queryKey = ["codeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.code(params); - }, - ...options - }); - }; - const useCodes = ({ - request, - options - }: UseCodesQuery) => { - const queryKey = ["codesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.codes(params); - }, - ...options - }); - }; - const useCodeInfo = ({ - request, - options - }: UseCodeInfoQuery) => { - const queryKey = ["codeInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.codeInfo(params); - }, - ...options - }); - }; - const usePinnedCodes = ({ - request, - options - }: UsePinnedCodesQuery) => { - const queryKey = ["pinnedCodesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pinnedCodes(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useContractsByCreator = ({ - request, - options - }: UseContractsByCreatorQuery) => { - const queryKey = ["contractsByCreatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractsByCreator(params); - }, - ...options - }); - }; - const useWasmLimitsConfig = ({ - request, - options - }: UseWasmLimitsConfigQuery) => { - const queryKey = ["wasmLimitsConfigQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.wasmLimitsConfig(params); - }, - ...options - }); - }; - const useBuildAddress = ({ - request, - options - }: UseBuildAddressQuery) => { - const queryKey = ["buildAddressQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.buildAddress(params); - }, - ...options - }); - }; - return { - /** ContractInfo gets the contract meta data */useContractInfo, - /** ContractHistory gets the contract code history */useContractHistory, - /** ContractsByCode lists all smart contracts for a code id */useContractsByCode, - /** AllContractState gets all raw store data for a single contract */useAllContractState, - /** RawContractState gets single key from the raw store data of a contract */useRawContractState, - /** SmartContractState get smart query result from the contract */useSmartContractState, - /** Code gets the binary code and metadata for a single wasm code */useCode, - /** Codes gets the metadata for all stored wasm codes */useCodes, - /** CodeInfo gets the metadata for a single wasm code */useCodeInfo, - /** PinnedCodes gets the pinned code ids */usePinnedCodes, - /** Params gets the module params */useParams, - /** ContractsByCreator gets the contracts by creator */useContractsByCreator, - /** - * WasmLimitsConfig gets the configured limits for static validation of Wasm - * files, encoded in JSON. - */ - useWasmLimitsConfig, - /** BuildAddress builds a contract address */useBuildAddress - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts new file mode 100644 index 00000000..8a0c89f5 --- /dev/null +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts @@ -0,0 +1,100 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractInfoRequest.encode, + decode: QueryContractInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractInfo", + clientResolver +}); +export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractHistoryRequest.encode, + decode: QueryContractHistoryResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractHistory", + clientResolver +}); +export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCodeRequest.encode, + decode: QueryContractsByCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCode", + clientResolver +}); +export const createGetAllContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllContractStateRequest.encode, + decode: QueryAllContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "AllContractState", + clientResolver +}); +export const createGetRawContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRawContractStateRequest.encode, + decode: QueryRawContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "RawContractState", + clientResolver +}); +export const createGetSmartContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySmartContractStateRequest.encode, + decode: QuerySmartContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "SmartContractState", + clientResolver +}); +export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeRequest.encode, + decode: QueryCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Code", + clientResolver +}); +export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodesRequest.encode, + decode: QueryCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Codes", + clientResolver +}); +export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeInfoRequest.encode, + decode: QueryCodeInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "CodeInfo", + clientResolver +}); +export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPinnedCodesRequest.encode, + decode: QueryPinnedCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "PinnedCodes", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Params", + clientResolver +}); +export const createGetContractsByCreator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCreatorRequest.encode, + decode: QueryContractsByCreatorResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCreator", + clientResolver +}); +export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmLimitsConfigRequest.encode, + decode: QueryWasmLimitsConfigResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "WasmLimitsConfig", + clientResolver +}); +export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBuildAddressRequest.encode, + decode: QueryBuildAddressResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "BuildAddress", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts new file mode 100644 index 00000000..d021b1a4 --- /dev/null +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts @@ -0,0 +1,59 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +export const useGetContractInfo = buildUseVueQuery({ + builderQueryFn: createGetContractInfo, + queryKeyPrefix: "ContractInfoQuery" +}); +export const useGetContractHistory = buildUseVueQuery({ + builderQueryFn: createGetContractHistory, + queryKeyPrefix: "ContractHistoryQuery" +}); +export const useGetContractsByCode = buildUseVueQuery({ + builderQueryFn: createGetContractsByCode, + queryKeyPrefix: "ContractsByCodeQuery" +}); +export const useGetAllContractState = buildUseVueQuery({ + builderQueryFn: createGetAllContractState, + queryKeyPrefix: "AllContractStateQuery" +}); +export const useGetRawContractState = buildUseVueQuery({ + builderQueryFn: createGetRawContractState, + queryKeyPrefix: "RawContractStateQuery" +}); +export const useGetSmartContractState = buildUseVueQuery({ + builderQueryFn: createGetSmartContractState, + queryKeyPrefix: "SmartContractStateQuery" +}); +export const useGetCode = buildUseVueQuery({ + builderQueryFn: createGetCode, + queryKeyPrefix: "CodeQuery" +}); +export const useGetCodes = buildUseVueQuery({ + builderQueryFn: createGetCodes, + queryKeyPrefix: "CodesQuery" +}); +export const useGetCodeInfo = buildUseVueQuery({ + builderQueryFn: createGetCodeInfo, + queryKeyPrefix: "CodeInfoQuery" +}); +export const useGetPinnedCodes = buildUseVueQuery({ + builderQueryFn: createGetPinnedCodes, + queryKeyPrefix: "PinnedCodesQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetContractsByCreator = buildUseVueQuery({ + builderQueryFn: createGetContractsByCreator, + queryKeyPrefix: "ContractsByCreatorQuery" +}); +export const useGetWasmLimitsConfig = buildUseVueQuery({ + builderQueryFn: createGetWasmLimitsConfig, + queryKeyPrefix: "WasmLimitsConfigQuery" +}); +export const useGetBuildAddress = buildUseVueQuery({ + builderQueryFn: createGetBuildAddress, + queryKeyPrefix: "BuildAddressQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/query.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/query.ts index 339f1680..cd8c0b8e 100644 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/query.ts +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/query.ts @@ -4,7 +4,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; -import { ComputedRef } from "vue"; /** * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC * method @@ -13,9 +12,6 @@ export interface QueryContractInfoRequest { /** address is the address of the contract to query */ address: string; } -export interface ReactiveQueryContractInfoRequest { - address: ComputedRef; -} export interface QueryContractInfoRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest"; value: Uint8Array; @@ -41,10 +37,6 @@ export interface QueryContractInfoResponse { address: string; contractInfo: ContractInfo; } -export interface ReactiveQueryContractInfoResponse { - address: ComputedRef; - contractInfo: ComputedRef; -} export interface QueryContractInfoResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse"; value: Uint8Array; @@ -72,10 +64,6 @@ export interface QueryContractHistoryRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryContractHistoryRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractHistoryRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest"; value: Uint8Array; @@ -103,10 +91,6 @@ export interface QueryContractHistoryResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryContractHistoryResponse { - entries: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractHistoryResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse"; value: Uint8Array; @@ -134,10 +118,6 @@ export interface QueryContractsByCodeRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryContractsByCodeRequest { - codeId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCodeRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest"; value: Uint8Array; @@ -166,10 +146,6 @@ export interface QueryContractsByCodeResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryContractsByCodeResponse { - contracts: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse"; value: Uint8Array; @@ -198,10 +174,6 @@ export interface QueryAllContractStateRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAllContractStateRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest"; value: Uint8Array; @@ -229,10 +201,6 @@ export interface QueryAllContractStateResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAllContractStateResponse { - models: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse"; value: Uint8Array; @@ -259,10 +227,6 @@ export interface QueryRawContractStateRequest { address: string; queryData: Uint8Array; } -export interface ReactiveQueryRawContractStateRequest { - address: ComputedRef; - queryData: ComputedRef; -} export interface QueryRawContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest"; value: Uint8Array; @@ -288,9 +252,6 @@ export interface QueryRawContractStateResponse { /** Data contains the raw store data */ data: Uint8Array; } -export interface ReactiveQueryRawContractStateResponse { - data: ComputedRef; -} export interface QueryRawContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse"; value: Uint8Array; @@ -317,10 +278,6 @@ export interface QuerySmartContractStateRequest { /** QueryData contains the query data passed to the contract */ queryData: Uint8Array; } -export interface ReactiveQuerySmartContractStateRequest { - address: ComputedRef; - queryData: ComputedRef; -} export interface QuerySmartContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest"; value: Uint8Array; @@ -347,9 +304,6 @@ export interface QuerySmartContractStateResponse { /** Data contains the json data returned from the smart contract */ data: Uint8Array; } -export interface ReactiveQuerySmartContractStateResponse { - data: ComputedRef; -} export interface QuerySmartContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse"; value: Uint8Array; @@ -371,9 +325,6 @@ export interface QueryCodeRequest { /** grpc-gateway_out does not support Go style CodeID */ codeId: bigint; } -export interface ReactiveQueryCodeRequest { - codeId: ComputedRef; -} export interface QueryCodeRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest"; value: Uint8Array; @@ -392,9 +343,6 @@ export interface QueryCodeInfoRequest { /** grpc-gateway_out does not support Go style CodeID */ codeId: bigint; } -export interface ReactiveQueryCodeInfoRequest { - codeId: ComputedRef; -} export interface QueryCodeInfoRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest"; value: Uint8Array; @@ -415,12 +363,6 @@ export interface QueryCodeInfoResponse { checksum: Uint8Array; instantiatePermission: AccessConfig; } -export interface ReactiveQueryCodeInfoResponse { - codeId: ComputedRef; - creator: ComputedRef; - checksum: ComputedRef; - instantiatePermission: ComputedRef; -} export interface QueryCodeInfoResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse"; value: Uint8Array; @@ -443,12 +385,6 @@ export interface CodeInfoResponse { dataHash: Uint8Array; instantiatePermission: AccessConfig; } -export interface ReactiveCodeInfoResponse { - codeId: ComputedRef; - creator: ComputedRef; - dataHash: ComputedRef; - instantiatePermission: ComputedRef; -} export interface CodeInfoResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse"; value: Uint8Array; @@ -469,10 +405,6 @@ export interface QueryCodeResponse { codeInfo?: CodeInfoResponse; data: Uint8Array; } -export interface ReactiveQueryCodeResponse { - codeInfo?: ComputedRef; - data: ComputedRef; -} export interface QueryCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse"; value: Uint8Array; @@ -491,9 +423,6 @@ export interface QueryCodesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryCodesRequest { - pagination?: ComputedRef; -} export interface QueryCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest"; value: Uint8Array; @@ -513,10 +442,6 @@ export interface QueryCodesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryCodesResponse { - codeInfos: ComputedRef; - pagination?: ComputedRef; -} export interface QueryCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse"; value: Uint8Array; @@ -539,9 +464,6 @@ export interface QueryPinnedCodesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryPinnedCodesRequest { - pagination?: ComputedRef; -} export interface QueryPinnedCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest"; value: Uint8Array; @@ -567,10 +489,6 @@ export interface QueryPinnedCodesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryPinnedCodesResponse { - codeIds: ComputedRef; - pagination?: ComputedRef; -} export interface QueryPinnedCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse"; value: Uint8Array; @@ -590,7 +508,6 @@ export interface QueryPinnedCodesResponseAminoMsg { } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest"; value: Uint8Array; @@ -606,9 +523,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse"; value: Uint8Array; @@ -632,10 +546,6 @@ export interface QueryContractsByCreatorRequest { /** Pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryContractsByCreatorRequest { - creatorAddress: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCreatorRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest"; value: Uint8Array; @@ -664,10 +574,6 @@ export interface QueryContractsByCreatorResponse { /** Pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryContractsByCreatorResponse { - contractAddresses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCreatorResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse"; value: Uint8Array; @@ -691,7 +597,6 @@ export interface QueryContractsByCreatorResponseAminoMsg { * Query/WasmLimitsConfig RPC method. */ export interface QueryWasmLimitsConfigRequest {} -export interface ReactiveQueryWasmLimitsConfigRequest {} export interface QueryWasmLimitsConfigRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest"; value: Uint8Array; @@ -713,9 +618,6 @@ export interface QueryWasmLimitsConfigRequestAminoMsg { export interface QueryWasmLimitsConfigResponse { config: string; } -export interface ReactiveQueryWasmLimitsConfigResponse { - config: ComputedRef; -} export interface QueryWasmLimitsConfigResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse"; value: Uint8Array; @@ -749,12 +651,6 @@ export interface QueryBuildAddressRequest { */ initArgs: Uint8Array; } -export interface ReactiveQueryBuildAddressRequest { - codeHash: ComputedRef; - creatorAddress: ComputedRef; - salt: ComputedRef; - initArgs: ComputedRef; -} export interface QueryBuildAddressRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressRequest"; value: Uint8Array; @@ -788,9 +684,6 @@ export interface QueryBuildAddressResponse { /** Address is the contract address */ address: string; } -export interface ReactiveQueryBuildAddressResponse { - address: ComputedRef; -} export interface QueryBuildAddressResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.amino.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.amino.ts deleted file mode 100644 index bdd72ab7..00000000 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.amino.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; -export const AminoConverter = { - "/cosmwasm.wasm.v1.MsgStoreCode": { - aminoType: "wasm/MsgStoreCode", - toAmino: MsgStoreCode.toAmino, - fromAmino: MsgStoreCode.fromAmino - }, - "/cosmwasm.wasm.v1.MsgInstantiateContract": { - aminoType: "wasm/MsgInstantiateContract", - toAmino: MsgInstantiateContract.toAmino, - fromAmino: MsgInstantiateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgInstantiateContract2": { - aminoType: "wasm/MsgInstantiateContract2", - toAmino: MsgInstantiateContract2.toAmino, - fromAmino: MsgInstantiateContract2.fromAmino - }, - "/cosmwasm.wasm.v1.MsgExecuteContract": { - aminoType: "wasm/MsgExecuteContract", - toAmino: MsgExecuteContract.toAmino, - fromAmino: MsgExecuteContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgMigrateContract": { - aminoType: "wasm/MsgMigrateContract", - toAmino: MsgMigrateContract.toAmino, - fromAmino: MsgMigrateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateAdmin": { - aminoType: "wasm/MsgUpdateAdmin", - toAmino: MsgUpdateAdmin.toAmino, - fromAmino: MsgUpdateAdmin.fromAmino - }, - "/cosmwasm.wasm.v1.MsgClearAdmin": { - aminoType: "wasm/MsgClearAdmin", - toAmino: MsgClearAdmin.toAmino, - fromAmino: MsgClearAdmin.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig": { - aminoType: "wasm/MsgUpdateInstantiateConfig", - toAmino: MsgUpdateInstantiateConfig.toAmino, - fromAmino: MsgUpdateInstantiateConfig.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateParams": { - aminoType: "wasm/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmwasm.wasm.v1.MsgSudoContract": { - aminoType: "wasm/MsgSudoContract", - toAmino: MsgSudoContract.toAmino, - fromAmino: MsgSudoContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgPinCodes": { - aminoType: "wasm/MsgPinCodes", - toAmino: MsgPinCodes.toAmino, - fromAmino: MsgPinCodes.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUnpinCodes": { - aminoType: "wasm/MsgUnpinCodes", - toAmino: MsgUnpinCodes.toAmino, - fromAmino: MsgUnpinCodes.fromAmino - }, - "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract": { - aminoType: "wasm/MsgStoreAndInstantiateContract", - toAmino: MsgStoreAndInstantiateContract.toAmino, - fromAmino: MsgStoreAndInstantiateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses": { - aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", - toAmino: MsgRemoveCodeUploadParamsAddresses.toAmino, - fromAmino: MsgRemoveCodeUploadParamsAddresses.fromAmino - }, - "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses": { - aminoType: "wasm/MsgAddCodeUploadParamsAddresses", - toAmino: MsgAddCodeUploadParamsAddresses.toAmino, - fromAmino: MsgAddCodeUploadParamsAddresses.fromAmino - }, - "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract": { - aminoType: "wasm/MsgStoreAndMigrateContract", - toAmino: MsgStoreAndMigrateContract.toAmino, - fromAmino: MsgStoreAndMigrateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateContractLabel": { - aminoType: "wasm/MsgUpdateContractLabel", - toAmino: MsgUpdateContractLabel.toAmino, - fromAmino: MsgUpdateContractLabel.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts new file mode 100644 index 00000000..61f2ed80 --- /dev/null +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts @@ -0,0 +1,105 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +export const createStoreCode = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreCode.typeUrl, + encoders: toEncoders(MsgStoreCode), + converters: toConverters(MsgStoreCode) +}); +export const createInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract.typeUrl, + encoders: toEncoders(MsgInstantiateContract), + converters: toConverters(MsgInstantiateContract) +}); +export const createInstantiateContract2 = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract2.typeUrl, + encoders: toEncoders(MsgInstantiateContract2), + converters: toConverters(MsgInstantiateContract2) +}); +export const createExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecuteContract.typeUrl, + encoders: toEncoders(MsgExecuteContract), + converters: toConverters(MsgExecuteContract) +}); +export const createMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMigrateContract.typeUrl, + encoders: toEncoders(MsgMigrateContract), + converters: toConverters(MsgMigrateContract) +}); +export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateAdmin.typeUrl, + encoders: toEncoders(MsgUpdateAdmin), + converters: toConverters(MsgUpdateAdmin) +}); +export const createClearAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgClearAdmin.typeUrl, + encoders: toEncoders(MsgClearAdmin), + converters: toConverters(MsgClearAdmin) +}); +export const createUpdateInstantiateConfig = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateInstantiateConfig.typeUrl, + encoders: toEncoders(MsgUpdateInstantiateConfig), + converters: toConverters(MsgUpdateInstantiateConfig) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createSudoContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSudoContract.typeUrl, + encoders: toEncoders(MsgSudoContract), + converters: toConverters(MsgSudoContract) +}); +export const createPinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPinCodes.typeUrl, + encoders: toEncoders(MsgPinCodes), + converters: toConverters(MsgPinCodes) +}); +export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnpinCodes.typeUrl, + encoders: toEncoders(MsgUnpinCodes), + converters: toConverters(MsgUnpinCodes) +}); +export const createStoreAndInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndInstantiateContract.typeUrl, + encoders: toEncoders(MsgStoreAndInstantiateContract), + converters: toConverters(MsgStoreAndInstantiateContract) +}); +export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRemoveCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgRemoveCodeUploadParamsAddresses), + converters: toConverters(MsgRemoveCodeUploadParamsAddresses) +}); +export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAddCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgAddCodeUploadParamsAddresses), + converters: toConverters(MsgAddCodeUploadParamsAddresses) +}); +export const createStoreAndMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndMigrateContract.typeUrl, + encoders: toEncoders(MsgStoreAndMigrateContract), + converters: toConverters(MsgStoreAndMigrateContract) +}); +export const createUpdateContractLabel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateContractLabel.typeUrl, + encoders: toEncoders(MsgUpdateContractLabel), + converters: toConverters(MsgUpdateContractLabel) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts deleted file mode 100644 index a5181ebb..00000000 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSudoContract, MsgSudoContractResponse, MsgPinCodes, MsgPinCodesResponse, MsgUnpinCodes, MsgUnpinCodesResponse, MsgStoreAndInstantiateContract, MsgStoreAndInstantiateContractResponse, MsgRemoveCodeUploadParamsAddresses, MsgRemoveCodeUploadParamsAddressesResponse, MsgAddCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddressesResponse, MsgStoreAndMigrateContract, MsgStoreAndMigrateContractResponse, MsgUpdateContractLabel, MsgUpdateContractLabelResponse } from "./tx"; -/** Msg defines the wasm Msg service. */ -export interface Msg { - /** StoreCode to submit Wasm code to the system */ - storeCode(request: MsgStoreCode): Promise; - /** - * InstantiateContract creates a new smart contract instance for the given - * code id. - */ - instantiateContract(request: MsgInstantiateContract): Promise; - /** - * InstantiateContract2 creates a new smart contract instance for the given - * code id with a predictable address - */ - instantiateContract2(request: MsgInstantiateContract2): Promise; - /** Execute submits the given message data to a smart contract */ - 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 */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* StoreCode to submit Wasm code to the system */ - storeCode = async (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 BinaryReader(data))); - }; - /* InstantiateContract creates a new smart contract instance for the given - code id. */ - instantiateContract = async (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 BinaryReader(data))); - }; - /* InstantiateContract2 creates a new smart contract instance for the given - code id with a predictable address */ - instantiateContract2 = async (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 BinaryReader(data))); - }; - /* Execute submits the given message data to a smart contract */ - executeContract = async (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 BinaryReader(data))); - }; - /* Migrate runs a code upgrade/ downgrade for a smart contract */ - migrateContract = async (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 BinaryReader(data))); - }; - /* UpdateAdmin sets a new admin for a smart contract */ - updateAdmin = async (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 BinaryReader(data))); - }; - /* ClearAdmin removes any admin stored for a smart contract */ - clearAdmin = async (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 BinaryReader(data))); - }; - /* UpdateInstantiateConfig updates instantiate config for a smart contract */ - updateInstantiateConfig = async (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 BinaryReader(data))); - }; - /* UpdateParams defines a governance operation for updating the x/wasm - module parameters. The authority is defined in the keeper. - - Since: 0.40 */ - updateParams = async (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 BinaryReader(data))); - }; - /* SudoContract defines a governance operation for calling sudo - on a contract. The authority is defined in the keeper. - - Since: 0.40 */ - sudoContract = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* StoreAndInstantiateContract defines a governance operation for storing - and instantiating the contract. The authority is defined in the keeper. - - Since: 0.40 */ - storeAndInstantiateContract = async (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 BinaryReader(data))); - }; - /* RemoveCodeUploadParamsAddresses defines a governance operation for - removing addresses from code upload params. - The authority is defined in the keeper. */ - removeCodeUploadParamsAddresses = async (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 BinaryReader(data))); - }; - /* AddCodeUploadParamsAddresses defines a governance operation for - adding addresses to code upload params. - The authority is defined in the keeper. */ - addCodeUploadParamsAddresses = async (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 BinaryReader(data))); - }; - /* StoreAndMigrateContract defines a governance operation for storing - and migrating the contract. The authority is defined in the keeper. - - Since: 0.42 */ - storeAndMigrateContract = async (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 BinaryReader(data))); - }; - /* UpdateContractLabel sets a new label for a smart contract - - Since: 0.43 */ - updateContractLabel = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..9cf6e9ad --- /dev/null +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts @@ -0,0 +1,54 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +export const useStoreCode = buildUseVueMutation({ + builderMutationFn: createStoreCode +}); +export const useInstantiateContract = buildUseVueMutation({ + builderMutationFn: createInstantiateContract +}); +export const useInstantiateContract2 = buildUseVueMutation({ + builderMutationFn: createInstantiateContract2 +}); +export const useExecuteContract = buildUseVueMutation({ + builderMutationFn: createExecuteContract +}); +export const useMigrateContract = buildUseVueMutation({ + builderMutationFn: createMigrateContract +}); +export const useUpdateAdmin = buildUseVueMutation({ + builderMutationFn: createUpdateAdmin +}); +export const useClearAdmin = buildUseVueMutation({ + builderMutationFn: createClearAdmin +}); +export const useUpdateInstantiateConfig = buildUseVueMutation({ + builderMutationFn: createUpdateInstantiateConfig +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useSudoContract = buildUseVueMutation({ + builderMutationFn: createSudoContract +}); +export const usePinCodes = buildUseVueMutation({ + builderMutationFn: createPinCodes +}); +export const useUnpinCodes = buildUseVueMutation({ + builderMutationFn: createUnpinCodes +}); +export const useStoreAndInstantiateContract = buildUseVueMutation({ + builderMutationFn: createStoreAndInstantiateContract +}); +export const useRemoveCodeUploadParamsAddresses = buildUseVueMutation({ + builderMutationFn: createRemoveCodeUploadParamsAddresses +}); +export const useAddCodeUploadParamsAddresses = buildUseVueMutation({ + builderMutationFn: createAddCodeUploadParamsAddresses +}); +export const useStoreAndMigrateContract = buildUseVueMutation({ + builderMutationFn: createStoreAndMigrateContract +}); +export const useUpdateContractLabel = buildUseVueMutation({ + builderMutationFn: createUpdateContractLabel +}); \ No newline at end of file diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.ts index 78684ea0..bf08add4 100644 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.ts +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.ts @@ -4,7 +4,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; -import { ComputedRef } from "vue"; /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCode { /** Sender is the actor that signed the messages */ @@ -17,11 +16,6 @@ export interface MsgStoreCode { */ instantiatePermission?: AccessConfig; } -export interface ReactiveMsgStoreCode { - sender: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; -} export interface MsgStoreCodeProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode"; value: Uint8Array; @@ -49,10 +43,6 @@ export interface MsgStoreCodeResponse { /** Checksum is the sha256 hash of the stored code */ checksum: Uint8Array; } -export interface ReactiveMsgStoreCodeResponse { - codeId: ComputedRef; - checksum: ComputedRef; -} export interface MsgStoreCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse"; value: Uint8Array; @@ -86,14 +76,6 @@ export interface MsgInstantiateContract { /** Funds coins that are transferred to the contract on instantiation */ funds: Coin[]; } -export interface ReactiveMsgInstantiateContract { - sender: ComputedRef; - admin: ComputedRef; - codeId: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; -} export interface MsgInstantiateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract"; value: Uint8Array; @@ -127,10 +109,6 @@ export interface MsgInstantiateContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgInstantiateContractResponse { - address: ComputedRef; - data: ComputedRef; -} export interface MsgInstantiateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; value: Uint8Array; @@ -171,16 +149,6 @@ export interface MsgInstantiateContract2 { */ fixMsg: boolean; } -export interface ReactiveMsgInstantiateContract2 { - sender: ComputedRef; - admin: ComputedRef; - codeId: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; - salt: ComputedRef; - fixMsg: ComputedRef; -} export interface MsgInstantiateContract2ProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2"; value: Uint8Array; @@ -221,10 +189,6 @@ export interface MsgInstantiateContract2Response { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgInstantiateContract2Response { - address: ComputedRef; - data: ComputedRef; -} export interface MsgInstantiateContract2ResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response"; value: Uint8Array; @@ -251,12 +215,6 @@ export interface MsgExecuteContract { /** Funds coins that are transferred to the contract on execution */ funds: Coin[]; } -export interface ReactiveMsgExecuteContract { - sender: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; -} export interface MsgExecuteContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract"; value: Uint8Array; @@ -281,9 +239,6 @@ export interface MsgExecuteContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgExecuteContractResponse { - data: ComputedRef; -} export interface MsgExecuteContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse"; value: Uint8Array; @@ -308,12 +263,6 @@ export interface MsgMigrateContract { /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } -export interface ReactiveMsgMigrateContract { - sender: ComputedRef; - contract: ComputedRef; - codeId: ComputedRef; - msg: ComputedRef; -} export interface MsgMigrateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract"; value: Uint8Array; @@ -341,9 +290,6 @@ export interface MsgMigrateContractResponse { */ data: Uint8Array; } -export interface ReactiveMsgMigrateContractResponse { - data: ComputedRef; -} export interface MsgMigrateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse"; value: Uint8Array; @@ -369,11 +315,6 @@ export interface MsgUpdateAdmin { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveMsgUpdateAdmin { - sender: ComputedRef; - newAdmin: ComputedRef; - contract: ComputedRef; -} export interface MsgUpdateAdminProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin"; value: Uint8Array; @@ -393,7 +334,6 @@ export interface MsgUpdateAdminAminoMsg { } /** MsgUpdateAdminResponse returns empty data */ export interface MsgUpdateAdminResponse {} -export interface ReactiveMsgUpdateAdminResponse {} export interface MsgUpdateAdminResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse"; value: Uint8Array; @@ -411,10 +351,6 @@ export interface MsgClearAdmin { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveMsgClearAdmin { - sender: ComputedRef; - contract: ComputedRef; -} export interface MsgClearAdminProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin"; value: Uint8Array; @@ -432,7 +368,6 @@ export interface MsgClearAdminAminoMsg { } /** MsgClearAdminResponse returns empty data */ export interface MsgClearAdminResponse {} -export interface ReactiveMsgClearAdminResponse {} export interface MsgClearAdminResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse"; value: Uint8Array; @@ -452,11 +387,6 @@ export interface MsgUpdateInstantiateConfig { /** NewInstantiatePermission is the new access control */ newInstantiatePermission?: AccessConfig; } -export interface ReactiveMsgUpdateInstantiateConfig { - sender: ComputedRef; - codeId: ComputedRef; - newInstantiatePermission?: ComputedRef; -} export interface MsgUpdateInstantiateConfigProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig"; value: Uint8Array; @@ -476,7 +406,6 @@ export interface MsgUpdateInstantiateConfigAminoMsg { } /** MsgUpdateInstantiateConfigResponse returns empty data */ export interface MsgUpdateInstantiateConfigResponse {} -export interface ReactiveMsgUpdateInstantiateConfigResponse {} export interface MsgUpdateInstantiateConfigResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse"; value: Uint8Array; @@ -502,10 +431,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams"; value: Uint8Array; @@ -536,7 +461,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: 0.40 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -565,11 +489,6 @@ export interface MsgSudoContract { /** Msg json encoded message to be passed to the contract as sudo */ msg: Uint8Array; } -export interface ReactiveMsgSudoContract { - authority: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; -} export interface MsgSudoContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract"; value: Uint8Array; @@ -601,9 +520,6 @@ export interface MsgSudoContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgSudoContractResponse { - data: ComputedRef; -} export interface MsgSudoContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse"; value: Uint8Array; @@ -633,10 +549,6 @@ export interface MsgPinCodes { /** CodeIDs references the new WASM codes */ codeIds: bigint[]; } -export interface ReactiveMsgPinCodes { - authority: ComputedRef; - codeIds: ComputedRef; -} export interface MsgPinCodesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes"; value: Uint8Array; @@ -663,7 +575,6 @@ export interface MsgPinCodesAminoMsg { * Since: 0.40 */ export interface MsgPinCodesResponse {} -export interface ReactiveMsgPinCodesResponse {} export interface MsgPinCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse"; value: Uint8Array; @@ -690,10 +601,6 @@ export interface MsgUnpinCodes { /** CodeIDs references the WASM codes */ codeIds: bigint[]; } -export interface ReactiveMsgUnpinCodes { - authority: ComputedRef; - codeIds: ComputedRef; -} export interface MsgUnpinCodesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes"; value: Uint8Array; @@ -720,7 +627,6 @@ export interface MsgUnpinCodesAminoMsg { * Since: 0.40 */ export interface MsgUnpinCodesResponse {} -export interface ReactiveMsgUnpinCodesResponse {} export interface MsgUnpinCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse"; value: Uint8Array; @@ -778,19 +684,6 @@ export interface MsgStoreAndInstantiateContract { */ codeHash: Uint8Array; } -export interface ReactiveMsgStoreAndInstantiateContract { - authority: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; - unpinCode: ComputedRef; - admin: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; - source: ComputedRef; - builder: ComputedRef; - codeHash: ComputedRef; -} export interface MsgStoreAndInstantiateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract"; value: Uint8Array; @@ -853,10 +746,6 @@ export interface MsgStoreAndInstantiateContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgStoreAndInstantiateContractResponse { - address: ComputedRef; - data: ComputedRef; -} export interface MsgStoreAndInstantiateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse"; value: Uint8Array; @@ -886,10 +775,6 @@ export interface MsgAddCodeUploadParamsAddresses { authority: string; addresses: string[]; } -export interface ReactiveMsgAddCodeUploadParamsAddresses { - authority: ComputedRef; - addresses: ComputedRef; -} export interface MsgAddCodeUploadParamsAddressesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses"; value: Uint8Array; @@ -912,7 +797,6 @@ export interface MsgAddCodeUploadParamsAddressesAminoMsg { * structure for executing a MsgAddCodeUploadParamsAddresses message. */ export interface MsgAddCodeUploadParamsAddressesResponse {} -export interface ReactiveMsgAddCodeUploadParamsAddressesResponse {} export interface MsgAddCodeUploadParamsAddressesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse"; value: Uint8Array; @@ -935,10 +819,6 @@ export interface MsgRemoveCodeUploadParamsAddresses { authority: string; addresses: string[]; } -export interface ReactiveMsgRemoveCodeUploadParamsAddresses { - authority: ComputedRef; - addresses: ComputedRef; -} export interface MsgRemoveCodeUploadParamsAddressesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses"; value: Uint8Array; @@ -961,7 +841,6 @@ export interface MsgRemoveCodeUploadParamsAddressesAminoMsg { * structure for executing a MsgRemoveCodeUploadParamsAddresses message. */ export interface MsgRemoveCodeUploadParamsAddressesResponse {} -export interface ReactiveMsgRemoveCodeUploadParamsAddressesResponse {} export interface MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse"; value: Uint8Array; @@ -993,13 +872,6 @@ export interface MsgStoreAndMigrateContract { /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } -export interface ReactiveMsgStoreAndMigrateContract { - authority: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; -} export interface MsgStoreAndMigrateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract"; value: Uint8Array; @@ -1040,11 +912,6 @@ export interface MsgStoreAndMigrateContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgStoreAndMigrateContractResponse { - codeId: ComputedRef; - checksum: ComputedRef; - data: ComputedRef; -} export interface MsgStoreAndMigrateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse"; value: Uint8Array; @@ -1076,11 +943,6 @@ export interface MsgUpdateContractLabel { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveMsgUpdateContractLabel { - sender: ComputedRef; - newLabel: ComputedRef; - contract: ComputedRef; -} export interface MsgUpdateContractLabelProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel"; value: Uint8Array; @@ -1100,7 +962,6 @@ export interface MsgUpdateContractLabelAminoMsg { } /** MsgUpdateContractLabelResponse returns empty data */ export interface MsgUpdateContractLabelResponse {} -export interface ReactiveMsgUpdateContractLabelResponse {} export interface MsgUpdateContractLabelResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/types.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/types.ts index f7b43797..3dccb816 100644 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/types.ts +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/types.ts @@ -3,7 +3,6 @@ import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../h import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; -import { ComputedRef } from "vue"; /** AccessType permission types */ export enum AccessType { /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ @@ -104,9 +103,6 @@ export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHisto export interface AccessTypeParam { value: AccessType; } -export interface ReactiveAccessTypeParam { - value: ComputedRef; -} export interface AccessTypeParamProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam"; value: Uint8Array; @@ -124,10 +120,6 @@ export interface AccessConfig { permission: AccessType; addresses: string[]; } -export interface ReactiveAccessConfig { - permission: ComputedRef; - addresses: ComputedRef; -} export interface AccessConfigProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AccessConfig"; value: Uint8Array; @@ -146,10 +138,6 @@ export interface Params { codeUploadAccess: AccessConfig; instantiateDefaultPermission: AccessType; } -export interface ReactiveParams { - codeUploadAccess: ComputedRef; - instantiateDefaultPermission: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmwasm.wasm.v1.Params"; value: Uint8Array; @@ -172,11 +160,6 @@ export interface CodeInfo { /** InstantiateConfig access control to apply on contract creation, optional */ instantiateConfig: AccessConfig; } -export interface ReactiveCodeInfo { - codeHash: ComputedRef; - creator: ComputedRef; - instantiateConfig: ComputedRef; -} export interface CodeInfoProtoMsg { typeUrl: "/cosmwasm.wasm.v1.CodeInfo"; value: Uint8Array; @@ -213,15 +196,6 @@ export interface ContractInfo { */ extension?: Any | undefined; } -export interface ReactiveContractInfo { - codeId: ComputedRef; - creator: ComputedRef; - admin: ComputedRef; - label: ComputedRef; - created?: ComputedRef; - ibcPortId: ComputedRef; - extension?: ComputedRef; -} export interface ContractInfoProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; value: Uint8Array; @@ -265,12 +239,6 @@ export interface ContractCodeHistoryEntry { updated?: AbsoluteTxPosition; msg: Uint8Array; } -export interface ReactiveContractCodeHistoryEntry { - operation: ComputedRef; - codeId: ComputedRef; - updated?: ComputedRef; - msg: ComputedRef; -} export interface ContractCodeHistoryEntryProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry"; value: Uint8Array; @@ -301,10 +269,6 @@ export interface AbsoluteTxPosition { */ txIndex: bigint; } -export interface ReactiveAbsoluteTxPosition { - blockHeight: ComputedRef; - txIndex: ComputedRef; -} export interface AbsoluteTxPositionProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition"; value: Uint8Array; @@ -333,10 +297,6 @@ export interface Model { /** base64-encode raw value */ value: Uint8Array; } -export interface ReactiveModel { - key: ComputedRef; - value: ComputedRef; -} export interface ModelProtoMsg { typeUrl: "/cosmwasm.wasm.v1.Model"; value: Uint8Array; diff --git a/libs/injective-vue/src/extern.ts b/libs/injective-vue/src/extern.ts index 5127cb14..eddf067e 100644 --- a/libs/injective-vue/src/extern.ts +++ b/libs/injective-vue/src/extern.ts @@ -1,13 +1,17 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from '@cosmjs/stargate' -import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -const _rpcClients: Record = {}; +import { HttpEndpoint } from "@interchainjs/types"; +import { + createQueryRpc, +} from '@interchainjs/cosmos/utils'; +import { Rpc } from "./helpers"; + +const _rpcClients: Record = {}; export const getRpcEndpointKey = (rpcEndpoint: string | HttpEndpoint) => { if (typeof rpcEndpoint === 'string') { @@ -24,10 +28,11 @@ export const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { if (_rpcClients.hasOwnProperty(key)) { return _rpcClients[key]; } - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - //@ts-ignore - const client = new QueryClient(tmClient); - const rpc = createProtobufRpcClient(client); + const rpc = await createRpcClient(rpcEndpoint); _rpcClients[key] = rpc; return rpc; } + +export const createRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { + return createQueryRpc(rpcEndpoint) +} diff --git a/libs/injective-vue/src/google/api/http.ts b/libs/injective-vue/src/google/api/http.ts index c8597db5..3fd3a11b 100644 --- a/libs/injective-vue/src/google/api/http.ts +++ b/libs/injective-vue/src/google/api/http.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * 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 @@ -24,10 +23,6 @@ export interface Http { */ fullyDecodeReservedExpansion: boolean; } -export interface ReactiveHttp { - rules: ComputedRef; - fullyDecodeReservedExpansion: ComputedRef; -} export interface HttpProtoMsg { typeUrl: "/google.api.Http"; value: Uint8Array; @@ -377,18 +372,6 @@ export interface HttpRule { */ additionalBindings: HttpRule[]; } -export interface ReactiveHttpRule { - selector: ComputedRef; - get?: ComputedRef; - put?: ComputedRef; - post?: ComputedRef; - delete?: ComputedRef; - patch?: ComputedRef; - custom?: ComputedRef; - body: ComputedRef; - responseBody: ComputedRef; - additionalBindings: ComputedRef; -} export interface HttpRuleProtoMsg { typeUrl: "/google.api.HttpRule"; value: Uint8Array; @@ -723,10 +706,6 @@ export interface CustomHttpPattern { /** The path matched by this custom verb. */ path: string; } -export interface ReactiveCustomHttpPattern { - kind: ComputedRef; - path: ComputedRef; -} export interface CustomHttpPatternProtoMsg { typeUrl: "/google.api.CustomHttpPattern"; value: Uint8Array; diff --git a/libs/injective-vue/src/google/protobuf/any.ts b/libs/injective-vue/src/google/protobuf/any.ts index 2dd5ed96..bbae1be1 100644 --- a/libs/injective-vue/src/google/protobuf/any.ts +++ b/libs/injective-vue/src/google/protobuf/any.ts @@ -1,6 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; -import { ComputedRef } from "vue"; /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. @@ -123,10 +122,6 @@ export interface Any { /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -export interface ReactiveAny { - typeUrl: ComputedRef; - value: ComputedRef; -} export interface AnyProtoMsg { typeUrl: "/google.protobuf.Any"; value: Uint8Array; diff --git a/libs/injective-vue/src/google/protobuf/descriptor.ts b/libs/injective-vue/src/google/protobuf/descriptor.ts index 911b9611..53b60923 100644 --- a/libs/injective-vue/src/google/protobuf/descriptor.ts +++ b/libs/injective-vue/src/google/protobuf/descriptor.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** The full set of known editions. */ export enum Edition { /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ @@ -917,9 +916,6 @@ export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCod export interface FileDescriptorSet { file: FileDescriptorProto[]; } -export interface ReactiveFileDescriptorSet { - file: ComputedRef; -} export interface FileDescriptorSetProtoMsg { typeUrl: "/google.protobuf.FileDescriptorSet"; value: Uint8Array; @@ -981,21 +977,6 @@ export interface FileDescriptorProto { */ edition: Edition; } -export interface ReactiveFileDescriptorProto { - name: ComputedRef; - package: ComputedRef; - dependency: ComputedRef; - publicDependency: ComputedRef; - weakDependency: ComputedRef; - messageType: ComputedRef; - enumType: ComputedRef; - service: ComputedRef; - extension: ComputedRef; - options?: ComputedRef; - sourceCodeInfo?: ComputedRef; - syntax: ComputedRef; - edition: ComputedRef; -} export interface FileDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.FileDescriptorProto"; value: Uint8Array; @@ -1067,18 +1048,6 @@ export interface DescriptorProto { */ reservedName: string[]; } -export interface ReactiveDescriptorProto { - name: ComputedRef; - field: ComputedRef; - extension: ComputedRef; - nestedType: ComputedRef; - enumType: ComputedRef; - extensionRange: ComputedRef; - oneofDecl: ComputedRef; - options?: ComputedRef; - reservedRange: ComputedRef; - reservedName: ComputedRef; -} export interface DescriptorProtoProtoMsg { typeUrl: "/google.protobuf.DescriptorProto"; value: Uint8Array; @@ -1111,11 +1080,6 @@ export interface DescriptorProto_ExtensionRange { end: number; options?: ExtensionRangeOptions; } -export interface ReactiveDescriptorProto_ExtensionRange { - start: ComputedRef; - end: ComputedRef; - options?: ComputedRef; -} export interface DescriptorProto_ExtensionRangeProtoMsg { typeUrl: "/google.protobuf.ExtensionRange"; value: Uint8Array; @@ -1142,10 +1106,6 @@ export interface DescriptorProto_ReservedRange { /** Exclusive. */ end: number; } -export interface ReactiveDescriptorProto_ReservedRange { - start: ComputedRef; - end: ComputedRef; -} export interface DescriptorProto_ReservedRangeProtoMsg { typeUrl: "/google.protobuf.ReservedRange"; value: Uint8Array; @@ -1183,12 +1143,6 @@ export interface ExtensionRangeOptions { */ verification: ExtensionRangeOptions_VerificationState; } -export interface ReactiveExtensionRangeOptions { - uninterpretedOption: ComputedRef; - declaration: ComputedRef; - features?: ComputedRef; - verification: ComputedRef; -} export interface ExtensionRangeOptionsProtoMsg { typeUrl: "/google.protobuf.ExtensionRangeOptions"; value: Uint8Array; @@ -1241,13 +1195,6 @@ export interface ExtensionRangeOptions_Declaration { */ repeated: boolean; } -export interface ReactiveExtensionRangeOptions_Declaration { - number: ComputedRef; - fullName: ComputedRef; - type: ComputedRef; - reserved: ComputedRef; - repeated: ComputedRef; -} export interface ExtensionRangeOptions_DeclarationProtoMsg { typeUrl: "/google.protobuf.Declaration"; value: Uint8Array; @@ -1350,19 +1297,6 @@ export interface FieldDescriptorProto { */ proto3Optional: boolean; } -export interface ReactiveFieldDescriptorProto { - name: ComputedRef; - number: ComputedRef; - label: ComputedRef; - type: ComputedRef; - typeName: ComputedRef; - extendee: ComputedRef; - defaultValue: ComputedRef; - oneofIndex: ComputedRef; - jsonName: ComputedRef; - options?: ComputedRef; - proto3Optional: ComputedRef; -} export interface FieldDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.FieldDescriptorProto"; value: Uint8Array; @@ -1444,10 +1378,6 @@ export interface OneofDescriptorProto { name: string; options?: OneofOptions; } -export interface ReactiveOneofDescriptorProto { - name: ComputedRef; - options?: ComputedRef; -} export interface OneofDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.OneofDescriptorProto"; value: Uint8Array; @@ -1478,13 +1408,6 @@ export interface EnumDescriptorProto { */ reservedName: string[]; } -export interface ReactiveEnumDescriptorProto { - name: ComputedRef; - value: ComputedRef; - options?: ComputedRef; - reservedRange: ComputedRef; - reservedName: ComputedRef; -} export interface EnumDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.EnumDescriptorProto"; value: Uint8Array; @@ -1524,10 +1447,6 @@ export interface EnumDescriptorProto_EnumReservedRange { /** Inclusive. */ end: number; } -export interface ReactiveEnumDescriptorProto_EnumReservedRange { - start: ComputedRef; - end: ComputedRef; -} export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { typeUrl: "/google.protobuf.EnumReservedRange"; value: Uint8Array; @@ -1556,11 +1475,6 @@ export interface EnumValueDescriptorProto { number: number; options?: EnumValueOptions; } -export interface ReactiveEnumValueDescriptorProto { - name: ComputedRef; - number: ComputedRef; - options?: ComputedRef; -} export interface EnumValueDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.EnumValueDescriptorProto"; value: Uint8Array; @@ -1581,11 +1495,6 @@ export interface ServiceDescriptorProto { method: MethodDescriptorProto[]; options?: ServiceOptions; } -export interface ReactiveServiceDescriptorProto { - name: ComputedRef; - method: ComputedRef; - options?: ComputedRef; -} export interface ServiceDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.ServiceDescriptorProto"; value: Uint8Array; @@ -1615,14 +1524,6 @@ export interface MethodDescriptorProto { /** Identifies if server streams multiple server messages */ serverStreaming: boolean; } -export interface ReactiveMethodDescriptorProto { - name: ComputedRef; - inputType: ComputedRef; - outputType: ComputedRef; - options?: ComputedRef; - clientStreaming: ComputedRef; - serverStreaming: ComputedRef; -} export interface MethodDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.MethodDescriptorProto"; value: Uint8Array; @@ -1773,29 +1674,6 @@ export interface FileOptions { */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveFileOptions { - javaPackage: ComputedRef; - javaOuterClassname: ComputedRef; - javaMultipleFiles: ComputedRef; - javaGenerateEqualsAndHash: ComputedRef; - javaStringCheckUtf8: ComputedRef; - optimizeFor: ComputedRef; - goPackage: ComputedRef; - ccGenericServices: ComputedRef; - javaGenericServices: ComputedRef; - pyGenericServices: ComputedRef; - deprecated: ComputedRef; - ccEnableArenas: ComputedRef; - objcClassPrefix: ComputedRef; - csharpNamespace: ComputedRef; - swiftPrefix: ComputedRef; - phpClassPrefix: ComputedRef; - phpNamespace: ComputedRef; - phpMetadataNamespace: ComputedRef; - rubyPackage: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface FileOptionsProtoMsg { typeUrl: "/google.protobuf.FileOptions"; value: Uint8Array; @@ -2014,15 +1892,6 @@ export interface MessageOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveMessageOptions { - messageSetWireFormat: ComputedRef; - noStandardDescriptorAccessor: ComputedRef; - deprecated: ComputedRef; - mapEntry: ComputedRef; - deprecatedLegacyJsonFieldConflicts: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface MessageOptionsProtoMsg { typeUrl: "/google.protobuf.MessageOptions"; value: Uint8Array; @@ -2208,22 +2077,6 @@ export interface FieldOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveFieldOptions { - ctype: ComputedRef; - packed: ComputedRef; - jstype: ComputedRef; - lazy: ComputedRef; - unverifiedLazy: ComputedRef; - deprecated: ComputedRef; - weak: ComputedRef; - debugRedact: ComputedRef; - retention: ComputedRef; - targets: ComputedRef; - editionDefaults: ComputedRef; - features?: ComputedRef; - featureSupport?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface FieldOptionsProtoMsg { typeUrl: "/google.protobuf.FieldOptions"; value: Uint8Array; @@ -2331,10 +2184,6 @@ export interface FieldOptions_EditionDefault { /** Textproto value. */ value: string; } -export interface ReactiveFieldOptions_EditionDefault { - edition: ComputedRef; - value: ComputedRef; -} export interface FieldOptions_EditionDefaultProtoMsg { typeUrl: "/google.protobuf.EditionDefault"; value: Uint8Array; @@ -2373,12 +2222,6 @@ export interface FieldOptions_FeatureSupport { */ editionRemoved: Edition; } -export interface ReactiveFieldOptions_FeatureSupport { - editionIntroduced: ComputedRef; - editionDeprecated: ComputedRef; - deprecationWarning: ComputedRef; - editionRemoved: ComputedRef; -} export interface FieldOptions_FeatureSupportProtoMsg { typeUrl: "/google.protobuf.FeatureSupport"; value: Uint8Array; @@ -2423,10 +2266,6 @@ export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveOneofOptions { - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface OneofOptionsProtoMsg { typeUrl: "/google.protobuf.OneofOptions"; value: Uint8Array; @@ -2479,13 +2318,6 @@ export interface EnumOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveEnumOptions { - allowAlias: ComputedRef; - deprecated: ComputedRef; - deprecatedLegacyJsonFieldConflicts: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface EnumOptionsProtoMsg { typeUrl: "/google.protobuf.EnumOptions"; value: Uint8Array; @@ -2553,13 +2385,6 @@ export interface EnumValueOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveEnumValueOptions { - deprecated: ComputedRef; - features?: ComputedRef; - debugRedact: ComputedRef; - featureSupport?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface EnumValueOptionsProtoMsg { typeUrl: "/google.protobuf.EnumValueOptions"; value: Uint8Array; @@ -2612,11 +2437,6 @@ export interface ServiceOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveServiceOptions { - features?: ComputedRef; - deprecated: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface ServiceOptionsProtoMsg { typeUrl: "/google.protobuf.ServiceOptions"; value: Uint8Array; @@ -2662,12 +2482,6 @@ export interface MethodOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveMethodOptions { - deprecated: ComputedRef; - idempotencyLevel: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface MethodOptionsProtoMsg { typeUrl: "/google.protobuf.MethodOptions"; value: Uint8Array; @@ -2716,15 +2530,6 @@ export interface UninterpretedOption { stringValue: Uint8Array; aggregateValue: string; } -export interface ReactiveUninterpretedOption { - name: ComputedRef; - identifierValue: ComputedRef; - positiveIntValue: ComputedRef; - negativeIntValue: ComputedRef; - doubleValue: ComputedRef; - stringValue: ComputedRef; - aggregateValue: ComputedRef; -} export interface UninterpretedOptionProtoMsg { typeUrl: "/google.protobuf.UninterpretedOption"; value: Uint8Array; @@ -2765,10 +2570,6 @@ export interface UninterpretedOption_NamePart { namePart: string; isExtension: boolean; } -export interface ReactiveUninterpretedOption_NamePart { - namePart: ComputedRef; - isExtension: ComputedRef; -} export interface UninterpretedOption_NamePartProtoMsg { typeUrl: "/google.protobuf.NamePart"; value: Uint8Array; @@ -2804,14 +2605,6 @@ export interface FeatureSet { messageEncoding: FeatureSet_MessageEncoding; jsonFormat: FeatureSet_JsonFormat; } -export interface ReactiveFeatureSet { - fieldPresence: ComputedRef; - enumType: ComputedRef; - repeatedFieldEncoding: ComputedRef; - utf8Validation: ComputedRef; - messageEncoding: ComputedRef; - jsonFormat: ComputedRef; -} export interface FeatureSetProtoMsg { typeUrl: "/google.protobuf.FeatureSet"; value: Uint8Array; @@ -2855,11 +2648,6 @@ export interface FeatureSetDefaults { */ maximumEdition: Edition; } -export interface ReactiveFeatureSetDefaults { - defaults: ComputedRef; - minimumEdition: ComputedRef; - maximumEdition: ComputedRef; -} export interface FeatureSetDefaultsProtoMsg { typeUrl: "/google.protobuf.FeatureSetDefaults"; value: Uint8Array; @@ -2900,11 +2688,6 @@ export interface FeatureSetDefaults_FeatureSetEditionDefault { /** Defaults of features that can't be overridden in this edition. */ fixedFeatures?: FeatureSet; } -export interface ReactiveFeatureSetDefaults_FeatureSetEditionDefault { - edition: ComputedRef; - overridableFeatures?: ComputedRef; - fixedFeatures?: ComputedRef; -} export interface FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg { typeUrl: "/google.protobuf.FeatureSetEditionDefault"; value: Uint8Array; @@ -2978,9 +2761,6 @@ export interface SourceCodeInfo { */ location: SourceCodeInfo_Location[]; } -export interface ReactiveSourceCodeInfo { - location: ComputedRef; -} export interface SourceCodeInfoProtoMsg { typeUrl: "/google.protobuf.SourceCodeInfo"; value: Uint8Array; @@ -3129,13 +2909,6 @@ export interface SourceCodeInfo_Location { trailingComments: string; leadingDetachedComments: string[]; } -export interface ReactiveSourceCodeInfo_Location { - path: ComputedRef; - span: ComputedRef; - leadingComments: ComputedRef; - trailingComments: ComputedRef; - leadingDetachedComments: ComputedRef; -} export interface SourceCodeInfo_LocationProtoMsg { typeUrl: "/google.protobuf.Location"; value: Uint8Array; @@ -3244,9 +3017,6 @@ export interface GeneratedCodeInfo { */ annotation: GeneratedCodeInfo_Annotation[]; } -export interface ReactiveGeneratedCodeInfo { - annotation: ComputedRef; -} export interface GeneratedCodeInfoProtoMsg { typeUrl: "/google.protobuf.GeneratedCodeInfo"; value: Uint8Array; @@ -3288,13 +3058,6 @@ export interface GeneratedCodeInfo_Annotation { end: number; semantic: GeneratedCodeInfo_Annotation_Semantic; } -export interface ReactiveGeneratedCodeInfo_Annotation { - path: ComputedRef; - sourceFile: ComputedRef; - begin: ComputedRef; - end: ComputedRef; - semantic: ComputedRef; -} export interface GeneratedCodeInfo_AnnotationProtoMsg { typeUrl: "/google.protobuf.Annotation"; value: Uint8Array; diff --git a/libs/injective-vue/src/google/protobuf/duration.ts b/libs/injective-vue/src/google/protobuf/duration.ts index d6a10825..6e3e301a 100644 --- a/libs/injective-vue/src/google/protobuf/duration.ts +++ b/libs/injective-vue/src/google/protobuf/duration.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * A Duration represents a signed, fixed-length span of time represented * as a count of seconds and fractions of seconds at nanosecond @@ -79,10 +78,6 @@ export interface Duration { */ nanos: number; } -export interface ReactiveDuration { - seconds: ComputedRef; - nanos: ComputedRef; -} export interface DurationProtoMsg { typeUrl: "/google.protobuf.Duration"; value: Uint8Array; diff --git a/libs/injective-vue/src/google/protobuf/timestamp.ts b/libs/injective-vue/src/google/protobuf/timestamp.ts index 31822c7a..d4d255b3 100644 --- a/libs/injective-vue/src/google/protobuf/timestamp.ts +++ b/libs/injective-vue/src/google/protobuf/timestamp.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, fromJsonTimestamp, fromTimestamp } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * 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 @@ -108,10 +107,6 @@ export interface Timestamp { */ nanos: number; } -export interface ReactiveTimestamp { - seconds: ComputedRef; - nanos: ComputedRef; -} export interface TimestampProtoMsg { typeUrl: "/google.protobuf.Timestamp"; value: Uint8Array; diff --git a/libs/injective-vue/src/helper-func-types.ts b/libs/injective-vue/src/helper-func-types.ts new file mode 100644 index 00000000..4f82736b --- /dev/null +++ b/libs/injective-vue/src/helper-func-types.ts @@ -0,0 +1,191 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +import { HttpEndpoint } from "@interchainjs/types"; +import { BinaryReader, BinaryWriter } from "./binary"; +import { getRpcClient } from "./extern"; +import { isRpc, Rpc } from "./helpers"; + +export interface QueryBuilderOptions { + encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter + decode: (input: BinaryReader | Uint8Array, length?: number) => TRes + service: string, + method: string, + clientResolver?: RpcResolver +} + +export function buildQuery(opts: QueryBuilderOptions) { + return async (request: TReq) => { + let rpc: Rpc | undefined; + + if(isRpc(opts.clientResolver)) { + rpc = opts.clientResolver; + } else { + rpc = opts.clientResolver ? await getRpcClient(opts.clientResolver) : undefined; + } + + if (!rpc) throw new Error("Query Rpc is not initialized"); + + const data = opts.encode(request).finish(); + const response = await rpc.request(opts.service, opts.method, data); + return opts.decode(response); + }; +} + +export interface ITxArgs { + signerAddress: string; + message: TMsg | TMsg[]; + fee: StdFee | 'auto'; + memo: string; +} + +export function isISigningClient(client: unknown): client is ISigningClient { + return client !== null && client !== undefined + && typeof (client as ISigningClient).signAndBroadcast === 'function' + && typeof (client as ISigningClient).addConverters === 'function' + && typeof (client as ISigningClient).addEncoders === 'function'; +} + +export interface ISigningClient { + /** + * register converters + */ + addConverters: (converters: AminoConverter[]) => void; + /** + * register encoders + */ + addEncoders: (encoders: Encoder[]) => void; + + signAndBroadcast: ( + signerAddress: string, + message: Message[], + fee: StdFee | 'auto', + memo: string + ) => Promise; +} + +export interface TxBuilderOptions { + clientResolver?: SigningClientResolver, + typeUrl: string, + encoders?: Encoder[], + converters?: AminoConverter[], +} + +export function buildTx(opts: TxBuilderOptions) { + return async ( + signerAddress: string, + message: TMsg | TMsg[], + fee: StdFee | 'auto', + memo: string + ): Promise => { + let client: ISigningClient | undefined; + + // if opts.getSigningClient is a function, call it to get the SigningClient instance + if(isISigningClient(opts.clientResolver)) { + client = opts.clientResolver; + } + + if (!client) throw new Error("SigningClient is not initialized"); + + //register all related encoders and converters + client.addEncoders(opts.encoders ?? []); + client.addConverters(opts.converters ?? []); + + const data = [ + { + typeUrl: opts.typeUrl, + value: message, + }, + ]; + return client.signAndBroadcast!(signerAddress, data, fee, memo); + }; +} + +export interface Coin { + denom: string; + amount: string; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +export interface Message { + typeUrl: string; + value: T; +} + +export interface Encoder { + typeUrl: string; + fromPartial: (data: any) => any; + encode: (data: any) => Uint8Array; +} + +export interface AminoConverter { + typeUrl: string; + aminoType: string; + fromAmino: (data: any) => any; + toAmino: (data: any) => any; +} + +export type SigningClientResolver = string | HttpEndpoint | ISigningClient; +export type RpcResolver = string | HttpEndpoint | Rpc ; diff --git a/libs/injective-vue/src/helpers.ts b/libs/injective-vue/src/helpers.ts index 64d3444c..ba68bbdb 100644 --- a/libs/injective-vue/src/helpers.ts +++ b/libs/injective-vue/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/ibc/applications/transfer/v1/transfer.ts b/libs/injective-vue/src/ibc/applications/transfer/v1/transfer.ts index 1b156e21..12d6526c 100644 --- a/libs/injective-vue/src/ibc/applications/transfer/v1/transfer.ts +++ b/libs/injective-vue/src/ibc/applications/transfer/v1/transfer.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * Params defines the set of IBC transfer parameters. * NOTE: To prevent a single token from being transferred, set the @@ -20,10 +19,6 @@ export interface Params { */ receiveEnabled: boolean; } -export interface ReactiveParams { - sendEnabled: ComputedRef; - receiveEnabled: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Params"; value: Uint8Array; @@ -61,10 +56,6 @@ export interface Forwarding { /** optional intermediate path through which packet will be forwarded */ hops: Hop[]; } -export interface ReactiveForwarding { - unwind: ComputedRef; - hops: ComputedRef; -} export interface ForwardingProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Forwarding"; value: Uint8Array; @@ -92,10 +83,6 @@ export interface Hop { portId: string; channelId: string; } -export interface ReactiveHop { - portId: ComputedRef; - channelId: ComputedRef; -} export interface HopProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Hop"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.amino.ts b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.amino.ts deleted file mode 100644 index 0ebb51c7..00000000 --- a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.amino.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MsgTransfer, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/ibc.applications.transfer.v1.MsgTransfer": { - aminoType: "cosmos-sdk/MsgTransfer", - toAmino: MsgTransfer.toAmino, - fromAmino: MsgTransfer.fromAmino - }, - "/ibc.applications.transfer.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts new file mode 100644 index 00000000..72028384 --- /dev/null +++ b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +export const createTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransfer.typeUrl, + encoders: toEncoders(MsgTransfer), + converters: toConverters(MsgTransfer) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts deleted file mode 100644 index 228d27d9..00000000 --- a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgTransfer, MsgTransferResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the ibc/transfer Msg service. */ -export interface Msg { - /** Transfer defines a rpc handler method for MsgTransfer. */ - transfer(request: MsgTransfer): Promise; - /** UpdateParams defines a rpc handler for MsgUpdateParams. */ - updateParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Transfer defines a rpc handler method for MsgTransfer. */ - transfer = async (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 BinaryReader(data))); - }; - /* UpdateParams defines a rpc handler for MsgUpdateParams. */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..ab0c0e79 --- /dev/null +++ b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts @@ -0,0 +1,9 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +export const useTransfer = buildUseVueMutation({ + builderMutationFn: createTransfer +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.ts b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.ts index 756b7b69..e3be1579 100644 --- a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.ts +++ b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.ts @@ -4,7 +4,6 @@ import { Forwarding, ForwardingAmino } from "./transfer"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between * ICS20 enabled chains. See ICS Spec here: @@ -39,18 +38,6 @@ export interface MsgTransfer { /** optional forwarding information */ forwarding?: Forwarding; } -export interface ReactiveMsgTransfer { - sourcePort: ComputedRef; - sourceChannel: ComputedRef; - token: ComputedRef; - sender: ComputedRef; - receiver: ComputedRef; - timeoutHeight: ComputedRef; - timeoutTimestamp: ComputedRef; - memo: ComputedRef; - tokens: ComputedRef; - forwarding?: ComputedRef; -} export interface MsgTransferProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer"; value: Uint8Array; @@ -98,9 +85,6 @@ export interface MsgTransferResponse { /** sequence number of the transfer packet sent */ sequence: bigint; } -export interface ReactiveMsgTransferResponse { - sequence: ComputedRef; -} export interface MsgTransferResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse"; value: Uint8Array; @@ -125,10 +109,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - signer: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams"; value: Uint8Array; @@ -153,7 +133,6 @@ export interface MsgUpdateParamsAminoMsg { * MsgUpdateParams message. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/channel/v1/channel.ts b/libs/injective-vue/src/ibc/core/channel/v1/channel.ts index 74813efd..6965c083 100644 --- a/libs/injective-vue/src/ibc/core/channel/v1/channel.ts +++ b/libs/injective-vue/src/ibc/core/channel/v1/channel.ts @@ -2,7 +2,6 @@ import { Height, HeightAmino } from "../../client/v1/client"; import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * State defines if a channel is in one of the following states: * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. @@ -150,14 +149,6 @@ export interface Channel { */ upgradeSequence: bigint; } -export interface ReactiveChannel { - state: ComputedRef; - ordering: ComputedRef; - counterparty: ComputedRef; - connectionHops: ComputedRef; - version: ComputedRef; - upgradeSequence: ComputedRef; -} export interface ChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.Channel"; value: Uint8Array; @@ -219,16 +210,6 @@ export interface IdentifiedChannel { */ upgradeSequence: bigint; } -export interface ReactiveIdentifiedChannel { - state: ComputedRef; - ordering: ComputedRef; - counterparty: ComputedRef; - connectionHops: ComputedRef; - version: ComputedRef; - portId: ComputedRef; - channelId: ComputedRef; - upgradeSequence: ComputedRef; -} export interface IdentifiedChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.IdentifiedChannel"; value: Uint8Array; @@ -272,10 +253,6 @@ export interface Counterparty { /** channel end on the counterparty chain */ channelId: string; } -export interface ReactiveCounterparty { - portId: ComputedRef; - channelId: ComputedRef; -} export interface CounterpartyProtoMsg { typeUrl: "/ibc.core.channel.v1.Counterparty"; value: Uint8Array; @@ -314,16 +291,6 @@ export interface Packet { /** block timestamp (in nanoseconds) after which the packet times out */ timeoutTimestamp: bigint; } -export interface ReactivePacket { - sequence: ComputedRef; - sourcePort: ComputedRef; - sourceChannel: ComputedRef; - destinationPort: ComputedRef; - destinationChannel: ComputedRef; - data: ComputedRef; - timeoutHeight: ComputedRef; - timeoutTimestamp: ComputedRef; -} export interface PacketProtoMsg { typeUrl: "/ibc.core.channel.v1.Packet"; value: Uint8Array; @@ -371,12 +338,6 @@ export interface PacketState { /** embedded data that represents packet state. */ data: Uint8Array; } -export interface ReactivePacketState { - portId: ComputedRef; - channelId: ComputedRef; - sequence: ComputedRef; - data: ComputedRef; -} export interface PacketStateProtoMsg { typeUrl: "/ibc.core.channel.v1.PacketState"; value: Uint8Array; @@ -414,11 +375,6 @@ export interface PacketId { /** packet sequence */ sequence: bigint; } -export interface ReactivePacketId { - portId: ComputedRef; - channelId: ComputedRef; - sequence: ComputedRef; -} export interface PacketIdProtoMsg { typeUrl: "/ibc.core.channel.v1.PacketId"; value: Uint8Array; @@ -453,10 +409,6 @@ export interface Acknowledgement { result?: Uint8Array; error?: string; } -export interface ReactiveAcknowledgement { - result?: ComputedRef; - error?: ComputedRef; -} export interface AcknowledgementProtoMsg { typeUrl: "/ibc.core.channel.v1.Acknowledgement"; value: Uint8Array; @@ -489,10 +441,6 @@ export interface Timeout { /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ timestamp: bigint; } -export interface ReactiveTimeout { - height: ComputedRef; - timestamp: ComputedRef; -} export interface TimeoutProtoMsg { typeUrl: "/ibc.core.channel.v1.Timeout"; value: Uint8Array; @@ -517,9 +465,6 @@ export interface Params { /** the relative timeout after which channel upgrades will time out. */ upgradeTimeout: Timeout; } -export interface ReactiveParams { - upgradeTimeout: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.core.channel.v1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/channel/v1/tx.amino.ts b/libs/injective-vue/src/ibc/core/channel/v1/tx.amino.ts deleted file mode 100644 index fb58cb04..00000000 --- a/libs/injective-vue/src/ibc/core/channel/v1/tx.amino.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; -export const AminoConverter = { - "/ibc.core.channel.v1.MsgChannelOpenInit": { - aminoType: "cosmos-sdk/MsgChannelOpenInit", - toAmino: MsgChannelOpenInit.toAmino, - fromAmino: MsgChannelOpenInit.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelOpenTry": { - aminoType: "cosmos-sdk/MsgChannelOpenTry", - toAmino: MsgChannelOpenTry.toAmino, - fromAmino: MsgChannelOpenTry.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelOpenAck": { - aminoType: "cosmos-sdk/MsgChannelOpenAck", - toAmino: MsgChannelOpenAck.toAmino, - fromAmino: MsgChannelOpenAck.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelOpenConfirm": { - aminoType: "cosmos-sdk/MsgChannelOpenConfirm", - toAmino: MsgChannelOpenConfirm.toAmino, - fromAmino: MsgChannelOpenConfirm.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelCloseInit": { - aminoType: "cosmos-sdk/MsgChannelCloseInit", - toAmino: MsgChannelCloseInit.toAmino, - fromAmino: MsgChannelCloseInit.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelCloseConfirm": { - aminoType: "cosmos-sdk/MsgChannelCloseConfirm", - toAmino: MsgChannelCloseConfirm.toAmino, - fromAmino: MsgChannelCloseConfirm.fromAmino - }, - "/ibc.core.channel.v1.MsgRecvPacket": { - aminoType: "cosmos-sdk/MsgRecvPacket", - toAmino: MsgRecvPacket.toAmino, - fromAmino: MsgRecvPacket.fromAmino - }, - "/ibc.core.channel.v1.MsgTimeout": { - aminoType: "cosmos-sdk/MsgTimeout", - toAmino: MsgTimeout.toAmino, - fromAmino: MsgTimeout.fromAmino - }, - "/ibc.core.channel.v1.MsgTimeoutOnClose": { - aminoType: "cosmos-sdk/MsgTimeoutOnClose", - toAmino: MsgTimeoutOnClose.toAmino, - fromAmino: MsgTimeoutOnClose.fromAmino - }, - "/ibc.core.channel.v1.MsgAcknowledgement": { - aminoType: "cosmos-sdk/MsgAcknowledgement", - toAmino: MsgAcknowledgement.toAmino, - fromAmino: MsgAcknowledgement.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeInit": { - aminoType: "cosmos-sdk/MsgChannelUpgradeInit", - toAmino: MsgChannelUpgradeInit.toAmino, - fromAmino: MsgChannelUpgradeInit.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeTry": { - aminoType: "cosmos-sdk/MsgChannelUpgradeTry", - toAmino: MsgChannelUpgradeTry.toAmino, - fromAmino: MsgChannelUpgradeTry.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeAck": { - aminoType: "cosmos-sdk/MsgChannelUpgradeAck", - toAmino: MsgChannelUpgradeAck.toAmino, - fromAmino: MsgChannelUpgradeAck.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeConfirm": { - aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", - toAmino: MsgChannelUpgradeConfirm.toAmino, - fromAmino: MsgChannelUpgradeConfirm.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeOpen": { - aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", - toAmino: MsgChannelUpgradeOpen.toAmino, - fromAmino: MsgChannelUpgradeOpen.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeTimeout": { - aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", - toAmino: MsgChannelUpgradeTimeout.toAmino, - fromAmino: MsgChannelUpgradeTimeout.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeCancel": { - aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", - toAmino: MsgChannelUpgradeCancel.toAmino, - fromAmino: MsgChannelUpgradeCancel.fromAmino - }, - "/ibc.core.channel.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/ibc.core.channel.v1.MsgPruneAcknowledgements": { - aminoType: "cosmos-sdk/MsgPruneAcknowledgements", - toAmino: MsgPruneAcknowledgements.toAmino, - fromAmino: MsgPruneAcknowledgements.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.func.ts b/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.func.ts new file mode 100644 index 00000000..92917fb9 --- /dev/null +++ b/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.func.ts @@ -0,0 +1,117 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenInit.typeUrl, + encoders: toEncoders(MsgChannelOpenInit), + converters: toConverters(MsgChannelOpenInit) +}); +export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenTry.typeUrl, + encoders: toEncoders(MsgChannelOpenTry), + converters: toConverters(MsgChannelOpenTry) +}); +export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenAck.typeUrl, + encoders: toEncoders(MsgChannelOpenAck), + converters: toConverters(MsgChannelOpenAck) +}); +export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenConfirm.typeUrl, + encoders: toEncoders(MsgChannelOpenConfirm), + converters: toConverters(MsgChannelOpenConfirm) +}); +export const createChannelCloseInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseInit.typeUrl, + encoders: toEncoders(MsgChannelCloseInit), + converters: toConverters(MsgChannelCloseInit) +}); +export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseConfirm.typeUrl, + encoders: toEncoders(MsgChannelCloseConfirm), + converters: toConverters(MsgChannelCloseConfirm) +}); +export const createRecvPacket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecvPacket.typeUrl, + encoders: toEncoders(MsgRecvPacket), + converters: toConverters(MsgRecvPacket) +}); +export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeout.typeUrl, + encoders: toEncoders(MsgTimeout), + converters: toConverters(MsgTimeout) +}); +export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeoutOnClose.typeUrl, + encoders: toEncoders(MsgTimeoutOnClose), + converters: toConverters(MsgTimeoutOnClose) +}); +export const createAcknowledgement = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAcknowledgement.typeUrl, + encoders: toEncoders(MsgAcknowledgement), + converters: toConverters(MsgAcknowledgement) +}); +export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeInit.typeUrl, + encoders: toEncoders(MsgChannelUpgradeInit), + converters: toConverters(MsgChannelUpgradeInit) +}); +export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTry.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTry), + converters: toConverters(MsgChannelUpgradeTry) +}); +export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeAck.typeUrl, + encoders: toEncoders(MsgChannelUpgradeAck), + converters: toConverters(MsgChannelUpgradeAck) +}); +export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeConfirm.typeUrl, + encoders: toEncoders(MsgChannelUpgradeConfirm), + converters: toConverters(MsgChannelUpgradeConfirm) +}); +export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeOpen.typeUrl, + encoders: toEncoders(MsgChannelUpgradeOpen), + converters: toConverters(MsgChannelUpgradeOpen) +}); +export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTimeout.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTimeout), + converters: toConverters(MsgChannelUpgradeTimeout) +}); +export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeCancel.typeUrl, + encoders: toEncoders(MsgChannelUpgradeCancel), + converters: toConverters(MsgChannelUpgradeCancel) +}); +export const createUpdateChannelParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createPruneAcknowledgements = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAcknowledgements.typeUrl, + encoders: toEncoders(MsgPruneAcknowledgements), + converters: toConverters(MsgPruneAcknowledgements) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts b/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts deleted file mode 100644 index 315e7e3a..00000000 --- a/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse, MsgChannelUpgradeInit, MsgChannelUpgradeInitResponse, MsgChannelUpgradeTry, MsgChannelUpgradeTryResponse, MsgChannelUpgradeAck, MsgChannelUpgradeAckResponse, MsgChannelUpgradeConfirm, MsgChannelUpgradeConfirmResponse, MsgChannelUpgradeOpen, MsgChannelUpgradeOpenResponse, MsgChannelUpgradeTimeout, MsgChannelUpgradeTimeoutResponse, MsgChannelUpgradeCancel, MsgChannelUpgradeCancelResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgPruneAcknowledgements, MsgPruneAcknowledgementsResponse } from "./tx"; -/** 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; - /** ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. */ - channelUpgradeInit(request: MsgChannelUpgradeInit): Promise; - /** ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. */ - channelUpgradeTry(request: MsgChannelUpgradeTry): Promise; - /** ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. */ - channelUpgradeAck(request: MsgChannelUpgradeAck): Promise; - /** ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. */ - channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise; - /** ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. */ - channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise; - /** ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. */ - channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise; - /** ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. */ - channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise; - /** UpdateChannelParams defines a rpc handler method for MsgUpdateParams. */ - updateChannelParams(request: MsgUpdateParams): Promise; - /** PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. */ - pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ - channelOpenInit = async (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 BinaryReader(data))); - }; - /* ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. */ - channelOpenTry = async (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 BinaryReader(data))); - }; - /* ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. */ - channelOpenAck = async (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 BinaryReader(data))); - }; - /* ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. */ - channelOpenConfirm = async (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 BinaryReader(data))); - }; - /* ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. */ - channelCloseInit = async (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 BinaryReader(data))); - }; - /* ChannelCloseConfirm defines a rpc handler method for - MsgChannelCloseConfirm. */ - channelCloseConfirm = async (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 BinaryReader(data))); - }; - /* RecvPacket defines a rpc handler method for MsgRecvPacket. */ - recvPacket = async (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 BinaryReader(data))); - }; - /* Timeout defines a rpc handler method for MsgTimeout. */ - timeout = async (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 BinaryReader(data))); - }; - /* TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. */ - timeoutOnClose = async (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 BinaryReader(data))); - }; - /* Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ - acknowledgement = async (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 BinaryReader(data))); - }; - /* ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. */ - channelUpgradeInit = async (request: MsgChannelUpgradeInit): Promise => { - const data = MsgChannelUpgradeInit.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeInit", data); - return promise.then(data => MsgChannelUpgradeInitResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. */ - channelUpgradeTry = async (request: MsgChannelUpgradeTry): Promise => { - const data = MsgChannelUpgradeTry.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTry", data); - return promise.then(data => MsgChannelUpgradeTryResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. */ - channelUpgradeAck = async (request: MsgChannelUpgradeAck): Promise => { - const data = MsgChannelUpgradeAck.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeAck", data); - return promise.then(data => MsgChannelUpgradeAckResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. */ - channelUpgradeConfirm = async (request: MsgChannelUpgradeConfirm): Promise => { - const data = MsgChannelUpgradeConfirm.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm", data); - return promise.then(data => MsgChannelUpgradeConfirmResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. */ - channelUpgradeOpen = async (request: MsgChannelUpgradeOpen): Promise => { - const data = MsgChannelUpgradeOpen.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen", data); - return promise.then(data => MsgChannelUpgradeOpenResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. */ - channelUpgradeTimeout = async (request: MsgChannelUpgradeTimeout): Promise => { - const data = MsgChannelUpgradeTimeout.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout", data); - return promise.then(data => MsgChannelUpgradeTimeoutResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. */ - channelUpgradeCancel = async (request: MsgChannelUpgradeCancel): Promise => { - const data = MsgChannelUpgradeCancel.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel", data); - return promise.then(data => MsgChannelUpgradeCancelResponse.decode(new BinaryReader(data))); - }; - /* UpdateChannelParams defines a rpc handler method for MsgUpdateParams. */ - updateChannelParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "UpdateChannelParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; - /* PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. */ - pruneAcknowledgements = async (request: MsgPruneAcknowledgements): Promise => { - const data = MsgPruneAcknowledgements.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "PruneAcknowledgements", data); - return promise.then(data => MsgPruneAcknowledgementsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..106d8e60 --- /dev/null +++ b/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts @@ -0,0 +1,60 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +export const useChannelOpenInit = buildUseVueMutation({ + builderMutationFn: createChannelOpenInit +}); +export const useChannelOpenTry = buildUseVueMutation({ + builderMutationFn: createChannelOpenTry +}); +export const useChannelOpenAck = buildUseVueMutation({ + builderMutationFn: createChannelOpenAck +}); +export const useChannelOpenConfirm = buildUseVueMutation({ + builderMutationFn: createChannelOpenConfirm +}); +export const useChannelCloseInit = buildUseVueMutation({ + builderMutationFn: createChannelCloseInit +}); +export const useChannelCloseConfirm = buildUseVueMutation({ + builderMutationFn: createChannelCloseConfirm +}); +export const useRecvPacket = buildUseVueMutation({ + builderMutationFn: createRecvPacket +}); +export const useTimeout = buildUseVueMutation({ + builderMutationFn: createTimeout +}); +export const useTimeoutOnClose = buildUseVueMutation({ + builderMutationFn: createTimeoutOnClose +}); +export const useAcknowledgement = buildUseVueMutation({ + builderMutationFn: createAcknowledgement +}); +export const useChannelUpgradeInit = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeInit +}); +export const useChannelUpgradeTry = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeTry +}); +export const useChannelUpgradeAck = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeAck +}); +export const useChannelUpgradeConfirm = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeConfirm +}); +export const useChannelUpgradeOpen = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeOpen +}); +export const useChannelUpgradeTimeout = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeTimeout +}); +export const useChannelUpgradeCancel = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeCancel +}); +export const useUpdateChannelParams = buildUseVueMutation({ + builderMutationFn: createUpdateChannelParams +}); +export const usePruneAcknowledgements = buildUseVueMutation({ + builderMutationFn: createPruneAcknowledgements +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/channel/v1/tx.ts b/libs/injective-vue/src/ibc/core/channel/v1/tx.ts index 5584dc8a..365ac98b 100644 --- a/libs/injective-vue/src/ibc/core/channel/v1/tx.ts +++ b/libs/injective-vue/src/ibc/core/channel/v1/tx.ts @@ -4,7 +4,6 @@ import { UpgradeFields, UpgradeFieldsAmino, Upgrade, UpgradeAmino, ErrorReceipt, import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** ResponseResultType defines the possible outcomes of the execution of a message */ export enum ResponseResultType { /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ @@ -62,11 +61,6 @@ export interface MsgChannelOpenInit { channel: Channel; signer: string; } -export interface ReactiveMsgChannelOpenInit { - portId: ComputedRef; - channel: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenInitProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit"; value: Uint8Array; @@ -89,10 +83,6 @@ export interface MsgChannelOpenInitResponse { channelId: string; version: string; } -export interface ReactiveMsgChannelOpenInitResponse { - channelId: ComputedRef; - version: ComputedRef; -} export interface MsgChannelOpenInitResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse"; value: Uint8Array; @@ -123,15 +113,6 @@ export interface MsgChannelOpenTry { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelOpenTry { - portId: ComputedRef; - previousChannelId: ComputedRef; - channel: ComputedRef; - counterpartyVersion: ComputedRef; - proofInit: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenTryProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry"; value: Uint8Array; @@ -162,10 +143,6 @@ export interface MsgChannelOpenTryResponse { version: string; channelId: string; } -export interface ReactiveMsgChannelOpenTryResponse { - version: ComputedRef; - channelId: ComputedRef; -} export interface MsgChannelOpenTryResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse"; value: Uint8Array; @@ -195,15 +172,6 @@ export interface MsgChannelOpenAck { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelOpenAck { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannelId: ComputedRef; - counterpartyVersion: ComputedRef; - proofTry: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenAckProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck"; value: Uint8Array; @@ -230,7 +198,6 @@ export interface MsgChannelOpenAckAminoMsg { } /** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ export interface MsgChannelOpenAckResponse {} -export interface ReactiveMsgChannelOpenAckResponse {} export interface MsgChannelOpenAckResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse"; value: Uint8Array; @@ -252,13 +219,6 @@ export interface MsgChannelOpenConfirm { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelOpenConfirm { - portId: ComputedRef; - channelId: ComputedRef; - proofAck: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm"; value: Uint8Array; @@ -283,7 +243,6 @@ export interface MsgChannelOpenConfirmAminoMsg { * type. */ export interface MsgChannelOpenConfirmResponse {} -export interface ReactiveMsgChannelOpenConfirmResponse {} export interface MsgChannelOpenConfirmResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse"; value: Uint8Array; @@ -306,11 +265,6 @@ export interface MsgChannelCloseInit { channelId: string; signer: string; } -export interface ReactiveMsgChannelCloseInit { - portId: ComputedRef; - channelId: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelCloseInitProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit"; value: Uint8Array; @@ -330,7 +284,6 @@ export interface MsgChannelCloseInitAminoMsg { } /** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ export interface MsgChannelCloseInitResponse {} -export interface ReactiveMsgChannelCloseInitResponse {} export interface MsgChannelCloseInitResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse"; value: Uint8Array; @@ -353,14 +306,6 @@ export interface MsgChannelCloseConfirm { signer: string; counterpartyUpgradeSequence: bigint; } -export interface ReactiveMsgChannelCloseConfirm { - portId: ComputedRef; - channelId: ComputedRef; - proofInit: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; -} export interface MsgChannelCloseConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; value: Uint8Array; @@ -386,7 +331,6 @@ export interface MsgChannelCloseConfirmAminoMsg { * type. */ export interface MsgChannelCloseConfirmResponse {} -export interface ReactiveMsgChannelCloseConfirmResponse {} export interface MsgChannelCloseConfirmResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse"; value: Uint8Array; @@ -407,12 +351,6 @@ export interface MsgRecvPacket { proofHeight: Height; signer: string; } -export interface ReactiveMsgRecvPacket { - packet: ComputedRef; - proofCommitment: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgRecvPacketProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgRecvPacket"; value: Uint8Array; @@ -432,9 +370,6 @@ export interface MsgRecvPacketAminoMsg { export interface MsgRecvPacketResponse { result: ResponseResultType; } -export interface ReactiveMsgRecvPacketResponse { - result: ComputedRef; -} export interface MsgRecvPacketResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse"; value: Uint8Array; @@ -455,13 +390,6 @@ export interface MsgTimeout { nextSequenceRecv: bigint; signer: string; } -export interface ReactiveMsgTimeout { - packet: ComputedRef; - proofUnreceived: ComputedRef; - proofHeight: ComputedRef; - nextSequenceRecv: ComputedRef; - signer: ComputedRef; -} export interface MsgTimeoutProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeout"; value: Uint8Array; @@ -482,9 +410,6 @@ export interface MsgTimeoutAminoMsg { export interface MsgTimeoutResponse { result: ResponseResultType; } -export interface ReactiveMsgTimeoutResponse { - result: ComputedRef; -} export interface MsgTimeoutResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse"; value: Uint8Array; @@ -507,15 +432,6 @@ export interface MsgTimeoutOnClose { signer: string; counterpartyUpgradeSequence: bigint; } -export interface ReactiveMsgTimeoutOnClose { - packet: ComputedRef; - proofUnreceived: ComputedRef; - proofClose: ComputedRef; - proofHeight: ComputedRef; - nextSequenceRecv: ComputedRef; - signer: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; -} export interface MsgTimeoutOnCloseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; value: Uint8Array; @@ -538,9 +454,6 @@ export interface MsgTimeoutOnCloseAminoMsg { export interface MsgTimeoutOnCloseResponse { result: ResponseResultType; } -export interface ReactiveMsgTimeoutOnCloseResponse { - result: ComputedRef; -} export interface MsgTimeoutOnCloseResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse"; value: Uint8Array; @@ -561,13 +474,6 @@ export interface MsgAcknowledgement { proofHeight: Height; signer: string; } -export interface ReactiveMsgAcknowledgement { - packet: ComputedRef; - acknowledgement: ComputedRef; - proofAcked: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgAcknowledgementProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement"; value: Uint8Array; @@ -588,9 +494,6 @@ export interface MsgAcknowledgementAminoMsg { export interface MsgAcknowledgementResponse { result: ResponseResultType; } -export interface ReactiveMsgAcknowledgementResponse { - result: ComputedRef; -} export interface MsgAcknowledgementResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse"; value: Uint8Array; @@ -614,12 +517,6 @@ export interface MsgChannelUpgradeInit { fields: UpgradeFields; signer: string; } -export interface ReactiveMsgChannelUpgradeInit { - portId: ComputedRef; - channelId: ComputedRef; - fields: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeInitProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit"; value: Uint8Array; @@ -644,10 +541,6 @@ export interface MsgChannelUpgradeInitResponse { upgrade: Upgrade; upgradeSequence: bigint; } -export interface ReactiveMsgChannelUpgradeInitResponse { - upgrade: ComputedRef; - upgradeSequence: ComputedRef; -} export interface MsgChannelUpgradeInitResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse"; value: Uint8Array; @@ -673,17 +566,6 @@ export interface MsgChannelUpgradeTry { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeTry { - portId: ComputedRef; - channelId: ComputedRef; - proposedUpgradeConnectionHops: ComputedRef; - counterpartyUpgradeFields: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; - proofChannel: ComputedRef; - proofUpgrade: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeTryProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry"; value: Uint8Array; @@ -710,11 +592,6 @@ export interface MsgChannelUpgradeTryResponse { upgradeSequence: bigint; result: ResponseResultType; } -export interface ReactiveMsgChannelUpgradeTryResponse { - upgrade: ComputedRef; - upgradeSequence: ComputedRef; - result: ComputedRef; -} export interface MsgChannelUpgradeTryResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse"; value: Uint8Array; @@ -739,15 +616,6 @@ export interface MsgChannelUpgradeAck { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeAck { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyUpgrade: ComputedRef; - proofChannel: ComputedRef; - proofUpgrade: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeAckProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck"; value: Uint8Array; @@ -770,9 +638,6 @@ export interface MsgChannelUpgradeAckAminoMsg { export interface MsgChannelUpgradeAckResponse { result: ResponseResultType; } -export interface ReactiveMsgChannelUpgradeAckResponse { - result: ComputedRef; -} export interface MsgChannelUpgradeAckResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse"; value: Uint8Array; @@ -796,16 +661,6 @@ export interface MsgChannelUpgradeConfirm { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeConfirm { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannelState: ComputedRef; - counterpartyUpgrade: ComputedRef; - proofChannel: ComputedRef; - proofUpgrade: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm"; value: Uint8Array; @@ -829,9 +684,6 @@ export interface MsgChannelUpgradeConfirmAminoMsg { export interface MsgChannelUpgradeConfirmResponse { result: ResponseResultType; } -export interface ReactiveMsgChannelUpgradeConfirmResponse { - result: ComputedRef; -} export interface MsgChannelUpgradeConfirmResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse"; value: Uint8Array; @@ -854,15 +706,6 @@ export interface MsgChannelUpgradeOpen { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeOpen { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannelState: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; - proofChannel: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeOpenProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen"; value: Uint8Array; @@ -883,7 +726,6 @@ export interface MsgChannelUpgradeOpenAminoMsg { } /** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ export interface MsgChannelUpgradeOpenResponse {} -export interface ReactiveMsgChannelUpgradeOpenResponse {} export interface MsgChannelUpgradeOpenResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse"; value: Uint8Array; @@ -903,14 +745,6 @@ export interface MsgChannelUpgradeTimeout { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeTimeout { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannel: ComputedRef; - proofChannel: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeTimeoutProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout"; value: Uint8Array; @@ -930,7 +764,6 @@ export interface MsgChannelUpgradeTimeoutAminoMsg { } /** MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type */ export interface MsgChannelUpgradeTimeoutResponse {} -export interface ReactiveMsgChannelUpgradeTimeoutResponse {} export interface MsgChannelUpgradeTimeoutResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse"; value: Uint8Array; @@ -950,14 +783,6 @@ export interface MsgChannelUpgradeCancel { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeCancel { - portId: ComputedRef; - channelId: ComputedRef; - errorReceipt: ComputedRef; - proofErrorReceipt: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeCancelProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel"; value: Uint8Array; @@ -977,7 +802,6 @@ export interface MsgChannelUpgradeCancelAminoMsg { } /** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ export interface MsgChannelUpgradeCancelResponse {} -export interface ReactiveMsgChannelUpgradeCancelResponse {} export interface MsgChannelUpgradeCancelResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse"; value: Uint8Array; @@ -999,10 +823,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgUpdateParams"; value: Uint8Array; @@ -1024,7 +844,6 @@ export interface MsgUpdateParamsAminoMsg { } /** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -1042,12 +861,6 @@ export interface MsgPruneAcknowledgements { limit: bigint; signer: string; } -export interface ReactiveMsgPruneAcknowledgements { - portId: ComputedRef; - channelId: ComputedRef; - limit: ComputedRef; - signer: ComputedRef; -} export interface MsgPruneAcknowledgementsProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements"; value: Uint8Array; @@ -1070,10 +883,6 @@ export interface MsgPruneAcknowledgementsResponse { /** Number of sequences left after pruning. */ totalRemainingSequences: bigint; } -export interface ReactiveMsgPruneAcknowledgementsResponse { - totalPrunedSequences: ComputedRef; - totalRemainingSequences: ComputedRef; -} export interface MsgPruneAcknowledgementsResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/channel/v1/upgrade.ts b/libs/injective-vue/src/ibc/core/channel/v1/upgrade.ts index 91185340..150fa5b9 100644 --- a/libs/injective-vue/src/ibc/core/channel/v1/upgrade.ts +++ b/libs/injective-vue/src/ibc/core/channel/v1/upgrade.ts @@ -2,7 +2,6 @@ import { Timeout, TimeoutAmino, Order } from "./channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, isSet } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * Upgrade is a verifiable type which contains the relevant information * for an attempted upgrade. It provides the proposed changes to the channel @@ -15,11 +14,6 @@ export interface Upgrade { timeout: Timeout; nextSequenceSend: bigint; } -export interface ReactiveUpgrade { - fields: ComputedRef; - timeout: ComputedRef; - nextSequenceSend: ComputedRef; -} export interface UpgradeProtoMsg { typeUrl: "/ibc.core.channel.v1.Upgrade"; value: Uint8Array; @@ -49,11 +43,6 @@ export interface UpgradeFields { connectionHops: string[]; version: string; } -export interface ReactiveUpgradeFields { - ordering: ComputedRef; - connectionHops: ComputedRef; - version: ComputedRef; -} export interface UpgradeFieldsProtoMsg { typeUrl: "/ibc.core.channel.v1.UpgradeFields"; value: Uint8Array; @@ -82,10 +71,6 @@ export interface ErrorReceipt { /** the error message detailing the cause of failure */ message: string; } -export interface ReactiveErrorReceipt { - sequence: ComputedRef; - message: ComputedRef; -} export interface ErrorReceiptProtoMsg { typeUrl: "/ibc.core.channel.v1.ErrorReceipt"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/client/v1/client.ts b/libs/injective-vue/src/ibc/core/client/v1/client.ts index 4846cb86..542424cb 100644 --- a/libs/injective-vue/src/ibc/core/client/v1/client.ts +++ b/libs/injective-vue/src/ibc/core/client/v1/client.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * IdentifiedClientState defines a client state with an additional client * identifier field. @@ -13,10 +12,6 @@ export interface IdentifiedClientState { /** client state */ clientState?: Any; } -export interface ReactiveIdentifiedClientState { - clientId: ComputedRef; - clientState?: ComputedRef; -} export interface IdentifiedClientStateProtoMsg { typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; value: Uint8Array; @@ -45,10 +40,6 @@ export interface ConsensusStateWithHeight { /** consensus state */ consensusState?: Any; } -export interface ReactiveConsensusStateWithHeight { - height: ComputedRef; - consensusState?: ComputedRef; -} export interface ConsensusStateWithHeightProtoMsg { typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; value: Uint8Array; @@ -77,10 +68,6 @@ export interface ClientConsensusStates { /** consensus states and their heights associated with the client */ consensusStates: ConsensusStateWithHeight[]; } -export interface ReactiveClientConsensusStates { - clientId: ComputedRef; - consensusStates: ComputedRef; -} export interface ClientConsensusStatesProtoMsg { typeUrl: "/ibc.core.client.v1.ClientConsensusStates"; value: Uint8Array; @@ -120,10 +107,6 @@ export interface Height { /** the height within the given revision */ revisionHeight: bigint; } -export interface ReactiveHeight { - revisionNumber: ComputedRef; - revisionHeight: ComputedRef; -} export interface HeightProtoMsg { typeUrl: "/ibc.core.client.v1.Height"; value: Uint8Array; @@ -162,9 +145,6 @@ export interface Params { */ allowedClients: string[]; } -export interface ReactiveParams { - allowedClients: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.core.client.v1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/client/v1/tx.amino.ts b/libs/injective-vue/src/ibc/core/client/v1/tx.amino.ts deleted file mode 100644 index dc80a575..00000000 --- a/libs/injective-vue/src/ibc/core/client/v1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/ibc.core.client.v1.MsgCreateClient": { - aminoType: "cosmos-sdk/MsgCreateClient", - toAmino: MsgCreateClient.toAmino, - fromAmino: MsgCreateClient.fromAmino - }, - "/ibc.core.client.v1.MsgUpdateClient": { - aminoType: "cosmos-sdk/MsgUpdateClient", - toAmino: MsgUpdateClient.toAmino, - fromAmino: MsgUpdateClient.fromAmino - }, - "/ibc.core.client.v1.MsgUpgradeClient": { - aminoType: "cosmos-sdk/MsgUpgradeClient", - toAmino: MsgUpgradeClient.toAmino, - fromAmino: MsgUpgradeClient.fromAmino - }, - "/ibc.core.client.v1.MsgSubmitMisbehaviour": { - aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", - toAmino: MsgSubmitMisbehaviour.toAmino, - fromAmino: MsgSubmitMisbehaviour.fromAmino - }, - "/ibc.core.client.v1.MsgRecoverClient": { - aminoType: "cosmos-sdk/MsgRecoverClient", - toAmino: MsgRecoverClient.toAmino, - fromAmino: MsgRecoverClient.fromAmino - }, - "/ibc.core.client.v1.MsgIBCSoftwareUpgrade": { - aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", - toAmino: MsgIBCSoftwareUpgrade.toAmino, - fromAmino: MsgIBCSoftwareUpgrade.fromAmino - }, - "/ibc.core.client.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.func.ts b/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.func.ts new file mode 100644 index 00000000..a178d5d2 --- /dev/null +++ b/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +export const createCreateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateClient.typeUrl, + encoders: toEncoders(MsgCreateClient), + converters: toConverters(MsgCreateClient) +}); +export const createUpdateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateClient.typeUrl, + encoders: toEncoders(MsgUpdateClient), + converters: toConverters(MsgUpdateClient) +}); +export const createUpgradeClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpgradeClient.typeUrl, + encoders: toEncoders(MsgUpgradeClient), + converters: toConverters(MsgUpgradeClient) +}); +export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitMisbehaviour.typeUrl, + encoders: toEncoders(MsgSubmitMisbehaviour), + converters: toConverters(MsgSubmitMisbehaviour) +}); +export const createRecoverClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecoverClient.typeUrl, + encoders: toEncoders(MsgRecoverClient), + converters: toConverters(MsgRecoverClient) +}); +export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgIBCSoftwareUpgrade.typeUrl, + encoders: toEncoders(MsgIBCSoftwareUpgrade), + converters: toConverters(MsgIBCSoftwareUpgrade) +}); +export const createUpdateClientParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.msg.ts b/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.msg.ts deleted file mode 100644 index f338de2a..00000000 --- a/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse, MsgRecoverClient, MsgRecoverClientResponse, MsgIBCSoftwareUpgrade, MsgIBCSoftwareUpgradeResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** 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; - /** RecoverClient defines a rpc handler method for MsgRecoverClient. */ - recoverClient(request: MsgRecoverClient): Promise; - /** IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. */ - iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise; - /** UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ - updateClientParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateClient defines a rpc handler method for MsgCreateClient. */ - createClient = async (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 BinaryReader(data))); - }; - /* UpdateClient defines a rpc handler method for MsgUpdateClient. */ - updateClient = async (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 BinaryReader(data))); - }; - /* UpgradeClient defines a rpc handler method for MsgUpgradeClient. */ - upgradeClient = async (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 BinaryReader(data))); - }; - /* SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ - submitMisbehaviour = async (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 BinaryReader(data))); - }; - /* RecoverClient defines a rpc handler method for MsgRecoverClient. */ - recoverClient = async (request: MsgRecoverClient): Promise => { - const data = MsgRecoverClient.encode(request).finish(); - const promise = this.rpc.request("ibc.core.client.v1.Msg", "RecoverClient", data); - return promise.then(data => MsgRecoverClientResponse.decode(new BinaryReader(data))); - }; - /* IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. */ - iBCSoftwareUpgrade = async (request: MsgIBCSoftwareUpgrade): Promise => { - const data = MsgIBCSoftwareUpgrade.encode(request).finish(); - const promise = this.rpc.request("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade", data); - return promise.then(data => MsgIBCSoftwareUpgradeResponse.decode(new BinaryReader(data))); - }; - /* UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ - updateClientParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClientParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..e58f7de8 --- /dev/null +++ b/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +export const useCreateClient = buildUseVueMutation({ + builderMutationFn: createCreateClient +}); +export const useUpdateClient = buildUseVueMutation({ + builderMutationFn: createUpdateClient +}); +export const useUpgradeClient = buildUseVueMutation({ + builderMutationFn: createUpgradeClient +}); +export const useSubmitMisbehaviour = buildUseVueMutation({ + builderMutationFn: createSubmitMisbehaviour +}); +export const useRecoverClient = buildUseVueMutation({ + builderMutationFn: createRecoverClient +}); +export const useIBCSoftwareUpgrade = buildUseVueMutation({ + builderMutationFn: createIBCSoftwareUpgrade +}); +export const useUpdateClientParams = buildUseVueMutation({ + builderMutationFn: createUpdateClientParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/client/v1/tx.ts b/libs/injective-vue/src/ibc/core/client/v1/tx.ts index 43f9dd14..60b35cd4 100644 --- a/libs/injective-vue/src/ibc/core/client/v1/tx.ts +++ b/libs/injective-vue/src/ibc/core/client/v1/tx.ts @@ -4,7 +4,6 @@ import { Params, ParamsAmino } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClient { /** light client state */ @@ -17,11 +16,6 @@ export interface MsgCreateClient { /** signer address */ signer: string; } -export interface ReactiveMsgCreateClient { - clientState?: ComputedRef; - consensusState?: ComputedRef; - signer: ComputedRef; -} export interface MsgCreateClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgCreateClient"; value: Uint8Array; @@ -46,9 +40,6 @@ export interface MsgCreateClientAminoMsg { export interface MsgCreateClientResponse { clientId: string; } -export interface ReactiveMsgCreateClientResponse { - clientId: ComputedRef; -} export interface MsgCreateClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; value: Uint8Array; @@ -73,11 +64,6 @@ export interface MsgUpdateClient { /** signer address */ signer: string; } -export interface ReactiveMsgUpdateClient { - clientId: ComputedRef; - clientMessage?: ComputedRef; - signer: ComputedRef; -} export interface MsgUpdateClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateClient"; value: Uint8Array; @@ -100,7 +86,6 @@ export interface MsgUpdateClientAminoMsg { } /** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ export interface MsgUpdateClientResponse {} -export interface ReactiveMsgUpdateClientResponse {} export interface MsgUpdateClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse"; value: Uint8Array; @@ -132,14 +117,6 @@ export interface MsgUpgradeClient { /** signer address */ signer: string; } -export interface ReactiveMsgUpgradeClient { - clientId: ComputedRef; - clientState?: ComputedRef; - consensusState?: ComputedRef; - proofUpgradeClient: ComputedRef; - proofUpgradeConsensusState: ComputedRef; - signer: ComputedRef; -} export interface MsgUpgradeClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpgradeClient"; value: Uint8Array; @@ -171,7 +148,6 @@ export interface MsgUpgradeClientAminoMsg { } /** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ export interface MsgUpgradeClientResponse {} -export interface ReactiveMsgUpgradeClientResponse {} export interface MsgUpgradeClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse"; value: Uint8Array; @@ -196,11 +172,6 @@ export interface MsgSubmitMisbehaviour { /** signer address */ signer: string; } -export interface ReactiveMsgSubmitMisbehaviour { - clientId: ComputedRef; - misbehaviour?: ComputedRef; - signer: ComputedRef; -} export interface MsgSubmitMisbehaviourProtoMsg { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour"; value: Uint8Array; @@ -228,7 +199,6 @@ export interface MsgSubmitMisbehaviourAminoMsg { * type. */ export interface MsgSubmitMisbehaviourResponse {} -export interface ReactiveMsgSubmitMisbehaviourResponse {} export interface MsgSubmitMisbehaviourResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse"; value: Uint8Array; @@ -254,11 +224,6 @@ export interface MsgRecoverClient { /** signer address */ signer: string; } -export interface ReactiveMsgRecoverClient { - subjectClientId: ComputedRef; - substituteClientId: ComputedRef; - signer: ComputedRef; -} export interface MsgRecoverClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgRecoverClient"; value: Uint8Array; @@ -281,7 +246,6 @@ export interface MsgRecoverClientAminoMsg { } /** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ export interface MsgRecoverClientResponse {} -export interface ReactiveMsgRecoverClientResponse {} export interface MsgRecoverClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse"; value: Uint8Array; @@ -309,11 +273,6 @@ export interface MsgIBCSoftwareUpgrade { /** signer address */ signer: string; } -export interface ReactiveMsgIBCSoftwareUpgrade { - plan: ComputedRef; - upgradedClientState?: ComputedRef; - signer: ComputedRef; -} export interface MsgIBCSoftwareUpgradeProtoMsg { typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade"; value: Uint8Array; @@ -341,7 +300,6 @@ export interface MsgIBCSoftwareUpgradeAminoMsg { } /** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ export interface MsgIBCSoftwareUpgradeResponse {} -export interface ReactiveMsgIBCSoftwareUpgradeResponse {} export interface MsgIBCSoftwareUpgradeResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse"; value: Uint8Array; @@ -363,10 +321,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - signer: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateParams"; value: Uint8Array; @@ -388,7 +342,6 @@ export interface MsgUpdateParamsAminoMsg { } /** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/commitment/v1/commitment.ts b/libs/injective-vue/src/ibc/core/commitment/v1/commitment.ts index 7328ff43..051efcdf 100644 --- a/libs/injective-vue/src/ibc/core/commitment/v1/commitment.ts +++ b/libs/injective-vue/src/ibc/core/commitment/v1/commitment.ts @@ -2,7 +2,6 @@ import { CommitmentProof, CommitmentProofAmino } from "../../../../cosmos/ics23/ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * MerkleRoot defines a merkle root hash. * In the Cosmos SDK, the AppHash of a block header becomes the root. @@ -10,9 +9,6 @@ import { ComputedRef } from "vue"; export interface MerkleRoot { hash: Uint8Array; } -export interface ReactiveMerkleRoot { - hash: ComputedRef; -} export interface MerkleRootProtoMsg { typeUrl: "/ibc.core.commitment.v1.MerkleRoot"; value: Uint8Array; @@ -36,9 +32,6 @@ export interface MerkleRootAminoMsg { export interface MerklePrefix { keyPrefix: Uint8Array; } -export interface ReactiveMerklePrefix { - keyPrefix: ComputedRef; -} export interface MerklePrefixProtoMsg { typeUrl: "/ibc.core.commitment.v1.MerklePrefix"; value: Uint8Array; @@ -65,9 +58,6 @@ export interface MerklePrefixAminoMsg { export interface MerkleProof { proofs: CommitmentProof[]; } -export interface ReactiveMerkleProof { - proofs: ComputedRef; -} export interface MerkleProofProtoMsg { typeUrl: "/ibc.core.commitment.v1.MerkleProof"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/connection/v1/connection.ts b/libs/injective-vue/src/ibc/core/connection/v1/connection.ts index 2b2c30b7..1791709d 100644 --- a/libs/injective-vue/src/ibc/core/connection/v1/connection.ts +++ b/libs/injective-vue/src/ibc/core/connection/v1/connection.ts @@ -2,7 +2,6 @@ import { MerklePrefix, MerklePrefixAmino } from "../../commitment/v1/commitment" import { isSet, DeepPartial } from "../../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * State defines if a connection is in one of the following states: * INIT, TRYOPEN, OPEN or UNINITIALIZED. @@ -82,13 +81,6 @@ export interface ConnectionEnd { */ delayPeriod: bigint; } -export interface ReactiveConnectionEnd { - clientId: ComputedRef; - versions: ComputedRef; - state: ComputedRef; - counterparty: ComputedRef; - delayPeriod: ComputedRef; -} export interface ConnectionEndProtoMsg { typeUrl: "/ibc.core.connection.v1.ConnectionEnd"; value: Uint8Array; @@ -143,14 +135,6 @@ export interface IdentifiedConnection { /** delay period associated with this connection. */ delayPeriod: bigint; } -export interface ReactiveIdentifiedConnection { - id: ComputedRef; - clientId: ComputedRef; - versions: ComputedRef; - state: ComputedRef; - counterparty: ComputedRef; - delayPeriod: ComputedRef; -} export interface IdentifiedConnectionProtoMsg { typeUrl: "/ibc.core.connection.v1.IdentifiedConnection"; value: Uint8Array; @@ -195,11 +179,6 @@ export interface Counterparty { /** commitment merkle prefix of the counterparty chain. */ prefix: MerklePrefix; } -export interface ReactiveCounterparty { - clientId: ComputedRef; - connectionId: ComputedRef; - prefix: ComputedRef; -} export interface CounterpartyProtoMsg { typeUrl: "/ibc.core.connection.v1.Counterparty"; value: Uint8Array; @@ -228,9 +207,6 @@ export interface ClientPaths { /** list of connection paths */ paths: string[]; } -export interface ReactiveClientPaths { - paths: ComputedRef; -} export interface ClientPathsProtoMsg { typeUrl: "/ibc.core.connection.v1.ClientPaths"; value: Uint8Array; @@ -251,10 +227,6 @@ export interface ConnectionPaths { /** list of connection paths */ paths: string[]; } -export interface ReactiveConnectionPaths { - clientId: ComputedRef; - paths: ComputedRef; -} export interface ConnectionPathsProtoMsg { typeUrl: "/ibc.core.connection.v1.ConnectionPaths"; value: Uint8Array; @@ -280,10 +252,6 @@ export interface Version { /** list of features compatible with the specified identifier */ features: string[]; } -export interface ReactiveVersion { - identifier: ComputedRef; - features: ComputedRef; -} export interface VersionProtoMsg { typeUrl: "/ibc.core.connection.v1.Version"; value: Uint8Array; @@ -311,9 +279,6 @@ export interface Params { */ maxExpectedTimePerBlock: bigint; } -export interface ReactiveParams { - maxExpectedTimePerBlock: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.core.connection.v1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/core/connection/v1/tx.amino.ts b/libs/injective-vue/src/ibc/core/connection/v1/tx.amino.ts deleted file mode 100644 index 719f737c..00000000 --- a/libs/injective-vue/src/ibc/core/connection/v1/tx.amino.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/ibc.core.connection.v1.MsgConnectionOpenInit": { - aminoType: "cosmos-sdk/MsgConnectionOpenInit", - toAmino: MsgConnectionOpenInit.toAmino, - fromAmino: MsgConnectionOpenInit.fromAmino - }, - "/ibc.core.connection.v1.MsgConnectionOpenTry": { - aminoType: "cosmos-sdk/MsgConnectionOpenTry", - toAmino: MsgConnectionOpenTry.toAmino, - fromAmino: MsgConnectionOpenTry.fromAmino - }, - "/ibc.core.connection.v1.MsgConnectionOpenAck": { - aminoType: "cosmos-sdk/MsgConnectionOpenAck", - toAmino: MsgConnectionOpenAck.toAmino, - fromAmino: MsgConnectionOpenAck.fromAmino - }, - "/ibc.core.connection.v1.MsgConnectionOpenConfirm": { - aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", - toAmino: MsgConnectionOpenConfirm.toAmino, - fromAmino: MsgConnectionOpenConfirm.fromAmino - }, - "/ibc.core.connection.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.func.ts b/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.func.ts new file mode 100644 index 00000000..c6b7e37d --- /dev/null +++ b/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.func.ts @@ -0,0 +1,33 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenInit.typeUrl, + encoders: toEncoders(MsgConnectionOpenInit), + converters: toConverters(MsgConnectionOpenInit) +}); +export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenTry.typeUrl, + encoders: toEncoders(MsgConnectionOpenTry), + converters: toConverters(MsgConnectionOpenTry) +}); +export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenAck.typeUrl, + encoders: toEncoders(MsgConnectionOpenAck), + converters: toConverters(MsgConnectionOpenAck) +}); +export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenConfirm.typeUrl, + encoders: toEncoders(MsgConnectionOpenConfirm), + converters: toConverters(MsgConnectionOpenConfirm) +}); +export const createUpdateConnectionParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts b/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts deleted file mode 100644 index a77bfe4b..00000000 --- a/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** 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; - /** - * UpdateConnectionParams defines a rpc handler method for - * MsgUpdateParams. - */ - updateConnectionParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ - connectionOpenInit = async (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 BinaryReader(data))); - }; - /* ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. */ - connectionOpenTry = async (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 BinaryReader(data))); - }; - /* ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. */ - connectionOpenAck = async (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 BinaryReader(data))); - }; - /* ConnectionOpenConfirm defines a rpc handler method for - MsgConnectionOpenConfirm. */ - connectionOpenConfirm = async (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 BinaryReader(data))); - }; - /* UpdateConnectionParams defines a rpc handler method for - MsgUpdateParams. */ - updateConnectionParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.core.connection.v1.Msg", "UpdateConnectionParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..8e33749b --- /dev/null +++ b/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts @@ -0,0 +1,18 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +export const useConnectionOpenInit = buildUseVueMutation({ + builderMutationFn: createConnectionOpenInit +}); +export const useConnectionOpenTry = buildUseVueMutation({ + builderMutationFn: createConnectionOpenTry +}); +export const useConnectionOpenAck = buildUseVueMutation({ + builderMutationFn: createConnectionOpenAck +}); +export const useConnectionOpenConfirm = buildUseVueMutation({ + builderMutationFn: createConnectionOpenConfirm +}); +export const useUpdateConnectionParams = buildUseVueMutation({ + builderMutationFn: createUpdateConnectionParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/ibc/core/connection/v1/tx.ts b/libs/injective-vue/src/ibc/core/connection/v1/tx.ts index 87869100..38e556c3 100644 --- a/libs/injective-vue/src/ibc/core/connection/v1/tx.ts +++ b/libs/injective-vue/src/ibc/core/connection/v1/tx.ts @@ -4,7 +4,6 @@ import { Height, HeightAmino, Params, ParamsAmino } from "../../client/v1/client import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgConnectionOpenInit defines the msg sent by an account on Chain A to * initialize a connection with Chain B. @@ -16,13 +15,6 @@ export interface MsgConnectionOpenInit { delayPeriod: bigint; signer: string; } -export interface ReactiveMsgConnectionOpenInit { - clientId: ComputedRef; - counterparty: ComputedRef; - version?: ComputedRef; - delayPeriod: ComputedRef; - signer: ComputedRef; -} export interface MsgConnectionOpenInitProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit"; value: Uint8Array; @@ -47,7 +39,6 @@ export interface MsgConnectionOpenInitAminoMsg { * type. */ export interface MsgConnectionOpenInitResponse {} -export interface ReactiveMsgConnectionOpenInitResponse {} export interface MsgConnectionOpenInitResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse"; value: Uint8Array; @@ -96,21 +87,6 @@ export interface MsgConnectionOpenTry { /** @deprecated */ hostConsensusStateProof: Uint8Array; } -export interface ReactiveMsgConnectionOpenTry { - clientId: ComputedRef; - previousConnectionId: ComputedRef; - clientState?: ComputedRef; - counterparty: ComputedRef; - delayPeriod: ComputedRef; - counterpartyVersions: ComputedRef; - proofHeight: ComputedRef; - proofInit: ComputedRef; - proofClient: ComputedRef; - proofConsensus: ComputedRef; - consensusHeight: ComputedRef; - signer: ComputedRef; - hostConsensusStateProof: ComputedRef; -} export interface MsgConnectionOpenTryProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry"; value: Uint8Array; @@ -156,7 +132,6 @@ export interface MsgConnectionOpenTryAminoMsg { } /** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ export interface MsgConnectionOpenTryResponse {} -export interface ReactiveMsgConnectionOpenTryResponse {} export interface MsgConnectionOpenTryResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse"; value: Uint8Array; @@ -198,19 +173,6 @@ export interface MsgConnectionOpenAck { /** @deprecated */ hostConsensusStateProof: Uint8Array; } -export interface ReactiveMsgConnectionOpenAck { - connectionId: ComputedRef; - counterpartyConnectionId: ComputedRef; - version?: ComputedRef; - clientState?: ComputedRef; - proofHeight: ComputedRef; - proofTry: ComputedRef; - proofClient: ComputedRef; - proofConsensus: ComputedRef; - consensusHeight: ComputedRef; - signer: ComputedRef; - hostConsensusStateProof: ComputedRef; -} export interface MsgConnectionOpenAckProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck"; value: Uint8Array; @@ -252,7 +214,6 @@ export interface MsgConnectionOpenAckAminoMsg { } /** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ export interface MsgConnectionOpenAckResponse {} -export interface ReactiveMsgConnectionOpenAckResponse {} export interface MsgConnectionOpenAckResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse"; value: Uint8Array; @@ -274,12 +235,6 @@ export interface MsgConnectionOpenConfirm { proofHeight: Height; signer: string; } -export interface ReactiveMsgConnectionOpenConfirm { - connectionId: ComputedRef; - proofAck: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgConnectionOpenConfirmProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm"; value: Uint8Array; @@ -304,7 +259,6 @@ export interface MsgConnectionOpenConfirmAminoMsg { * response type. */ export interface MsgConnectionOpenConfirmResponse {} -export interface ReactiveMsgConnectionOpenConfirmResponse {} export interface MsgConnectionOpenConfirmResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse"; value: Uint8Array; @@ -329,10 +283,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - signer: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgUpdateParams"; value: Uint8Array; @@ -354,7 +304,6 @@ export interface MsgUpdateParamsAminoMsg { } /** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/ibc/rpc.tx.ts b/libs/injective-vue/src/ibc/rpc.tx.ts deleted file mode 100644 index 07abe50f..00000000 --- a/libs/injective-vue/src/ibc/rpc.tx.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - authz: { - v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - ibc: { - applications: { - transfer: { - v1: new (await import("./applications/transfer/v1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - core: { - channel: { - v1: new (await import("./core/channel/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - client: { - v1: new (await import("./core/client/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - connection: { - v1: new (await import("./core/connection/v1/tx.rpc.msg")).MsgClientImpl(rpc) - } - } - } -}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/auction.ts b/libs/injective-vue/src/injective/auction/v1beta1/auction.ts index b7852b4e..7fd1367f 100644 --- a/libs/injective-vue/src/injective/auction/v1beta1/auction.ts +++ b/libs/injective-vue/src/injective/auction/v1beta1/auction.ts @@ -2,17 +2,12 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface Params { /** auction_period_duration defines the auction period duration */ auctionPeriod: bigint; /** min_next_bid_increment_rate defines the minimum increment rate for new bids */ minNextBidIncrementRate: string; } -export interface ReactiveParams { - auctionPeriod: ComputedRef; - minNextBidIncrementRate: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.auction.v1beta1.Params"; value: Uint8Array; @@ -31,10 +26,6 @@ export interface Bid { bidder: string; amount: string; } -export interface ReactiveBid { - bidder: ComputedRef; - amount: ComputedRef; -} export interface BidProtoMsg { typeUrl: "/injective.auction.v1beta1.Bid"; value: Uint8Array; @@ -55,11 +46,6 @@ export interface LastAuctionResult { /** round defines the round number of auction */ round: bigint; } -export interface ReactiveLastAuctionResult { - winner: ComputedRef; - amount: ComputedRef; - round: ComputedRef; -} export interface LastAuctionResultProtoMsg { typeUrl: "/injective.auction.v1beta1.LastAuctionResult"; value: Uint8Array; @@ -84,11 +70,6 @@ export interface EventBid { /** round defines the round number of auction */ round: bigint; } -export interface ReactiveEventBid { - bidder: ComputedRef; - amount: ComputedRef; - round: ComputedRef; -} export interface EventBidProtoMsg { typeUrl: "/injective.auction.v1beta1.EventBid"; value: Uint8Array; @@ -113,11 +94,6 @@ export interface EventAuctionResult { /** round defines the round number of auction */ round: bigint; } -export interface ReactiveEventAuctionResult { - winner: ComputedRef; - amount: ComputedRef; - round: ComputedRef; -} export interface EventAuctionResultProtoMsg { typeUrl: "/injective.auction.v1beta1.EventAuctionResult"; value: Uint8Array; @@ -145,11 +121,6 @@ export interface EventAuctionStart { */ newBasket: Coin[]; } -export interface ReactiveEventAuctionStart { - round: ComputedRef; - endingTimestamp: ComputedRef; - newBasket: ComputedRef; -} export interface EventAuctionStartProtoMsg { typeUrl: "/injective.auction.v1beta1.EventAuctionStart"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/auction/v1beta1/genesis.ts b/libs/injective-vue/src/injective/auction/v1beta1/genesis.ts index 410528d6..234b2b8d 100644 --- a/libs/injective-vue/src/injective/auction/v1beta1/genesis.ts +++ b/libs/injective-vue/src/injective/auction/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino, Bid, BidAmino, LastAuctionResult, LastAuctionResul import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the auction module's genesis state. */ export interface GenesisState { /** params defines all the parameters of related to auction. */ @@ -16,13 +15,6 @@ export interface GenesisState { /** last auction result */ lastAuctionResult?: LastAuctionResult; } -export interface ReactiveGenesisState { - params: ComputedRef; - auctionRound: ComputedRef; - highestBid?: ComputedRef; - auctionEndingTimestamp: ComputedRef; - lastAuctionResult?: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.auction.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.Query.ts deleted file mode 100644 index aad4e156..00000000 --- a/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse, ReactiveQueryAuctionParamsRequest, ReactiveQueryCurrentAuctionBasketRequest, ReactiveQueryModuleStateRequest, ReactiveQueryLastAuctionResultRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Retrieves auction params */ - auctionParams(request?: QueryAuctionParamsRequest): Promise; - /** Retrieves current auction basket with current highest bid and bidder */ - currentAuctionBasket(request?: QueryCurrentAuctionBasketRequest): Promise; - /** Retrieves the entire auction module's state */ - auctionModuleState(request?: QueryModuleStateRequest): Promise; - lastAuctionResult(request?: QueryLastAuctionResultRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Retrieves auction params */ - auctionParams = async (request: QueryAuctionParamsRequest = {}): Promise => { - const data = QueryAuctionParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.auction.v1beta1.Query", "AuctionParams", data); - return promise.then(data => QueryAuctionParamsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves current auction basket with current highest bid and bidder */ - currentAuctionBasket = async (request: QueryCurrentAuctionBasketRequest = {}): Promise => { - const data = QueryCurrentAuctionBasketRequest.encode(request).finish(); - const promise = this.rpc.request("injective.auction.v1beta1.Query", "CurrentAuctionBasket", data); - return promise.then(data => QueryCurrentAuctionBasketResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire auction module's state */ - auctionModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.auction.v1beta1.Query", "AuctionModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; - /* LastAuctionResult */ - lastAuctionResult = async (request: QueryLastAuctionResultRequest = {}): Promise => { - const data = QueryLastAuctionResultRequest.encode(request).finish(); - const promise = this.rpc.request("injective.auction.v1beta1.Query", "LastAuctionResult", data); - return promise.then(data => QueryLastAuctionResultResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - auctionParams(request?: QueryAuctionParamsRequest): Promise { - return queryService.auctionParams(request); - }, - currentAuctionBasket(request?: QueryCurrentAuctionBasketRequest): Promise { - return queryService.currentAuctionBasket(request); - }, - auctionModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.auctionModuleState(request); - }, - lastAuctionResult(request?: QueryLastAuctionResultRequest): Promise { - return queryService.lastAuctionResult(request); - } - }; -}; -export interface UseAuctionParamsQuery extends VueQueryParams { - request?: ReactiveQueryAuctionParamsRequest; -} -export interface UseCurrentAuctionBasketQuery extends VueQueryParams { - request?: ReactiveQueryCurrentAuctionBasketRequest; -} -export interface UseAuctionModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export interface UseLastAuctionResultQuery extends VueQueryParams { - request?: ReactiveQueryLastAuctionResultRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useAuctionParams = ({ - request, - options - }: UseAuctionParamsQuery) => { - const queryKey = ["auctionParamsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.auctionParams(params); - }, - ...options - }); - }; - const useCurrentAuctionBasket = ({ - request, - options - }: UseCurrentAuctionBasketQuery) => { - const queryKey = ["currentAuctionBasketQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.currentAuctionBasket(params); - }, - ...options - }); - }; - const useAuctionModuleState = ({ - request, - options - }: UseAuctionModuleStateQuery) => { - const queryKey = ["auctionModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.auctionModuleState(params); - }, - ...options - }); - }; - const useLastAuctionResult = ({ - request, - options - }: UseLastAuctionResultQuery) => { - const queryKey = ["lastAuctionResultQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.lastAuctionResult(params); - }, - ...options - }); - }; - return { - /** Retrieves auction params */useAuctionParams, - /** Retrieves current auction basket with current highest bid and bidder */useCurrentAuctionBasket, - /** Retrieves the entire auction module's state */useAuctionModuleState, - useLastAuctionResult - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..831e714f --- /dev/null +++ b/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.func.ts @@ -0,0 +1,30 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; +export const createGetAuctionParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAuctionParamsRequest.encode, + decode: QueryAuctionParamsResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "AuctionParams", + clientResolver +}); +export const createGetCurrentAuctionBasket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCurrentAuctionBasketRequest.encode, + decode: QueryCurrentAuctionBasketResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "CurrentAuctionBasket", + clientResolver +}); +export const createGetAuctionModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "AuctionModuleState", + clientResolver +}); +export const createGetLastAuctionResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastAuctionResultRequest.encode, + decode: QueryLastAuctionResultResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "LastAuctionResult", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..102a8d30 --- /dev/null +++ b/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts @@ -0,0 +1,19 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; +import { createGetAuctionParams, createGetCurrentAuctionBasket, createGetAuctionModuleState, createGetLastAuctionResult } from "./query.rpc.func.ts"; +export const useGetAuctionParams = buildUseVueQuery({ + builderQueryFn: createGetAuctionParams, + queryKeyPrefix: "AuctionParamsQuery" +}); +export const useGetCurrentAuctionBasket = buildUseVueQuery({ + builderQueryFn: createGetCurrentAuctionBasket, + queryKeyPrefix: "CurrentAuctionBasketQuery" +}); +export const useGetAuctionModuleState = buildUseVueQuery({ + builderQueryFn: createGetAuctionModuleState, + queryKeyPrefix: "AuctionModuleStateQuery" +}); +export const useGetLastAuctionResult = buildUseVueQuery({ + builderQueryFn: createGetLastAuctionResult, + queryKeyPrefix: "LastAuctionResultQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/query.ts b/libs/injective-vue/src/injective/auction/v1beta1/query.ts index 52828a39..723f9496 100644 --- a/libs/injective-vue/src/injective/auction/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/auction/v1beta1/query.ts @@ -4,13 +4,11 @@ import { GenesisState, GenesisStateAmino } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * QueryAuctionParamsRequest is the request type for the Query/AuctionParams RPC * method. */ export interface QueryAuctionParamsRequest {} -export interface ReactiveQueryAuctionParamsRequest {} export interface QueryAuctionParamsRequestProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsRequest"; value: Uint8Array; @@ -31,9 +29,6 @@ export interface QueryAuctionParamsRequestAminoMsg { export interface QueryAuctionParamsResponse { params: Params; } -export interface ReactiveQueryAuctionParamsResponse { - params: ComputedRef; -} export interface QueryAuctionParamsResponseProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsResponse"; value: Uint8Array; @@ -54,7 +49,6 @@ export interface QueryAuctionParamsResponseAminoMsg { * Query/CurrentAuctionBasket RPC method. */ export interface QueryCurrentAuctionBasketRequest {} -export interface ReactiveQueryCurrentAuctionBasketRequest {} export interface QueryCurrentAuctionBasketRequestProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest"; value: Uint8Array; @@ -84,13 +78,6 @@ export interface QueryCurrentAuctionBasketResponse { /** highestBidAmount describes highest bid amount on current round */ highestBidAmount: string; } -export interface ReactiveQueryCurrentAuctionBasketResponse { - amount: ComputedRef; - auctionRound: ComputedRef; - auctionClosingTime: ComputedRef; - highestBidder: ComputedRef; - highestBidAmount: ComputedRef; -} export interface QueryCurrentAuctionBasketResponseProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse"; value: Uint8Array; @@ -120,7 +107,6 @@ export interface QueryCurrentAuctionBasketResponseAminoMsg { * RPC method. */ export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryModuleStateRequest"; value: Uint8Array; @@ -141,9 +127,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryModuleStateResponse"; value: Uint8Array; @@ -160,7 +143,6 @@ export interface QueryModuleStateResponseAminoMsg { value: QueryModuleStateResponseAmino; } export interface QueryLastAuctionResultRequest {} -export interface ReactiveQueryLastAuctionResultRequest {} export interface QueryLastAuctionResultRequestProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultRequest"; value: Uint8Array; @@ -173,9 +155,6 @@ export interface QueryLastAuctionResultRequestAminoMsg { export interface QueryLastAuctionResultResponse { lastAuctionResult?: LastAuctionResult; } -export interface ReactiveQueryLastAuctionResultResponse { - lastAuctionResult?: ComputedRef; -} export interface QueryLastAuctionResultResponseProtoMsg { typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/auction/v1beta1/tx.amino.ts b/libs/injective-vue/src/injective/auction/v1beta1/tx.amino.ts deleted file mode 100644 index 5f6da619..00000000 --- a/libs/injective-vue/src/injective/auction/v1beta1/tx.amino.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MsgBid, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/injective.auction.v1beta1.MsgBid": { - aminoType: "auction/MsgBid", - toAmino: MsgBid.toAmino, - fromAmino: MsgBid.fromAmino - }, - "/injective.auction.v1beta1.MsgUpdateParams": { - aminoType: "auction/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..b8eb2122 --- /dev/null +++ b/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgBid, MsgUpdateParams } from "./tx"; +export const createBid = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBid.typeUrl, + encoders: toEncoders(MsgBid), + converters: toConverters(MsgBid) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index c6c5fb68..00000000 --- a/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgBid, MsgBidResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the auction Msg service. */ -export interface Msg { - /** Bid defines a method for placing a bid for an auction */ - bid(request: MsgBid): Promise; - updateParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Bid defines a method for placing a bid for an auction */ - bid = async (request: MsgBid): Promise => { - const data = MsgBid.encode(request).finish(); - const promise = this.rpc.request("injective.auction.v1beta1.Msg", "Bid", data); - return promise.then(data => MsgBidResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.auction.v1beta1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..18087100 --- /dev/null +++ b/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,9 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgBid, MsgUpdateParams } from "./tx"; +import { createBid, createUpdateParams } from "./tx.rpc.func.ts"; +export const useBid = buildUseVueMutation({ + builderMutationFn: createBid +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/auction/v1beta1/tx.ts b/libs/injective-vue/src/injective/auction/v1beta1/tx.ts index 830e7e6b..27f408f8 100644 --- a/libs/injective-vue/src/injective/auction/v1beta1/tx.ts +++ b/libs/injective-vue/src/injective/auction/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Params, ParamsAmino } from "./auction"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** Bid defines a SDK message for placing a bid for an auction */ export interface MsgBid { sender: string; @@ -12,11 +11,6 @@ export interface MsgBid { /** the current auction round being bid on */ round: bigint; } -export interface ReactiveMsgBid { - sender: ComputedRef; - bidAmount: ComputedRef; - round: ComputedRef; -} export interface MsgBidProtoMsg { typeUrl: "/injective.auction.v1beta1.MsgBid"; value: Uint8Array; @@ -34,7 +28,6 @@ export interface MsgBidAminoMsg { value: MsgBidAmino; } export interface MsgBidResponse {} -export interface ReactiveMsgBidResponse {} export interface MsgBidResponseProtoMsg { typeUrl: "/injective.auction.v1beta1.MsgBidResponse"; value: Uint8Array; @@ -54,10 +47,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.auction.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -77,7 +66,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.auction.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts b/libs/injective-vue/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts index 6e5c6247..0017ec6a 100644 --- a/libs/injective-vue/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts +++ b/libs/injective-vue/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * PubKey defines a type alias for an ecdsa.PublicKey that implements * Tendermint's PubKey interface. It represents the 33-byte compressed public @@ -10,9 +9,6 @@ import { ComputedRef } from "vue"; export interface PubKey { key: Uint8Array; } -export interface ReactivePubKey { - key: ComputedRef; -} export interface PubKeyProtoMsg { typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PubKey"; value: Uint8Array; @@ -36,9 +32,6 @@ export interface PubKeyAminoMsg { export interface PrivKey { key: Uint8Array; } -export interface ReactivePrivKey { - key: ComputedRef; -} export interface PrivKeyProtoMsg { typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PrivKey"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/authz.ts b/libs/injective-vue/src/injective/exchange/v1beta1/authz.ts index 902cc04f..96f2d111 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/authz.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/authz.ts @@ -1,16 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** spot authz messages */ export interface CreateSpotLimitOrderAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveCreateSpotLimitOrderAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface CreateSpotLimitOrderAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.CreateSpotLimitOrderAuthz"; value: Uint8Array; @@ -28,10 +23,6 @@ export interface CreateSpotMarketOrderAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveCreateSpotMarketOrderAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface CreateSpotMarketOrderAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.CreateSpotMarketOrderAuthz"; value: Uint8Array; @@ -48,10 +39,6 @@ export interface BatchCreateSpotLimitOrdersAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveBatchCreateSpotLimitOrdersAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface BatchCreateSpotLimitOrdersAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.BatchCreateSpotLimitOrdersAuthz"; value: Uint8Array; @@ -68,10 +55,6 @@ export interface CancelSpotOrderAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveCancelSpotOrderAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface CancelSpotOrderAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.CancelSpotOrderAuthz"; value: Uint8Array; @@ -88,10 +71,6 @@ export interface BatchCancelSpotOrdersAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveBatchCancelSpotOrdersAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface BatchCancelSpotOrdersAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.BatchCancelSpotOrdersAuthz"; value: Uint8Array; @@ -109,10 +88,6 @@ export interface CreateDerivativeLimitOrderAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveCreateDerivativeLimitOrderAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface CreateDerivativeLimitOrderAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.CreateDerivativeLimitOrderAuthz"; value: Uint8Array; @@ -130,10 +105,6 @@ export interface CreateDerivativeMarketOrderAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveCreateDerivativeMarketOrderAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface CreateDerivativeMarketOrderAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.CreateDerivativeMarketOrderAuthz"; value: Uint8Array; @@ -150,10 +121,6 @@ export interface BatchCreateDerivativeLimitOrdersAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveBatchCreateDerivativeLimitOrdersAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface BatchCreateDerivativeLimitOrdersAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.BatchCreateDerivativeLimitOrdersAuthz"; value: Uint8Array; @@ -170,10 +137,6 @@ export interface CancelDerivativeOrderAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveCancelDerivativeOrderAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface CancelDerivativeOrderAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.CancelDerivativeOrderAuthz"; value: Uint8Array; @@ -190,10 +153,6 @@ export interface BatchCancelDerivativeOrdersAuthz { subaccountId: string; marketIds: string[]; } -export interface ReactiveBatchCancelDerivativeOrdersAuthz { - subaccountId: ComputedRef; - marketIds: ComputedRef; -} export interface BatchCancelDerivativeOrdersAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.BatchCancelDerivativeOrdersAuthz"; value: Uint8Array; @@ -212,11 +171,6 @@ export interface BatchUpdateOrdersAuthz { spotMarkets: string[]; derivativeMarkets: string[]; } -export interface ReactiveBatchUpdateOrdersAuthz { - subaccountId: ComputedRef; - spotMarkets: ComputedRef; - derivativeMarkets: ComputedRef; -} export interface BatchUpdateOrdersAuthzProtoMsg { typeUrl: "/injective.exchange.v1beta1.BatchUpdateOrdersAuthz"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/events.ts b/libs/injective-vue/src/injective/exchange/v1beta1/events.ts index 084133fb..133514d5 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/events.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/events.ts @@ -3,19 +3,12 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface EventBatchSpotExecution { marketId: string; isBuy: boolean; executionType: ExecutionType; trades: TradeLog[]; } -export interface ReactiveEventBatchSpotExecution { - marketId: ComputedRef; - isBuy: ComputedRef; - executionType: ComputedRef; - trades: ComputedRef; -} export interface EventBatchSpotExecutionProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventBatchSpotExecution"; value: Uint8Array; @@ -39,14 +32,6 @@ export interface EventBatchDerivativeExecution { executionType: ExecutionType; trades: DerivativeTradeLog[]; } -export interface ReactiveEventBatchDerivativeExecution { - marketId: ComputedRef; - isBuy: ComputedRef; - isLiquidation: ComputedRef; - cumulativeFunding?: ComputedRef; - executionType: ComputedRef; - trades: ComputedRef; -} export interface EventBatchDerivativeExecutionProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativeExecution"; value: Uint8Array; @@ -70,12 +55,6 @@ export interface EventLostFundsFromLiquidation { lostFundsFromAvailableDuringPayout: string; lostFundsFromOrderCancels: string; } -export interface ReactiveEventLostFundsFromLiquidation { - marketId: ComputedRef; - subaccountId: ComputedRef; - lostFundsFromAvailableDuringPayout: ComputedRef; - lostFundsFromOrderCancels: ComputedRef; -} export interface EventLostFundsFromLiquidationProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation"; value: Uint8Array; @@ -94,10 +73,6 @@ export interface EventBatchDerivativePosition { marketId: string; positions: SubaccountPosition[]; } -export interface ReactiveEventBatchDerivativePosition { - marketId: ComputedRef; - positions: ComputedRef; -} export interface EventBatchDerivativePositionProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativePosition"; value: Uint8Array; @@ -116,12 +91,6 @@ export interface EventDerivativeMarketPaused { totalMissingFunds: string; missingFundsRate: string; } -export interface ReactiveEventDerivativeMarketPaused { - marketId: ComputedRef; - settlePrice: ComputedRef; - totalMissingFunds: ComputedRef; - missingFundsRate: ComputedRef; -} export interface EventDerivativeMarketPausedProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventDerivativeMarketPaused"; value: Uint8Array; @@ -141,11 +110,6 @@ export interface EventMarketBeyondBankruptcy { settlePrice: string; missingMarketFunds: string; } -export interface ReactiveEventMarketBeyondBankruptcy { - marketId: ComputedRef; - settlePrice: ComputedRef; - missingMarketFunds: ComputedRef; -} export interface EventMarketBeyondBankruptcyProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy"; value: Uint8Array; @@ -164,11 +128,6 @@ export interface EventAllPositionsHaircut { settlePrice: string; missingFundsRate: string; } -export interface ReactiveEventAllPositionsHaircut { - marketId: ComputedRef; - settlePrice: ComputedRef; - missingFundsRate: ComputedRef; -} export interface EventAllPositionsHaircutProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventAllPositionsHaircut"; value: Uint8Array; @@ -185,9 +144,6 @@ export interface EventAllPositionsHaircutAminoMsg { export interface EventBinaryOptionsMarketUpdate { market: BinaryOptionsMarket; } -export interface ReactiveEventBinaryOptionsMarketUpdate { - market: ComputedRef; -} export interface EventBinaryOptionsMarketUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate"; value: Uint8Array; @@ -204,11 +160,6 @@ export interface EventNewSpotOrders { buyOrders: SpotLimitOrder[]; sellOrders: SpotLimitOrder[]; } -export interface ReactiveEventNewSpotOrders { - marketId: ComputedRef; - buyOrders: ComputedRef; - sellOrders: ComputedRef; -} export interface EventNewSpotOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventNewSpotOrders"; value: Uint8Array; @@ -227,11 +178,6 @@ export interface EventNewDerivativeOrders { buyOrders: DerivativeLimitOrder[]; sellOrders: DerivativeLimitOrder[]; } -export interface ReactiveEventNewDerivativeOrders { - marketId: ComputedRef; - buyOrders: ComputedRef; - sellOrders: ComputedRef; -} export interface EventNewDerivativeOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventNewDerivativeOrders"; value: Uint8Array; @@ -249,10 +195,6 @@ export interface EventCancelSpotOrder { marketId: string; order: SpotLimitOrder; } -export interface ReactiveEventCancelSpotOrder { - marketId: ComputedRef; - order: ComputedRef; -} export interface EventCancelSpotOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventCancelSpotOrder"; value: Uint8Array; @@ -268,9 +210,6 @@ export interface EventCancelSpotOrderAminoMsg { export interface EventSpotMarketUpdate { market: SpotMarket; } -export interface ReactiveEventSpotMarketUpdate { - market: ComputedRef; -} export interface EventSpotMarketUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventSpotMarketUpdate"; value: Uint8Array; @@ -287,11 +226,6 @@ export interface EventPerpetualMarketUpdate { perpetualMarketInfo?: PerpetualMarketInfo; funding?: PerpetualMarketFunding; } -export interface ReactiveEventPerpetualMarketUpdate { - market: ComputedRef; - perpetualMarketInfo?: ComputedRef; - funding?: ComputedRef; -} export interface EventPerpetualMarketUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate"; value: Uint8Array; @@ -309,10 +243,6 @@ export interface EventExpiryFuturesMarketUpdate { market: DerivativeMarket; expiryFuturesMarketInfo?: ExpiryFuturesMarketInfo; } -export interface ReactiveEventExpiryFuturesMarketUpdate { - market: ComputedRef; - expiryFuturesMarketInfo?: ComputedRef; -} export interface EventExpiryFuturesMarketUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate"; value: Uint8Array; @@ -332,13 +262,6 @@ export interface EventPerpetualMarketFundingUpdate { fundingRate?: string; markPrice?: string; } -export interface ReactiveEventPerpetualMarketFundingUpdate { - marketId: ComputedRef; - funding: ComputedRef; - isHourlyFunding: ComputedRef; - fundingRate?: ComputedRef; - markPrice?: ComputedRef; -} export interface EventPerpetualMarketFundingUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate"; value: Uint8Array; @@ -359,11 +282,6 @@ export interface EventSubaccountDeposit { subaccountId: Uint8Array; amount: Coin; } -export interface ReactiveEventSubaccountDeposit { - srcAddress: ComputedRef; - subaccountId: ComputedRef; - amount: ComputedRef; -} export interface EventSubaccountDepositProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventSubaccountDeposit"; value: Uint8Array; @@ -382,11 +300,6 @@ export interface EventSubaccountWithdraw { dstAddress: string; amount: Coin; } -export interface ReactiveEventSubaccountWithdraw { - subaccountId: ComputedRef; - dstAddress: ComputedRef; - amount: ComputedRef; -} export interface EventSubaccountWithdrawProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventSubaccountWithdraw"; value: Uint8Array; @@ -405,11 +318,6 @@ export interface EventSubaccountBalanceTransfer { dstSubaccountId: string; amount: Coin; } -export interface ReactiveEventSubaccountBalanceTransfer { - srcSubaccountId: ComputedRef; - dstSubaccountId: ComputedRef; - amount: ComputedRef; -} export interface EventSubaccountBalanceTransferProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer"; value: Uint8Array; @@ -426,9 +334,6 @@ export interface EventSubaccountBalanceTransferAminoMsg { export interface EventBatchDepositUpdate { depositUpdates: DepositUpdate[]; } -export interface ReactiveEventBatchDepositUpdate { - depositUpdates: ComputedRef; -} export interface EventBatchDepositUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventBatchDepositUpdate"; value: Uint8Array; @@ -444,10 +349,6 @@ export interface DerivativeMarketOrderCancel { marketOrder?: DerivativeMarketOrder; cancelQuantity: string; } -export interface ReactiveDerivativeMarketOrderCancel { - marketOrder?: ComputedRef; - cancelQuantity: ComputedRef; -} export interface DerivativeMarketOrderCancelProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel"; value: Uint8Array; @@ -466,12 +367,6 @@ export interface EventCancelDerivativeOrder { limitOrder?: DerivativeLimitOrder; marketOrderCancel?: DerivativeMarketOrderCancel; } -export interface ReactiveEventCancelDerivativeOrder { - marketId: ComputedRef; - isLimitCancel: ComputedRef; - limitOrder?: ComputedRef; - marketOrderCancel?: ComputedRef; -} export interface EventCancelDerivativeOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventCancelDerivativeOrder"; value: Uint8Array; @@ -489,9 +384,6 @@ export interface EventCancelDerivativeOrderAminoMsg { export interface EventFeeDiscountSchedule { schedule?: FeeDiscountSchedule; } -export interface ReactiveEventFeeDiscountSchedule { - schedule?: ComputedRef; -} export interface EventFeeDiscountScheduleProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventFeeDiscountSchedule"; value: Uint8Array; @@ -507,10 +399,6 @@ export interface EventTradingRewardCampaignUpdate { campaignInfo?: TradingRewardCampaignInfo; campaignRewardPools: CampaignRewardPool[]; } -export interface ReactiveEventTradingRewardCampaignUpdate { - campaignInfo?: ComputedRef; - campaignRewardPools: ComputedRef; -} export interface EventTradingRewardCampaignUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate"; value: Uint8Array; @@ -526,9 +414,6 @@ export interface EventTradingRewardCampaignUpdateAminoMsg { export interface EventTradingRewardDistribution { accountRewards: AccountRewards[]; } -export interface ReactiveEventTradingRewardDistribution { - accountRewards: ComputedRef; -} export interface EventTradingRewardDistributionProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventTradingRewardDistribution"; value: Uint8Array; @@ -546,12 +431,6 @@ export interface EventNewConditionalDerivativeOrder { hash: Uint8Array; isMarket: boolean; } -export interface ReactiveEventNewConditionalDerivativeOrder { - marketId: ComputedRef; - order?: ComputedRef; - hash: ComputedRef; - isMarket: ComputedRef; -} export interface EventNewConditionalDerivativeOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder"; value: Uint8Array; @@ -572,12 +451,6 @@ export interface EventCancelConditionalDerivativeOrder { limitOrder?: DerivativeLimitOrder; marketOrder?: DerivativeMarketOrder; } -export interface ReactiveEventCancelConditionalDerivativeOrder { - marketId: ComputedRef; - isLimitCancel: ComputedRef; - limitOrder?: ComputedRef; - marketOrder?: ComputedRef; -} export interface EventCancelConditionalDerivativeOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder"; value: Uint8Array; @@ -599,13 +472,6 @@ export interface EventConditionalDerivativeOrderTrigger { placedOrderHash: Uint8Array; triggeredOrderCid: string; } -export interface ReactiveEventConditionalDerivativeOrderTrigger { - marketId: ComputedRef; - isLimitTrigger: ComputedRef; - triggeredOrderHash: ComputedRef; - placedOrderHash: ComputedRef; - triggeredOrderCid: ComputedRef; -} export interface EventConditionalDerivativeOrderTriggerProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger"; value: Uint8Array; @@ -627,12 +493,6 @@ export interface EventOrderFail { flags: number[]; cids: string[]; } -export interface ReactiveEventOrderFail { - account: ComputedRef; - hashes: ComputedRef; - flags: ComputedRef; - cids: ComputedRef; -} export interface EventOrderFailProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventOrderFail"; value: Uint8Array; @@ -650,9 +510,6 @@ export interface EventOrderFailAminoMsg { export interface EventAtomicMarketOrderFeeMultipliersUpdated { marketFeeMultipliers: MarketFeeMultiplier[]; } -export interface ReactiveEventAtomicMarketOrderFeeMultipliersUpdated { - marketFeeMultipliers: ComputedRef; -} export interface EventAtomicMarketOrderFeeMultipliersUpdatedProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated"; value: Uint8Array; @@ -668,10 +525,6 @@ export interface EventOrderbookUpdate { spotUpdates: OrderbookUpdate[]; derivativeUpdates: OrderbookUpdate[]; } -export interface ReactiveEventOrderbookUpdate { - spotUpdates: ComputedRef; - derivativeUpdates: ComputedRef; -} export interface EventOrderbookUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventOrderbookUpdate"; value: Uint8Array; @@ -688,10 +541,6 @@ export interface OrderbookUpdate { seq: bigint; orderbook?: Orderbook; } -export interface ReactiveOrderbookUpdate { - seq: ComputedRef; - orderbook?: ComputedRef; -} export interface OrderbookUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.OrderbookUpdate"; value: Uint8Array; @@ -709,11 +558,6 @@ export interface Orderbook { buyLevels: Level[]; sellLevels: Level[]; } -export interface ReactiveOrderbook { - marketId: ComputedRef; - buyLevels: ComputedRef; - sellLevels: ComputedRef; -} export interface OrderbookProtoMsg { typeUrl: "/injective.exchange.v1beta1.Orderbook"; value: Uint8Array; @@ -731,10 +575,6 @@ export interface EventGrantAuthorizations { granter: string; grants: GrantAuthorization[]; } -export interface ReactiveEventGrantAuthorizations { - granter: ComputedRef; - grants: ComputedRef; -} export interface EventGrantAuthorizationsProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventGrantAuthorizations"; value: Uint8Array; @@ -752,11 +592,6 @@ export interface EventGrantActivation { granter: string; amount: string; } -export interface ReactiveEventGrantActivation { - grantee: ComputedRef; - granter: ComputedRef; - amount: ComputedRef; -} export interface EventGrantActivationProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventGrantActivation"; value: Uint8Array; @@ -774,10 +609,6 @@ export interface EventInvalidGrant { grantee: string; granter: string; } -export interface ReactiveEventInvalidGrant { - grantee: ComputedRef; - granter: ComputedRef; -} export interface EventInvalidGrantProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventInvalidGrant"; value: Uint8Array; @@ -797,13 +628,6 @@ export interface EventOrderCancelFail { cid: string; description: string; } -export interface ReactiveEventOrderCancelFail { - marketId: ComputedRef; - subaccountId: ComputedRef; - orderHash: ComputedRef; - cid: ComputedRef; - description: ComputedRef; -} export interface EventOrderCancelFailProtoMsg { typeUrl: "/injective.exchange.v1beta1.EventOrderCancelFail"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/exchange.ts b/libs/injective-vue/src/injective/exchange/v1beta1/exchange.ts index 7398e290..a91677d5 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/exchange.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/exchange.ts @@ -3,7 +3,6 @@ import { OracleType } from "../../oracle/v1beta1/oracle"; import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export enum AtomicMarketOrderAccessLevel { Nobody = 0, /** BeginBlockerSmartContractsOnly - currently unsupported */ @@ -436,36 +435,6 @@ export interface Params { /** inj_auction_max_cap defines the maximum cap for INJ sent to auction */ injAuctionMaxCap: string; } -export interface ReactiveParams { - spotMarketInstantListingFee: ComputedRef; - derivativeMarketInstantListingFee: ComputedRef; - defaultSpotMakerFeeRate: ComputedRef; - defaultSpotTakerFeeRate: ComputedRef; - defaultDerivativeMakerFeeRate: ComputedRef; - defaultDerivativeTakerFeeRate: ComputedRef; - defaultInitialMarginRatio: ComputedRef; - defaultMaintenanceMarginRatio: ComputedRef; - defaultFundingInterval: ComputedRef; - fundingMultiple: ComputedRef; - relayerFeeShareRate: ComputedRef; - defaultHourlyFundingRateCap: ComputedRef; - defaultHourlyInterestRate: ComputedRef; - maxDerivativeOrderSideCount: ComputedRef; - injRewardStakedRequirementThreshold: ComputedRef; - tradingRewardsVestingDuration: ComputedRef; - liquidatorRewardShareRate: ComputedRef; - binaryOptionsMarketInstantListingFee: ComputedRef; - atomicMarketOrderAccessLevel: ComputedRef; - spotAtomicMarketOrderFeeMultiplier: ComputedRef; - derivativeAtomicMarketOrderFeeMultiplier: ComputedRef; - binaryOptionsAtomicMarketOrderFeeMultiplier: ComputedRef; - minimalProtocolFeeRate: ComputedRef; - isInstantDerivativeMarketLaunchEnabled: ComputedRef; - postOnlyModeHeightThreshold: ComputedRef; - marginDecreasePriceTimestampThresholdSeconds: ComputedRef; - exchangeAdmins: ComputedRef; - injAuctionMaxCap: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.exchange.v1beta1.Params"; value: Uint8Array; @@ -604,10 +573,6 @@ export interface MarketFeeMultiplier { marketId: string; feeMultiplier: string; } -export interface ReactiveMarketFeeMultiplier { - marketId: ComputedRef; - feeMultiplier: ComputedRef; -} export interface MarketFeeMultiplierProtoMsg { typeUrl: "/injective.exchange.v1beta1.MarketFeeMultiplier"; value: Uint8Array; @@ -682,27 +647,6 @@ export interface DerivativeMarket { /** level of admin permissions */ adminPermissions: number; } -export interface ReactiveDerivativeMarket { - ticker: ComputedRef; - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleType: ComputedRef; - oracleScaleFactor: ComputedRef; - quoteDenom: ComputedRef; - marketId: ComputedRef; - initialMarginRatio: ComputedRef; - maintenanceMarginRatio: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - relayerFeeShareRate: ComputedRef; - isPerpetual: ComputedRef; - status: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; - admin: ComputedRef; - adminPermissions: ComputedRef; -} export interface DerivativeMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeMarket"; value: Uint8Array; @@ -825,27 +769,6 @@ export interface BinaryOptionsMarket { /** level of admin permissions */ adminPermissions: number; } -export interface ReactiveBinaryOptionsMarket { - ticker: ComputedRef; - oracleSymbol: ComputedRef; - oracleProvider: ComputedRef; - oracleType: ComputedRef; - oracleScaleFactor: ComputedRef; - expirationTimestamp: ComputedRef; - settlementTimestamp: ComputedRef; - admin: ComputedRef; - quoteDenom: ComputedRef; - marketId: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - relayerFeeShareRate: ComputedRef; - status: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - settlementPrice?: ComputedRef; - minNotional: ComputedRef; - adminPermissions: ComputedRef; -} export interface BinaryOptionsMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarket"; value: Uint8Array; @@ -930,13 +853,6 @@ export interface ExpiryFuturesMarketInfo { */ settlementPrice: string; } -export interface ReactiveExpiryFuturesMarketInfo { - marketId: ComputedRef; - expirationTimestamp: ComputedRef; - twapStartTimestamp: ComputedRef; - expirationTwapStartPriceCumulative: ComputedRef; - settlementPrice: ComputedRef; -} export interface ExpiryFuturesMarketInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo"; value: Uint8Array; @@ -990,13 +906,6 @@ export interface PerpetualMarketInfo { */ fundingInterval: bigint; } -export interface ReactivePerpetualMarketInfo { - marketId: ComputedRef; - hourlyFundingRateCap: ComputedRef; - hourlyInterestRate: ComputedRef; - nextFundingTimestamp: ComputedRef; - fundingInterval: ComputedRef; -} export interface PerpetualMarketInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.PerpetualMarketInfo"; value: Uint8Array; @@ -1036,11 +945,6 @@ export interface PerpetualMarketFunding { cumulativePrice: string; lastTimestamp: bigint; } -export interface ReactivePerpetualMarketFunding { - cumulativeFunding: ComputedRef; - cumulativePrice: ComputedRef; - lastTimestamp: ComputedRef; -} export interface PerpetualMarketFundingProtoMsg { typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFunding"; value: Uint8Array; @@ -1065,10 +969,6 @@ export interface DerivativeMarketSettlementInfo { /** settlement_price defines the settlement price */ settlementPrice: string; } -export interface ReactiveDerivativeMarketSettlementInfo { - marketId: ComputedRef; - settlementPrice: ComputedRef; -} export interface DerivativeMarketSettlementInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo"; value: Uint8Array; @@ -1086,9 +986,6 @@ export interface DerivativeMarketSettlementInfoAminoMsg { export interface NextFundingTimestamp { nextTimestamp: bigint; } -export interface ReactiveNextFundingTimestamp { - nextTimestamp: ComputedRef; -} export interface NextFundingTimestampProtoMsg { typeUrl: "/injective.exchange.v1beta1.NextFundingTimestamp"; value: Uint8Array; @@ -1108,11 +1005,6 @@ export interface MidPriceAndTOB { /** best sell price of the market */ bestSellPrice?: string; } -export interface ReactiveMidPriceAndTOB { - midPrice?: ComputedRef; - bestBuyPrice?: ComputedRef; - bestSellPrice?: ComputedRef; -} export interface MidPriceAndTOBProtoMsg { typeUrl: "/injective.exchange.v1beta1.MidPriceAndTOB"; value: Uint8Array; @@ -1173,21 +1065,6 @@ export interface SpotMarket { /** level of admin permissions */ adminPermissions: number; } -export interface ReactiveSpotMarket { - ticker: ComputedRef; - baseDenom: ComputedRef; - quoteDenom: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - relayerFeeShareRate: ComputedRef; - marketId: ComputedRef; - status: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; - admin: ComputedRef; - adminPermissions: ComputedRef; -} export interface SpotMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotMarket"; value: Uint8Array; @@ -1245,10 +1122,6 @@ export interface Deposit { availableBalance: string; totalBalance: string; } -export interface ReactiveDeposit { - availableBalance: ComputedRef; - totalBalance: ComputedRef; -} export interface DepositProtoMsg { typeUrl: "/injective.exchange.v1beta1.Deposit"; value: Uint8Array; @@ -1265,9 +1138,6 @@ export interface DepositAminoMsg { export interface SubaccountTradeNonce { nonce: number; } -export interface ReactiveSubaccountTradeNonce { - nonce: ComputedRef; -} export interface SubaccountTradeNonceProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountTradeNonce"; value: Uint8Array; @@ -1290,13 +1160,6 @@ export interface OrderInfo { quantity: string; cid: string; } -export interface ReactiveOrderInfo { - subaccountId: ComputedRef; - feeRecipient: ComputedRef; - price: ComputedRef; - quantity: ComputedRef; - cid: ComputedRef; -} export interface OrderInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.OrderInfo"; value: Uint8Array; @@ -1326,12 +1189,6 @@ export interface SpotOrder { /** trigger_price is the trigger price used by stop/take orders */ triggerPrice?: string; } -export interface ReactiveSpotOrder { - marketId: ComputedRef; - orderInfo: ComputedRef; - orderType: ComputedRef; - triggerPrice?: ComputedRef; -} export interface SpotOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotOrder"; value: Uint8Array; @@ -1362,13 +1219,6 @@ export interface SpotLimitOrder { triggerPrice?: string; orderHash: Uint8Array; } -export interface ReactiveSpotLimitOrder { - orderInfo: ComputedRef; - orderType: ComputedRef; - fillable: ComputedRef; - triggerPrice?: ComputedRef; - orderHash: ComputedRef; -} export interface SpotLimitOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotLimitOrder"; value: Uint8Array; @@ -1400,13 +1250,6 @@ export interface SpotMarketOrder { /** trigger_price is the trigger price used by stop/take orders */ triggerPrice?: string; } -export interface ReactiveSpotMarketOrder { - orderInfo: ComputedRef; - balanceHold: ComputedRef; - orderHash: ComputedRef; - orderType: ComputedRef; - triggerPrice?: ComputedRef; -} export interface SpotMarketOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotMarketOrder"; value: Uint8Array; @@ -1438,13 +1281,6 @@ export interface DerivativeOrder { /** trigger_price is the trigger price used by stop/take orders */ triggerPrice?: string; } -export interface ReactiveDerivativeOrder { - marketId: ComputedRef; - orderInfo: ComputedRef; - orderType: ComputedRef; - margin: ComputedRef; - triggerPrice?: ComputedRef; -} export interface DerivativeOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeOrder"; value: Uint8Array; @@ -1481,14 +1317,6 @@ export interface SubaccountOrderbookMetadata { vanillaConditionalOrderCount: number; reduceOnlyConditionalOrderCount: number; } -export interface ReactiveSubaccountOrderbookMetadata { - vanillaLimitOrderCount: ComputedRef; - reduceOnlyLimitOrderCount: ComputedRef; - aggregateReduceOnlyQuantity: ComputedRef; - aggregateVanillaQuantity: ComputedRef; - vanillaConditionalOrderCount: ComputedRef; - reduceOnlyConditionalOrderCount: ComputedRef; -} export interface SubaccountOrderbookMetadataProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata"; value: Uint8Array; @@ -1521,12 +1349,6 @@ export interface SubaccountOrder { isReduceOnly: boolean; cid: string; } -export interface ReactiveSubaccountOrder { - price: ComputedRef; - quantity: ComputedRef; - isReduceOnly: ComputedRef; - cid: ComputedRef; -} export interface SubaccountOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountOrder"; value: Uint8Array; @@ -1547,10 +1369,6 @@ export interface SubaccountOrderData { order?: SubaccountOrder; orderHash: Uint8Array; } -export interface ReactiveSubaccountOrderData { - order?: ComputedRef; - orderHash: ComputedRef; -} export interface SubaccountOrderDataProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountOrderData"; value: Uint8Array; @@ -1577,14 +1395,6 @@ export interface DerivativeLimitOrder { triggerPrice?: string; orderHash: Uint8Array; } -export interface ReactiveDerivativeLimitOrder { - orderInfo: ComputedRef; - orderType: ComputedRef; - margin: ComputedRef; - fillable: ComputedRef; - triggerPrice?: ComputedRef; - orderHash: ComputedRef; -} export interface DerivativeLimitOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeLimitOrder"; value: Uint8Array; @@ -1619,14 +1429,6 @@ export interface DerivativeMarketOrder { triggerPrice?: string; orderHash: Uint8Array; } -export interface ReactiveDerivativeMarketOrder { - orderInfo: ComputedRef; - orderType: ComputedRef; - margin: ComputedRef; - marginHold: ComputedRef; - triggerPrice?: ComputedRef; - orderHash: ComputedRef; -} export interface DerivativeMarketOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrder"; value: Uint8Array; @@ -1654,13 +1456,6 @@ export interface Position { margin: string; cumulativeFundingEntry: string; } -export interface ReactivePosition { - isLong: ComputedRef; - quantity: ComputedRef; - entryPrice: ComputedRef; - margin: ComputedRef; - cumulativeFundingEntry: ComputedRef; -} export interface PositionProtoMsg { typeUrl: "/injective.exchange.v1beta1.Position"; value: Uint8Array; @@ -1681,10 +1476,6 @@ export interface MarketOrderIndicator { marketId: string; isBuy: boolean; } -export interface ReactiveMarketOrderIndicator { - marketId: ComputedRef; - isBuy: ComputedRef; -} export interface MarketOrderIndicatorProtoMsg { typeUrl: "/injective.exchange.v1beta1.MarketOrderIndicator"; value: Uint8Array; @@ -1708,15 +1499,6 @@ export interface TradeLog { feeRecipientAddress?: Uint8Array; cid: string; } -export interface ReactiveTradeLog { - quantity: ComputedRef; - price: ComputedRef; - subaccountId: ComputedRef; - fee: ComputedRef; - orderHash: ComputedRef; - feeRecipientAddress?: ComputedRef; - cid: ComputedRef; -} export interface TradeLogProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradeLog"; value: Uint8Array; @@ -1741,12 +1523,6 @@ export interface PositionDelta { executionMargin: string; executionPrice: string; } -export interface ReactivePositionDelta { - isLong: ComputedRef; - executionQuantity: ComputedRef; - executionMargin: ComputedRef; - executionPrice: ComputedRef; -} export interface PositionDeltaProtoMsg { typeUrl: "/injective.exchange.v1beta1.PositionDelta"; value: Uint8Array; @@ -1771,16 +1547,6 @@ export interface DerivativeTradeLog { cid: string; pnl: string; } -export interface ReactiveDerivativeTradeLog { - subaccountId: ComputedRef; - positionDelta?: ComputedRef; - payout: ComputedRef; - fee: ComputedRef; - orderHash: ComputedRef; - feeRecipientAddress?: ComputedRef; - cid: ComputedRef; - pnl: ComputedRef; -} export interface DerivativeTradeLogProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeTradeLog"; value: Uint8Array; @@ -1803,10 +1569,6 @@ export interface SubaccountPosition { position?: Position; subaccountId: Uint8Array; } -export interface ReactiveSubaccountPosition { - position?: ComputedRef; - subaccountId: ComputedRef; -} export interface SubaccountPositionProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountPosition"; value: Uint8Array; @@ -1823,10 +1585,6 @@ export interface SubaccountDeposit { subaccountId: Uint8Array; deposit?: Deposit; } -export interface ReactiveSubaccountDeposit { - subaccountId: ComputedRef; - deposit?: ComputedRef; -} export interface SubaccountDepositProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountDeposit"; value: Uint8Array; @@ -1843,10 +1601,6 @@ export interface DepositUpdate { denom: string; deposits: SubaccountDeposit[]; } -export interface ReactiveDepositUpdate { - denom: ComputedRef; - deposits: ComputedRef; -} export interface DepositUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.DepositUpdate"; value: Uint8Array; @@ -1863,10 +1617,6 @@ export interface PointsMultiplier { makerPointsMultiplier: string; takerPointsMultiplier: string; } -export interface ReactivePointsMultiplier { - makerPointsMultiplier: ComputedRef; - takerPointsMultiplier: ComputedRef; -} export interface PointsMultiplierProtoMsg { typeUrl: "/injective.exchange.v1beta1.PointsMultiplier"; value: Uint8Array; @@ -1885,12 +1635,6 @@ export interface TradingRewardCampaignBoostInfo { boostedDerivativeMarketIds: string[]; derivativeMarketMultipliers: PointsMultiplier[]; } -export interface ReactiveTradingRewardCampaignBoostInfo { - boostedSpotMarketIds: ComputedRef; - spotMarketMultipliers: ComputedRef; - boostedDerivativeMarketIds: ComputedRef; - derivativeMarketMultipliers: ComputedRef; -} export interface TradingRewardCampaignBoostInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo"; value: Uint8Array; @@ -1913,10 +1657,6 @@ export interface CampaignRewardPool { */ maxCampaignRewards: Coin[]; } -export interface ReactiveCampaignRewardPool { - startTimestamp: ComputedRef; - maxCampaignRewards: ComputedRef; -} export interface CampaignRewardPoolProtoMsg { typeUrl: "/injective.exchange.v1beta1.CampaignRewardPool"; value: Uint8Array; @@ -1943,12 +1683,6 @@ export interface TradingRewardCampaignInfo { /** the marketIDs which are disqualified from being rewarded */ disqualifiedMarketIds: string[]; } -export interface ReactiveTradingRewardCampaignInfo { - campaignDurationSeconds: ComputedRef; - quoteDenoms: ComputedRef; - tradingRewardBoostInfo?: ComputedRef; - disqualifiedMarketIds: ComputedRef; -} export interface TradingRewardCampaignInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignInfo"; value: Uint8Array; @@ -1973,12 +1707,6 @@ export interface FeeDiscountTierInfo { stakedAmount: string; volume: string; } -export interface ReactiveFeeDiscountTierInfo { - makerDiscountRate: ComputedRef; - takerDiscountRate: ComputedRef; - stakedAmount: ComputedRef; - volume: ComputedRef; -} export interface FeeDiscountTierInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierInfo"; value: Uint8Array; @@ -2009,13 +1737,6 @@ export interface FeeDiscountSchedule { */ disqualifiedMarketIds: string[]; } -export interface ReactiveFeeDiscountSchedule { - bucketCount: ComputedRef; - bucketDuration: ComputedRef; - quoteDenoms: ComputedRef; - tierInfos: ComputedRef; - disqualifiedMarketIds: ComputedRef; -} export interface FeeDiscountScheduleProtoMsg { typeUrl: "/injective.exchange.v1beta1.FeeDiscountSchedule"; value: Uint8Array; @@ -2044,10 +1765,6 @@ export interface FeeDiscountTierTTL { tier: bigint; ttlTimestamp: bigint; } -export interface ReactiveFeeDiscountTierTTL { - tier: ComputedRef; - ttlTimestamp: ComputedRef; -} export interface FeeDiscountTierTTLProtoMsg { typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierTTL"; value: Uint8Array; @@ -2064,10 +1781,6 @@ export interface VolumeRecord { makerVolume: string; takerVolume: string; } -export interface ReactiveVolumeRecord { - makerVolume: ComputedRef; - takerVolume: ComputedRef; -} export interface VolumeRecordProtoMsg { typeUrl: "/injective.exchange.v1beta1.VolumeRecord"; value: Uint8Array; @@ -2084,10 +1797,6 @@ export interface AccountRewards { account: string; rewards: Coin[]; } -export interface ReactiveAccountRewards { - account: ComputedRef; - rewards: ComputedRef; -} export interface AccountRewardsProtoMsg { typeUrl: "/injective.exchange.v1beta1.AccountRewards"; value: Uint8Array; @@ -2104,10 +1813,6 @@ export interface TradeRecords { marketId: string; latestTradeRecords: TradeRecord[]; } -export interface ReactiveTradeRecords { - marketId: ComputedRef; - latestTradeRecords: ComputedRef; -} export interface TradeRecordsProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradeRecords"; value: Uint8Array; @@ -2123,9 +1828,6 @@ export interface TradeRecordsAminoMsg { export interface SubaccountIDs { subaccountIds: Uint8Array[]; } -export interface ReactiveSubaccountIDs { - subaccountIds: ComputedRef; -} export interface SubaccountIDsProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountIDs"; value: Uint8Array; @@ -2142,11 +1844,6 @@ export interface TradeRecord { price: string; quantity: string; } -export interface ReactiveTradeRecord { - timestamp: ComputedRef; - price: ComputedRef; - quantity: ComputedRef; -} export interface TradeRecordProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradeRecord"; value: Uint8Array; @@ -2166,10 +1863,6 @@ export interface Level { /** quantity */ q: string; } -export interface ReactiveLevel { - p: ComputedRef; - q: ComputedRef; -} export interface LevelProtoMsg { typeUrl: "/injective.exchange.v1beta1.Level"; value: Uint8Array; @@ -2188,10 +1881,6 @@ export interface AggregateSubaccountVolumeRecord { subaccountId: string; marketVolumes: MarketVolume[]; } -export interface ReactiveAggregateSubaccountVolumeRecord { - subaccountId: ComputedRef; - marketVolumes: ComputedRef; -} export interface AggregateSubaccountVolumeRecordProtoMsg { typeUrl: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord"; value: Uint8Array; @@ -2208,10 +1897,6 @@ export interface AggregateAccountVolumeRecord { account: string; marketVolumes: MarketVolume[]; } -export interface ReactiveAggregateAccountVolumeRecord { - account: ComputedRef; - marketVolumes: ComputedRef; -} export interface AggregateAccountVolumeRecordProtoMsg { typeUrl: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord"; value: Uint8Array; @@ -2228,10 +1913,6 @@ export interface MarketVolume { marketId: string; volume: VolumeRecord; } -export interface ReactiveMarketVolume { - marketId: ComputedRef; - volume: ComputedRef; -} export interface MarketVolumeProtoMsg { typeUrl: "/injective.exchange.v1beta1.MarketVolume"; value: Uint8Array; @@ -2248,10 +1929,6 @@ export interface DenomDecimals { denom: string; decimals: bigint; } -export interface ReactiveDenomDecimals { - denom: ComputedRef; - decimals: ComputedRef; -} export interface DenomDecimalsProtoMsg { typeUrl: "/injective.exchange.v1beta1.DenomDecimals"; value: Uint8Array; @@ -2268,10 +1945,6 @@ export interface GrantAuthorization { grantee: string; amount: string; } -export interface ReactiveGrantAuthorization { - grantee: ComputedRef; - amount: ComputedRef; -} export interface GrantAuthorizationProtoMsg { typeUrl: "/injective.exchange.v1beta1.GrantAuthorization"; value: Uint8Array; @@ -2288,10 +1961,6 @@ export interface ActiveGrant { granter: string; amount: string; } -export interface ReactiveActiveGrant { - granter: ComputedRef; - amount: ComputedRef; -} export interface ActiveGrantProtoMsg { typeUrl: "/injective.exchange.v1beta1.ActiveGrant"; value: Uint8Array; @@ -2309,11 +1978,6 @@ export interface EffectiveGrant { netGrantedStake: string; isValid: boolean; } -export interface ReactiveEffectiveGrant { - granter: ComputedRef; - netGrantedStake: ComputedRef; - isValid: ComputedRef; -} export interface EffectiveGrantProtoMsg { typeUrl: "/injective.exchange.v1beta1.EffectiveGrant"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/genesis.ts b/libs/injective-vue/src/injective/exchange/v1beta1/genesis.ts index 1fe25185..14b27626 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/genesis.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino, SpotMarket, SpotMarketAmino, DerivativeMarket, Der import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the exchange module's genesis state. */ export interface GenesisState { /** params defines all the parameters of related to exchange. */ @@ -93,44 +92,6 @@ export interface GenesisState { grantAuthorizations: FullGrantAuthorizations[]; activeGrants: FullActiveGrant[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - spotMarkets: ComputedRef; - derivativeMarkets: ComputedRef; - spotOrderbook: ComputedRef; - derivativeOrderbook: ComputedRef; - balances: ComputedRef; - positions: ComputedRef; - subaccountTradeNonces: ComputedRef; - expiryFuturesMarketInfoState: ComputedRef; - perpetualMarketInfo: ComputedRef; - perpetualMarketFundingState: ComputedRef; - derivativeMarketSettlementScheduled: ComputedRef; - isSpotExchangeEnabled: ComputedRef; - isDerivativesExchangeEnabled: ComputedRef; - tradingRewardCampaignInfo?: ComputedRef; - tradingRewardPoolCampaignSchedule: ComputedRef; - tradingRewardCampaignAccountPoints: ComputedRef; - feeDiscountSchedule?: ComputedRef; - feeDiscountAccountTierTtl: ComputedRef; - feeDiscountBucketVolumeAccounts: ComputedRef; - isFirstFeeCycleFinished: ComputedRef; - pendingTradingRewardPoolCampaignSchedule: ComputedRef; - pendingTradingRewardCampaignAccountPoints: ComputedRef; - rewardsOptOutAddresses: ComputedRef; - historicalTradeRecords: ComputedRef; - binaryOptionsMarkets: ComputedRef; - binaryOptionsMarketIdsScheduledForSettlement: ComputedRef; - spotMarketIdsScheduledToForceClose: ComputedRef; - denomDecimals: ComputedRef; - conditionalDerivativeOrderbooks: ComputedRef; - marketFeeMultipliers: ComputedRef; - orderbookSequences: ComputedRef; - subaccountVolumes: ComputedRef; - marketVolumes: ComputedRef; - grantAuthorizations: ComputedRef; - activeGrants: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.exchange.v1beta1.GenesisState"; value: Uint8Array; @@ -233,10 +194,6 @@ export interface OrderbookSequence { sequence: bigint; marketId: string; } -export interface ReactiveOrderbookSequence { - sequence: ComputedRef; - marketId: ComputedRef; -} export interface OrderbookSequenceProtoMsg { typeUrl: "/injective.exchange.v1beta1.OrderbookSequence"; value: Uint8Array; @@ -253,10 +210,6 @@ export interface FeeDiscountAccountTierTTL { account: string; tierTtl?: FeeDiscountTierTTL; } -export interface ReactiveFeeDiscountAccountTierTTL { - account: ComputedRef; - tierTtl?: ComputedRef; -} export interface FeeDiscountAccountTierTTLProtoMsg { typeUrl: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL"; value: Uint8Array; @@ -273,10 +226,6 @@ export interface FeeDiscountBucketVolumeAccounts { bucketStartTimestamp: bigint; accountVolume: AccountVolume[]; } -export interface ReactiveFeeDiscountBucketVolumeAccounts { - bucketStartTimestamp: ComputedRef; - accountVolume: ComputedRef; -} export interface FeeDiscountBucketVolumeAccountsProtoMsg { typeUrl: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts"; value: Uint8Array; @@ -293,10 +242,6 @@ export interface AccountVolume { account: string; volume: string; } -export interface ReactiveAccountVolume { - account: ComputedRef; - volume: ComputedRef; -} export interface AccountVolumeProtoMsg { typeUrl: "/injective.exchange.v1beta1.AccountVolume"; value: Uint8Array; @@ -313,10 +258,6 @@ export interface TradingRewardCampaignAccountPoints { account: string; points: string; } -export interface ReactiveTradingRewardCampaignAccountPoints { - account: ComputedRef; - points: ComputedRef; -} export interface TradingRewardCampaignAccountPointsProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints"; value: Uint8Array; @@ -333,10 +274,6 @@ export interface TradingRewardCampaignAccountPendingPoints { rewardPoolStartTimestamp: bigint; accountPoints: TradingRewardCampaignAccountPoints[]; } -export interface ReactiveTradingRewardCampaignAccountPendingPoints { - rewardPoolStartTimestamp: ComputedRef; - accountPoints: ComputedRef; -} export interface TradingRewardCampaignAccountPendingPointsProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints"; value: Uint8Array; @@ -355,11 +292,6 @@ export interface SpotOrderBook { isBuySide: boolean; orders: SpotLimitOrder[]; } -export interface ReactiveSpotOrderBook { - marketId: ComputedRef; - isBuySide: ComputedRef; - orders: ComputedRef; -} export interface SpotOrderBookProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotOrderBook"; value: Uint8Array; @@ -380,11 +312,6 @@ export interface DerivativeOrderBook { isBuySide: boolean; orders: DerivativeLimitOrder[]; } -export interface ReactiveDerivativeOrderBook { - marketId: ComputedRef; - isBuySide: ComputedRef; - orders: ComputedRef; -} export interface DerivativeOrderBookProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeOrderBook"; value: Uint8Array; @@ -407,13 +334,6 @@ export interface ConditionalDerivativeOrderBook { limitSellOrders: DerivativeLimitOrder[]; marketSellOrders: DerivativeMarketOrder[]; } -export interface ReactiveConditionalDerivativeOrderBook { - marketId: ComputedRef; - limitBuyOrders: ComputedRef; - marketBuyOrders: ComputedRef; - limitSellOrders: ComputedRef; - marketSellOrders: ComputedRef; -} export interface ConditionalDerivativeOrderBookProtoMsg { typeUrl: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook"; value: Uint8Array; @@ -435,11 +355,6 @@ export interface Balance { denom: string; deposits?: Deposit; } -export interface ReactiveBalance { - subaccountId: ComputedRef; - denom: ComputedRef; - deposits?: ComputedRef; -} export interface BalanceProtoMsg { typeUrl: "/injective.exchange.v1beta1.Balance"; value: Uint8Array; @@ -458,11 +373,6 @@ export interface DerivativePosition { marketId: string; position?: Position; } -export interface ReactiveDerivativePosition { - subaccountId: ComputedRef; - marketId: ComputedRef; - position?: ComputedRef; -} export interface DerivativePositionProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativePosition"; value: Uint8Array; @@ -480,10 +390,6 @@ export interface SubaccountNonce { subaccountId: string; subaccountTradeNonce: SubaccountTradeNonce; } -export interface ReactiveSubaccountNonce { - subaccountId: ComputedRef; - subaccountTradeNonce: ComputedRef; -} export interface SubaccountNonceProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountNonce"; value: Uint8Array; @@ -500,10 +406,6 @@ export interface ExpiryFuturesMarketInfoState { marketId: string; marketInfo?: ExpiryFuturesMarketInfo; } -export interface ReactiveExpiryFuturesMarketInfoState { - marketId: ComputedRef; - marketInfo?: ComputedRef; -} export interface ExpiryFuturesMarketInfoStateProtoMsg { typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState"; value: Uint8Array; @@ -520,10 +422,6 @@ export interface PerpetualMarketFundingState { marketId: string; funding?: PerpetualMarketFunding; } -export interface ReactivePerpetualMarketFundingState { - marketId: ComputedRef; - funding?: ComputedRef; -} export interface PerpetualMarketFundingStateProtoMsg { typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFundingState"; value: Uint8Array; @@ -542,12 +440,6 @@ export interface FullGrantAuthorizations { lastDelegationsCheckedTime: bigint; grants: GrantAuthorization[]; } -export interface ReactiveFullGrantAuthorizations { - granter: ComputedRef; - totalGrantAmount: ComputedRef; - lastDelegationsCheckedTime: ComputedRef; - grants: ComputedRef; -} export interface FullGrantAuthorizationsProtoMsg { typeUrl: "/injective.exchange.v1beta1.FullGrantAuthorizations"; value: Uint8Array; @@ -566,10 +458,6 @@ export interface FullActiveGrant { grantee: string; activeGrant?: ActiveGrant; } -export interface ReactiveFullActiveGrant { - grantee: ComputedRef; - activeGrant?: ComputedRef; -} export interface FullActiveGrantProtoMsg { typeUrl: "/injective.exchange.v1beta1.FullActiveGrant"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/proposal.ts b/libs/injective-vue/src/injective/exchange/v1beta1/proposal.ts index db8c5db2..320d2ad9 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/proposal.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/proposal.ts @@ -4,7 +4,6 @@ import { CommunityPoolSpendProposal, CommunityPoolSpendProposalAmino } from "../ import { isSet, DeepPartial } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export enum ExchangeType { EXCHANGE_UNSPECIFIED = 0, SPOT = 1, @@ -74,20 +73,6 @@ export interface SpotMarketParamUpdateProposal { minNotional?: string; adminInfo?: AdminInfo; } -export interface ReactiveSpotMarketParamUpdateProposal { - title: ComputedRef; - description: ComputedRef; - marketId: ComputedRef; - makerFeeRate?: ComputedRef; - takerFeeRate?: ComputedRef; - relayerFeeShareRate?: ComputedRef; - minPriceTickSize?: ComputedRef; - minQuantityTickSize?: ComputedRef; - status: ComputedRef; - ticker?: ComputedRef; - minNotional?: ComputedRef; - adminInfo?: ComputedRef; -} export interface SpotMarketParamUpdateProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotMarketParamUpdateProposal"; value: Uint8Array; @@ -133,11 +118,6 @@ export interface ExchangeEnableProposal { description: string; exchangeType: ExchangeType; } -export interface ReactiveExchangeEnableProposal { - title: ComputedRef; - description: ComputedRef; - exchangeType: ComputedRef; -} export interface ExchangeEnableProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.ExchangeEnableProposal"; value: Uint8Array; @@ -166,21 +146,6 @@ export interface BatchExchangeModificationProposal { feeDiscountProposal?: FeeDiscountProposal; marketForcedSettlementProposals: MarketForcedSettlementProposal[]; } -export interface ReactiveBatchExchangeModificationProposal { - title: ComputedRef; - description: ComputedRef; - spotMarketParamUpdateProposals: ComputedRef; - derivativeMarketParamUpdateProposals: ComputedRef; - spotMarketLaunchProposals: ComputedRef; - perpetualMarketLaunchProposals: ComputedRef; - expiryFuturesMarketLaunchProposals: ComputedRef; - tradingRewardCampaignUpdateProposal?: ComputedRef; - binaryOptionsMarketLaunchProposals: ComputedRef; - binaryOptionsParamUpdateProposals: ComputedRef; - denomDecimalsUpdateProposal?: ComputedRef; - feeDiscountProposal?: ComputedRef; - marketForcedSettlementProposals: ComputedRef; -} export interface BatchExchangeModificationProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.BatchExchangeModificationProposal"; value: Uint8Array; @@ -232,19 +197,6 @@ export interface SpotMarketLaunchProposal { minNotional: string; adminInfo?: AdminInfo; } -export interface ReactiveSpotMarketLaunchProposal { - title: ComputedRef; - description: ComputedRef; - ticker: ComputedRef; - baseDenom: ComputedRef; - quoteDenom: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - makerFeeRate?: ComputedRef; - takerFeeRate?: ComputedRef; - minNotional: ComputedRef; - adminInfo?: ComputedRef; -} export interface SpotMarketLaunchProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotMarketLaunchProposal"; value: Uint8Array; @@ -337,24 +289,6 @@ export interface PerpetualMarketLaunchProposal { minNotional: string; adminInfo?: AdminInfo; } -export interface ReactivePerpetualMarketLaunchProposal { - title: ComputedRef; - description: ComputedRef; - ticker: ComputedRef; - quoteDenom: ComputedRef; - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleScaleFactor: ComputedRef; - oracleType: ComputedRef; - initialMarginRatio: ComputedRef; - maintenanceMarginRatio: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; - adminInfo?: ComputedRef; -} export interface PerpetualMarketLaunchProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.PerpetualMarketLaunchProposal"; value: Uint8Array; @@ -461,25 +395,6 @@ export interface BinaryOptionsMarketLaunchProposal { minNotional: string; adminPermissions: number; } -export interface ReactiveBinaryOptionsMarketLaunchProposal { - title: ComputedRef; - description: ComputedRef; - ticker: ComputedRef; - oracleSymbol: ComputedRef; - oracleProvider: ComputedRef; - oracleType: ComputedRef; - oracleScaleFactor: ComputedRef; - expirationTimestamp: ComputedRef; - settlementTimestamp: ComputedRef; - admin: ComputedRef; - quoteDenom: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; - adminPermissions: ComputedRef; -} export interface BinaryOptionsMarketLaunchProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketLaunchProposal"; value: Uint8Array; @@ -588,25 +503,6 @@ export interface ExpiryFuturesMarketLaunchProposal { minNotional: string; adminInfo?: AdminInfo; } -export interface ReactiveExpiryFuturesMarketLaunchProposal { - title: ComputedRef; - description: ComputedRef; - ticker: ComputedRef; - quoteDenom: ComputedRef; - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleScaleFactor: ComputedRef; - oracleType: ComputedRef; - expiry: ComputedRef; - initialMarginRatio: ComputedRef; - maintenanceMarginRatio: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; - adminInfo?: ComputedRef; -} export interface ExpiryFuturesMarketLaunchProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal"; value: Uint8Array; @@ -729,25 +625,6 @@ export interface DerivativeMarketParamUpdateProposal { minNotional?: string; adminInfo?: AdminInfo; } -export interface ReactiveDerivativeMarketParamUpdateProposal { - title: ComputedRef; - description: ComputedRef; - marketId: ComputedRef; - initialMarginRatio?: ComputedRef; - maintenanceMarginRatio?: ComputedRef; - makerFeeRate?: ComputedRef; - takerFeeRate?: ComputedRef; - relayerFeeShareRate?: ComputedRef; - minPriceTickSize?: ComputedRef; - minQuantityTickSize?: ComputedRef; - hourlyInterestRate?: ComputedRef; - hourlyFundingRateCap?: ComputedRef; - status: ComputedRef; - oracleParams?: ComputedRef; - ticker?: ComputedRef; - minNotional?: ComputedRef; - adminInfo?: ComputedRef; -} export interface DerivativeMarketParamUpdateProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal"; value: Uint8Array; @@ -816,10 +693,6 @@ export interface AdminInfo { admin: string; adminPermissions: number; } -export interface ReactiveAdminInfo { - admin: ComputedRef; - adminPermissions: ComputedRef; -} export interface AdminInfoProtoMsg { typeUrl: "/injective.exchange.v1beta1.AdminInfo"; value: Uint8Array; @@ -838,12 +711,6 @@ export interface MarketForcedSettlementProposal { marketId: string; settlementPrice?: string; } -export interface ReactiveMarketForcedSettlementProposal { - title: ComputedRef; - description: ComputedRef; - marketId: ComputedRef; - settlementPrice?: ComputedRef; -} export interface MarketForcedSettlementProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.MarketForcedSettlementProposal"; value: Uint8Array; @@ -863,11 +730,6 @@ export interface UpdateDenomDecimalsProposal { description: string; denomDecimals: DenomDecimals[]; } -export interface ReactiveUpdateDenomDecimalsProposal { - title: ComputedRef; - description: ComputedRef; - denomDecimals: ComputedRef; -} export interface UpdateDenomDecimalsProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.UpdateDenomDecimalsProposal"; value: Uint8Array; @@ -927,24 +789,6 @@ export interface BinaryOptionsMarketParamUpdateProposal { */ minNotional?: string; } -export interface ReactiveBinaryOptionsMarketParamUpdateProposal { - title: ComputedRef; - description: ComputedRef; - marketId: ComputedRef; - makerFeeRate?: ComputedRef; - takerFeeRate?: ComputedRef; - relayerFeeShareRate?: ComputedRef; - minPriceTickSize?: ComputedRef; - minQuantityTickSize?: ComputedRef; - expirationTimestamp: ComputedRef; - settlementTimestamp: ComputedRef; - settlementPrice?: ComputedRef; - admin: ComputedRef; - status: ComputedRef; - oracleParams?: ComputedRef; - ticker?: ComputedRef; - minNotional?: ComputedRef; -} export interface BinaryOptionsMarketParamUpdateProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketParamUpdateProposal"; value: Uint8Array; @@ -1009,12 +853,6 @@ export interface ProviderOracleParams { /** Oracle type */ oracleType: OracleType; } -export interface ReactiveProviderOracleParams { - symbol: ComputedRef; - provider: ComputedRef; - oracleScaleFactor: ComputedRef; - oracleType: ComputedRef; -} export interface ProviderOracleParamsProtoMsg { typeUrl: "/injective.exchange.v1beta1.ProviderOracleParams"; value: Uint8Array; @@ -1043,12 +881,6 @@ export interface OracleParams { /** Oracle type */ oracleType: OracleType; } -export interface ReactiveOracleParams { - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleScaleFactor: ComputedRef; - oracleType: ComputedRef; -} export interface OracleParamsProtoMsg { typeUrl: "/injective.exchange.v1beta1.OracleParams"; value: Uint8Array; @@ -1073,12 +905,6 @@ export interface TradingRewardCampaignLaunchProposal { campaignInfo?: TradingRewardCampaignInfo; campaignRewardPools: CampaignRewardPool[]; } -export interface ReactiveTradingRewardCampaignLaunchProposal { - title: ComputedRef; - description: ComputedRef; - campaignInfo?: ComputedRef; - campaignRewardPools: ComputedRef; -} export interface TradingRewardCampaignLaunchProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignLaunchProposal"; value: Uint8Array; @@ -1100,13 +926,6 @@ export interface TradingRewardCampaignUpdateProposal { campaignRewardPoolsAdditions: CampaignRewardPool[]; campaignRewardPoolsUpdates: CampaignRewardPool[]; } -export interface ReactiveTradingRewardCampaignUpdateProposal { - title: ComputedRef; - description: ComputedRef; - campaignInfo?: ComputedRef; - campaignRewardPoolsAdditions: ComputedRef; - campaignRewardPoolsUpdates: ComputedRef; -} export interface TradingRewardCampaignUpdateProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignUpdateProposal"; value: Uint8Array; @@ -1127,10 +946,6 @@ export interface RewardPointUpdate { /** new_points overwrites the current trading reward points for the account */ newPoints: string; } -export interface ReactiveRewardPointUpdate { - accountAddress: ComputedRef; - newPoints: ComputedRef; -} export interface RewardPointUpdateProtoMsg { typeUrl: "/injective.exchange.v1beta1.RewardPointUpdate"; value: Uint8Array; @@ -1150,12 +965,6 @@ export interface TradingRewardPendingPointsUpdateProposal { pendingPoolTimestamp: bigint; rewardPointUpdates: RewardPointUpdate[]; } -export interface ReactiveTradingRewardPendingPointsUpdateProposal { - title: ComputedRef; - description: ComputedRef; - pendingPoolTimestamp: ComputedRef; - rewardPointUpdates: ComputedRef; -} export interface TradingRewardPendingPointsUpdateProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradingRewardPendingPointsUpdateProposal"; value: Uint8Array; @@ -1175,11 +984,6 @@ export interface FeeDiscountProposal { description: string; schedule?: FeeDiscountSchedule; } -export interface ReactiveFeeDiscountProposal { - title: ComputedRef; - description: ComputedRef; - schedule?: ComputedRef; -} export interface FeeDiscountProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.FeeDiscountProposal"; value: Uint8Array; @@ -1198,11 +1002,6 @@ export interface BatchCommunityPoolSpendProposal { description: string; proposals: CommunityPoolSpendProposal[]; } -export interface ReactiveBatchCommunityPoolSpendProposal { - title: ComputedRef; - description: ComputedRef; - proposals: ComputedRef; -} export interface BatchCommunityPoolSpendProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.BatchCommunityPoolSpendProposal"; value: Uint8Array; @@ -1225,11 +1024,6 @@ export interface AtomicMarketOrderFeeMultiplierScheduleProposal { description: string; marketFeeMultipliers: MarketFeeMultiplier[]; } -export interface ReactiveAtomicMarketOrderFeeMultiplierScheduleProposal { - title: ComputedRef; - description: ComputedRef; - marketFeeMultipliers: ComputedRef; -} export interface AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg { typeUrl: "/injective.exchange.v1beta1.AtomicMarketOrderFeeMultiplierScheduleProposal"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 8cc92511..00000000 --- a/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,2479 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse, ReactiveQueryExchangeParamsRequest, ReactiveQuerySubaccountDepositsRequest, ReactiveQuerySubaccountDepositRequest, ReactiveQueryExchangeBalancesRequest, ReactiveQueryAggregateVolumeRequest, ReactiveQueryAggregateVolumesRequest, ReactiveQueryAggregateMarketVolumeRequest, ReactiveQueryAggregateMarketVolumesRequest, ReactiveQueryDenomDecimalRequest, ReactiveQueryDenomDecimalsRequest, ReactiveQuerySpotMarketsRequest, ReactiveQuerySpotMarketRequest, ReactiveQueryFullSpotMarketsRequest, ReactiveQueryFullSpotMarketRequest, ReactiveQuerySpotOrderbookRequest, ReactiveQueryTraderSpotOrdersRequest, ReactiveQueryAccountAddressSpotOrdersRequest, ReactiveQuerySpotOrdersByHashesRequest, ReactiveQuerySubaccountOrdersRequest, ReactiveQuerySpotMidPriceAndTOBRequest, ReactiveQueryDerivativeMidPriceAndTOBRequest, ReactiveQueryDerivativeOrderbookRequest, ReactiveQueryTraderDerivativeOrdersRequest, ReactiveQueryAccountAddressDerivativeOrdersRequest, ReactiveQueryDerivativeOrdersByHashesRequest, ReactiveQueryDerivativeMarketsRequest, ReactiveQueryDerivativeMarketRequest, ReactiveQueryDerivativeMarketAddressRequest, ReactiveQuerySubaccountTradeNonceRequest, ReactiveQueryModuleStateRequest, ReactiveQueryPositionsRequest, ReactiveQuerySubaccountPositionsRequest, ReactiveQuerySubaccountPositionInMarketRequest, ReactiveQuerySubaccountEffectivePositionInMarketRequest, ReactiveQueryPerpetualMarketInfoRequest, ReactiveQueryExpiryFuturesMarketInfoRequest, ReactiveQueryPerpetualMarketFundingRequest, ReactiveQuerySubaccountOrderMetadataRequest, ReactiveQueryTradeRewardPointsRequest, ReactiveQueryTradeRewardCampaignRequest, ReactiveQueryFeeDiscountAccountInfoRequest, ReactiveQueryFeeDiscountScheduleRequest, ReactiveQueryBalanceMismatchesRequest, ReactiveQueryBalanceWithBalanceHoldsRequest, ReactiveQueryFeeDiscountTierStatisticsRequest, ReactiveQueryMarketIDFromVaultRequest, ReactiveQueryHistoricalTradeRecordsRequest, ReactiveQueryIsOptedOutOfRewardsRequest, ReactiveQueryOptedOutOfRewardsAccountsRequest, ReactiveQueryMarketVolatilityRequest, ReactiveQueryBinaryMarketsRequest, ReactiveQueryTraderDerivativeConditionalOrdersRequest, ReactiveQueryMarketAtomicExecutionFeeMultiplierRequest, ReactiveQueryActiveStakeGrantRequest, ReactiveQueryGrantAuthorizationRequest, ReactiveQueryGrantAuthorizationsRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Retrieves exchange params */ - queryExchangeParams(request?: QueryExchangeParamsRequest): Promise; - /** Retrieves a Subaccount's Deposits */ - subaccountDeposits(request: QuerySubaccountDepositsRequest): Promise; - /** Retrieves a Subaccount's Deposits */ - subaccountDeposit(request: QuerySubaccountDepositRequest): Promise; - /** Retrieves all of the balances of all users on the exchange. */ - exchangeBalances(request?: QueryExchangeBalancesRequest): Promise; - /** Retrieves the aggregate volumes for the specified account or subaccount */ - aggregateVolume(request: QueryAggregateVolumeRequest): Promise; - /** Retrieves the aggregate volumes for specified accounts */ - aggregateVolumes(request: QueryAggregateVolumesRequest): Promise; - /** Retrieves the aggregate volume for the specified market */ - aggregateMarketVolume(request: QueryAggregateMarketVolumeRequest): Promise; - /** Retrieves the aggregate market volumes for specified markets */ - aggregateMarketVolumes(request: QueryAggregateMarketVolumesRequest): Promise; - /** Retrieves the denom decimals for a denom. */ - denomDecimal(request: QueryDenomDecimalRequest): Promise; - /** - * Retrieves the denom decimals for multiple denoms. Returns all denom - * decimals if unspecified. - */ - denomDecimals(request: QueryDenomDecimalsRequest): Promise; - /** Retrieves a list of spot markets. */ - spotMarkets(request: QuerySpotMarketsRequest): Promise; - /** Retrieves a spot market by ticker */ - spotMarket(request: QuerySpotMarketRequest): Promise; - /** Retrieves a list of spot markets with extra information. */ - fullSpotMarkets(request: QueryFullSpotMarketsRequest): Promise; - /** Retrieves a spot market with extra information. */ - fullSpotMarket(request: QueryFullSpotMarketRequest): Promise; - /** Retrieves a spot market's orderbook by marketID */ - spotOrderbook(request: QuerySpotOrderbookRequest): Promise; - /** Retrieves a trader's spot orders */ - traderSpotOrders(request: QueryTraderSpotOrdersRequest): Promise; - /** Retrieves all account address spot orders */ - accountAddressSpotOrders(request: QueryAccountAddressSpotOrdersRequest): Promise; - /** - * Retrieves spot orders corresponding to specified order hashes for a given - * subaccountID and marketID - */ - spotOrdersByHashes(request: QuerySpotOrdersByHashesRequest): Promise; - /** Retrieves subaccount's orders */ - subaccountOrders(request: QuerySubaccountOrdersRequest): Promise; - /** Retrieves a trader's transient spot orders */ - traderSpotTransientOrders(request: QueryTraderSpotOrdersRequest): Promise; - /** Retrieves a spot market's mid-price */ - spotMidPriceAndTOB(request: QuerySpotMidPriceAndTOBRequest): Promise; - /** Retrieves a derivative market's mid-price */ - derivativeMidPriceAndTOB(request: QueryDerivativeMidPriceAndTOBRequest): Promise; - /** Retrieves a derivative market's orderbook by marketID */ - derivativeOrderbook(request: QueryDerivativeOrderbookRequest): Promise; - /** Retrieves a trader's derivative orders */ - traderDerivativeOrders(request: QueryTraderDerivativeOrdersRequest): Promise; - /** Retrieves all account address derivative orders */ - accountAddressDerivativeOrders(request: QueryAccountAddressDerivativeOrdersRequest): Promise; - /** Retrieves a trader's derivative orders */ - derivativeOrdersByHashes(request: QueryDerivativeOrdersByHashesRequest): Promise; - /** Retrieves a trader's transient derivative orders */ - traderDerivativeTransientOrders(request: QueryTraderDerivativeOrdersRequest): Promise; - /** Retrieves a list of derivative markets. */ - derivativeMarkets(request: QueryDerivativeMarketsRequest): Promise; - /** Retrieves a derivative market by ticker */ - derivativeMarket(request: QueryDerivativeMarketRequest): Promise; - /** - * Retrieves a derivative market's corresponding address for fees that - * contribute to the market's insurance fund - */ - derivativeMarketAddress(request: QueryDerivativeMarketAddressRequest): Promise; - /** Retrieves a subaccount's trade nonce */ - subaccountTradeNonce(request: QuerySubaccountTradeNonceRequest): Promise; - /** Retrieves the entire exchange module's state */ - exchangeModuleState(request?: QueryModuleStateRequest): Promise; - /** Retrieves the entire exchange module's positions */ - positions(request?: QueryPositionsRequest): Promise; - /** Retrieves subaccount's positions */ - subaccountPositions(request: QuerySubaccountPositionsRequest): Promise; - /** Retrieves subaccount's position in market */ - subaccountPositionInMarket(request: QuerySubaccountPositionInMarketRequest): Promise; - /** Retrieves subaccount's position in market */ - subaccountEffectivePositionInMarket(request: QuerySubaccountEffectivePositionInMarketRequest): Promise; - /** Retrieves perpetual market info */ - perpetualMarketInfo(request: QueryPerpetualMarketInfoRequest): Promise; - /** Retrieves expiry market info */ - expiryFuturesMarketInfo(request: QueryExpiryFuturesMarketInfoRequest): Promise; - /** Retrieves perpetual market funding */ - perpetualMarketFunding(request: QueryPerpetualMarketFundingRequest): Promise; - /** Retrieves subaccount's order metadata */ - subaccountOrderMetadata(request: QuerySubaccountOrderMetadataRequest): Promise; - /** Retrieves the account and total trade rewards points */ - tradeRewardPoints(request: QueryTradeRewardPointsRequest): Promise; - /** Retrieves the pending account and total trade rewards points */ - pendingTradeRewardPoints(request: QueryTradeRewardPointsRequest): Promise; - /** Retrieves the trade reward campaign */ - tradeRewardCampaign(request?: QueryTradeRewardCampaignRequest): Promise; - /** Retrieves the account's fee discount info */ - feeDiscountAccountInfo(request: QueryFeeDiscountAccountInfoRequest): Promise; - /** Retrieves the fee discount schedule */ - feeDiscountSchedule(request?: QueryFeeDiscountScheduleRequest): Promise; - /** Retrieves mismatches between available vs. total balance */ - balanceMismatches(request: QueryBalanceMismatchesRequest): Promise; - /** Retrieves available and total balances with balance holds */ - balanceWithBalanceHolds(request?: QueryBalanceWithBalanceHoldsRequest): Promise; - /** Retrieves fee discount tier stats */ - feeDiscountTierStatistics(request?: QueryFeeDiscountTierStatisticsRequest): Promise; - /** Retrieves market making pool info */ - mitoVaultInfos(request?: MitoVaultInfosRequest): Promise; - /** - * QueryMarketIDFromVault returns the market ID for a given vault subaccount - * ID - */ - queryMarketIDFromVault(request: QueryMarketIDFromVaultRequest): Promise; - /** Retrieves historical trade records for a given market ID */ - historicalTradeRecords(request: QueryHistoricalTradeRecordsRequest): Promise; - /** Retrieves if the account is opted out of rewards */ - isOptedOutOfRewards(request: QueryIsOptedOutOfRewardsRequest): Promise; - /** Retrieves all accounts opted out of rewards */ - optedOutOfRewardsAccounts(request?: QueryOptedOutOfRewardsAccountsRequest): Promise; - /** - * MarketVolatility computes the volatility for spot and derivative markets - * trading history. - */ - marketVolatility(request: QueryMarketVolatilityRequest): Promise; - /** Retrieves a spot market's orderbook by marketID */ - binaryOptionsMarkets(request: QueryBinaryMarketsRequest): Promise; - /** Retrieves a trader's derivative conditional orders */ - traderDerivativeConditionalOrders(request: QueryTraderDerivativeConditionalOrdersRequest): Promise; - marketAtomicExecutionFeeMultiplier(request: QueryMarketAtomicExecutionFeeMultiplierRequest): Promise; - /** Retrieves the active stake grant for a grantee */ - activeStakeGrant(request: QueryActiveStakeGrantRequest): Promise; - /** Retrieves the grant authorization amount for a granter and grantee */ - grantAuthorization(request: QueryGrantAuthorizationRequest): Promise; - /** Retrieves the grant authorization amount for a granter and grantee */ - grantAuthorizations(request: QueryGrantAuthorizationsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Retrieves exchange params */ - queryExchangeParams = async (request: QueryExchangeParamsRequest = {}): Promise => { - const data = QueryExchangeParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "QueryExchangeParams", data); - return promise.then(data => QueryExchangeParamsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a Subaccount's Deposits */ - subaccountDeposits = async (request: QuerySubaccountDepositsRequest): Promise => { - const data = QuerySubaccountDepositsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountDeposits", data); - return promise.then(data => QuerySubaccountDepositsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a Subaccount's Deposits */ - subaccountDeposit = async (request: QuerySubaccountDepositRequest): Promise => { - const data = QuerySubaccountDepositRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountDeposit", data); - return promise.then(data => QuerySubaccountDepositResponse.decode(new BinaryReader(data))); - }; - /* Retrieves all of the balances of all users on the exchange. */ - exchangeBalances = async (request: QueryExchangeBalancesRequest = {}): Promise => { - const data = QueryExchangeBalancesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "ExchangeBalances", data); - return promise.then(data => QueryExchangeBalancesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the aggregate volumes for the specified account or subaccount */ - aggregateVolume = async (request: QueryAggregateVolumeRequest): Promise => { - const data = QueryAggregateVolumeRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "AggregateVolume", data); - return promise.then(data => QueryAggregateVolumeResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the aggregate volumes for specified accounts */ - aggregateVolumes = async (request: QueryAggregateVolumesRequest): Promise => { - const data = QueryAggregateVolumesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "AggregateVolumes", data); - return promise.then(data => QueryAggregateVolumesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the aggregate volume for the specified market */ - aggregateMarketVolume = async (request: QueryAggregateMarketVolumeRequest): Promise => { - const data = QueryAggregateMarketVolumeRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "AggregateMarketVolume", data); - return promise.then(data => QueryAggregateMarketVolumeResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the aggregate market volumes for specified markets */ - aggregateMarketVolumes = async (request: QueryAggregateMarketVolumesRequest): Promise => { - const data = QueryAggregateMarketVolumesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "AggregateMarketVolumes", data); - return promise.then(data => QueryAggregateMarketVolumesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the denom decimals for a denom. */ - denomDecimal = async (request: QueryDenomDecimalRequest): Promise => { - const data = QueryDenomDecimalRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DenomDecimal", data); - return promise.then(data => QueryDenomDecimalResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the denom decimals for multiple denoms. Returns all denom - decimals if unspecified. */ - denomDecimals = async (request: QueryDenomDecimalsRequest): Promise => { - const data = QueryDenomDecimalsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DenomDecimals", data); - return promise.then(data => QueryDenomDecimalsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a list of spot markets. */ - spotMarkets = async (request: QuerySpotMarketsRequest): Promise => { - const data = QuerySpotMarketsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotMarkets", data); - return promise.then(data => QuerySpotMarketsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a spot market by ticker */ - spotMarket = async (request: QuerySpotMarketRequest): Promise => { - const data = QuerySpotMarketRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotMarket", data); - return promise.then(data => QuerySpotMarketResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a list of spot markets with extra information. */ - fullSpotMarkets = async (request: QueryFullSpotMarketsRequest): Promise => { - const data = QueryFullSpotMarketsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "FullSpotMarkets", data); - return promise.then(data => QueryFullSpotMarketsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a spot market with extra information. */ - fullSpotMarket = async (request: QueryFullSpotMarketRequest): Promise => { - const data = QueryFullSpotMarketRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "FullSpotMarket", data); - return promise.then(data => QueryFullSpotMarketResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a spot market's orderbook by marketID */ - spotOrderbook = async (request: QuerySpotOrderbookRequest): Promise => { - const data = QuerySpotOrderbookRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotOrderbook", data); - return promise.then(data => QuerySpotOrderbookResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a trader's spot orders */ - traderSpotOrders = async (request: QueryTraderSpotOrdersRequest): Promise => { - const data = QueryTraderSpotOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderSpotOrders", data); - return promise.then(data => QueryTraderSpotOrdersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves all account address spot orders */ - accountAddressSpotOrders = async (request: QueryAccountAddressSpotOrdersRequest): Promise => { - const data = QueryAccountAddressSpotOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "AccountAddressSpotOrders", data); - return promise.then(data => QueryAccountAddressSpotOrdersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves spot orders corresponding to specified order hashes for a given - subaccountID and marketID */ - spotOrdersByHashes = async (request: QuerySpotOrdersByHashesRequest): Promise => { - const data = QuerySpotOrdersByHashesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotOrdersByHashes", data); - return promise.then(data => QuerySpotOrdersByHashesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves subaccount's orders */ - subaccountOrders = async (request: QuerySubaccountOrdersRequest): Promise => { - const data = QuerySubaccountOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountOrders", data); - return promise.then(data => QuerySubaccountOrdersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a trader's transient spot orders */ - traderSpotTransientOrders = async (request: QueryTraderSpotOrdersRequest): Promise => { - const data = QueryTraderSpotOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderSpotTransientOrders", data); - return promise.then(data => QueryTraderSpotOrdersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a spot market's mid-price */ - spotMidPriceAndTOB = async (request: QuerySpotMidPriceAndTOBRequest): Promise => { - const data = QuerySpotMidPriceAndTOBRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotMidPriceAndTOB", data); - return promise.then(data => QuerySpotMidPriceAndTOBResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a derivative market's mid-price */ - derivativeMidPriceAndTOB = async (request: QueryDerivativeMidPriceAndTOBRequest): Promise => { - const data = QueryDerivativeMidPriceAndTOBRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMidPriceAndTOB", data); - return promise.then(data => QueryDerivativeMidPriceAndTOBResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a derivative market's orderbook by marketID */ - derivativeOrderbook = async (request: QueryDerivativeOrderbookRequest): Promise => { - const data = QueryDerivativeOrderbookRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeOrderbook", data); - return promise.then(data => QueryDerivativeOrderbookResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a trader's derivative orders */ - traderDerivativeOrders = async (request: QueryTraderDerivativeOrdersRequest): Promise => { - const data = QueryTraderDerivativeOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderDerivativeOrders", data); - return promise.then(data => QueryTraderDerivativeOrdersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves all account address derivative orders */ - accountAddressDerivativeOrders = async (request: QueryAccountAddressDerivativeOrdersRequest): Promise => { - const data = QueryAccountAddressDerivativeOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "AccountAddressDerivativeOrders", data); - return promise.then(data => QueryAccountAddressDerivativeOrdersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a trader's derivative orders */ - derivativeOrdersByHashes = async (request: QueryDerivativeOrdersByHashesRequest): Promise => { - const data = QueryDerivativeOrdersByHashesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeOrdersByHashes", data); - return promise.then(data => QueryDerivativeOrdersByHashesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a trader's transient derivative orders */ - traderDerivativeTransientOrders = async (request: QueryTraderDerivativeOrdersRequest): Promise => { - const data = QueryTraderDerivativeOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderDerivativeTransientOrders", data); - return promise.then(data => QueryTraderDerivativeOrdersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a list of derivative markets. */ - derivativeMarkets = async (request: QueryDerivativeMarketsRequest): Promise => { - const data = QueryDerivativeMarketsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMarkets", data); - return promise.then(data => QueryDerivativeMarketsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a derivative market by ticker */ - derivativeMarket = async (request: QueryDerivativeMarketRequest): Promise => { - const data = QueryDerivativeMarketRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMarket", data); - return promise.then(data => QueryDerivativeMarketResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a derivative market's corresponding address for fees that - contribute to the market's insurance fund */ - derivativeMarketAddress = async (request: QueryDerivativeMarketAddressRequest): Promise => { - const data = QueryDerivativeMarketAddressRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMarketAddress", data); - return promise.then(data => QueryDerivativeMarketAddressResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a subaccount's trade nonce */ - subaccountTradeNonce = async (request: QuerySubaccountTradeNonceRequest): Promise => { - const data = QuerySubaccountTradeNonceRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountTradeNonce", data); - return promise.then(data => QuerySubaccountTradeNonceResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire exchange module's state */ - exchangeModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "ExchangeModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire exchange module's positions */ - positions = async (request: QueryPositionsRequest = {}): Promise => { - const data = QueryPositionsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "Positions", data); - return promise.then(data => QueryPositionsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves subaccount's positions */ - subaccountPositions = async (request: QuerySubaccountPositionsRequest): Promise => { - const data = QuerySubaccountPositionsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountPositions", data); - return promise.then(data => QuerySubaccountPositionsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves subaccount's position in market */ - subaccountPositionInMarket = async (request: QuerySubaccountPositionInMarketRequest): Promise => { - const data = QuerySubaccountPositionInMarketRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountPositionInMarket", data); - return promise.then(data => QuerySubaccountPositionInMarketResponse.decode(new BinaryReader(data))); - }; - /* Retrieves subaccount's position in market */ - subaccountEffectivePositionInMarket = async (request: QuerySubaccountEffectivePositionInMarketRequest): Promise => { - const data = QuerySubaccountEffectivePositionInMarketRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountEffectivePositionInMarket", data); - return promise.then(data => QuerySubaccountEffectivePositionInMarketResponse.decode(new BinaryReader(data))); - }; - /* Retrieves perpetual market info */ - perpetualMarketInfo = async (request: QueryPerpetualMarketInfoRequest): Promise => { - const data = QueryPerpetualMarketInfoRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "PerpetualMarketInfo", data); - return promise.then(data => QueryPerpetualMarketInfoResponse.decode(new BinaryReader(data))); - }; - /* Retrieves expiry market info */ - expiryFuturesMarketInfo = async (request: QueryExpiryFuturesMarketInfoRequest): Promise => { - const data = QueryExpiryFuturesMarketInfoRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "ExpiryFuturesMarketInfo", data); - return promise.then(data => QueryExpiryFuturesMarketInfoResponse.decode(new BinaryReader(data))); - }; - /* Retrieves perpetual market funding */ - perpetualMarketFunding = async (request: QueryPerpetualMarketFundingRequest): Promise => { - const data = QueryPerpetualMarketFundingRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "PerpetualMarketFunding", data); - return promise.then(data => QueryPerpetualMarketFundingResponse.decode(new BinaryReader(data))); - }; - /* Retrieves subaccount's order metadata */ - subaccountOrderMetadata = async (request: QuerySubaccountOrderMetadataRequest): Promise => { - const data = QuerySubaccountOrderMetadataRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountOrderMetadata", data); - return promise.then(data => QuerySubaccountOrderMetadataResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the account and total trade rewards points */ - tradeRewardPoints = async (request: QueryTradeRewardPointsRequest): Promise => { - const data = QueryTradeRewardPointsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "TradeRewardPoints", data); - return promise.then(data => QueryTradeRewardPointsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the pending account and total trade rewards points */ - pendingTradeRewardPoints = async (request: QueryTradeRewardPointsRequest): Promise => { - const data = QueryTradeRewardPointsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "PendingTradeRewardPoints", data); - return promise.then(data => QueryTradeRewardPointsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the trade reward campaign */ - tradeRewardCampaign = async (request: QueryTradeRewardCampaignRequest = {}): Promise => { - const data = QueryTradeRewardCampaignRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "TradeRewardCampaign", data); - return promise.then(data => QueryTradeRewardCampaignResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the account's fee discount info */ - feeDiscountAccountInfo = async (request: QueryFeeDiscountAccountInfoRequest): Promise => { - const data = QueryFeeDiscountAccountInfoRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "FeeDiscountAccountInfo", data); - return promise.then(data => QueryFeeDiscountAccountInfoResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the fee discount schedule */ - feeDiscountSchedule = async (request: QueryFeeDiscountScheduleRequest = {}): Promise => { - const data = QueryFeeDiscountScheduleRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "FeeDiscountSchedule", data); - return promise.then(data => QueryFeeDiscountScheduleResponse.decode(new BinaryReader(data))); - }; - /* Retrieves mismatches between available vs. total balance */ - balanceMismatches = async (request: QueryBalanceMismatchesRequest): Promise => { - const data = QueryBalanceMismatchesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "BalanceMismatches", data); - return promise.then(data => QueryBalanceMismatchesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves available and total balances with balance holds */ - balanceWithBalanceHolds = async (request: QueryBalanceWithBalanceHoldsRequest = {}): Promise => { - const data = QueryBalanceWithBalanceHoldsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "BalanceWithBalanceHolds", data); - return promise.then(data => QueryBalanceWithBalanceHoldsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves fee discount tier stats */ - feeDiscountTierStatistics = async (request: QueryFeeDiscountTierStatisticsRequest = {}): Promise => { - const data = QueryFeeDiscountTierStatisticsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "FeeDiscountTierStatistics", data); - return promise.then(data => QueryFeeDiscountTierStatisticsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves market making pool info */ - mitoVaultInfos = async (request: MitoVaultInfosRequest = {}): Promise => { - const data = MitoVaultInfosRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "MitoVaultInfos", data); - return promise.then(data => MitoVaultInfosResponse.decode(new BinaryReader(data))); - }; - /* QueryMarketIDFromVault returns the market ID for a given vault subaccount - ID */ - queryMarketIDFromVault = async (request: QueryMarketIDFromVaultRequest): Promise => { - const data = QueryMarketIDFromVaultRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "QueryMarketIDFromVault", data); - return promise.then(data => QueryMarketIDFromVaultResponse.decode(new BinaryReader(data))); - }; - /* Retrieves historical trade records for a given market ID */ - historicalTradeRecords = async (request: QueryHistoricalTradeRecordsRequest): Promise => { - const data = QueryHistoricalTradeRecordsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "HistoricalTradeRecords", data); - return promise.then(data => QueryHistoricalTradeRecordsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves if the account is opted out of rewards */ - isOptedOutOfRewards = async (request: QueryIsOptedOutOfRewardsRequest): Promise => { - const data = QueryIsOptedOutOfRewardsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "IsOptedOutOfRewards", data); - return promise.then(data => QueryIsOptedOutOfRewardsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves all accounts opted out of rewards */ - optedOutOfRewardsAccounts = async (request: QueryOptedOutOfRewardsAccountsRequest = {}): Promise => { - const data = QueryOptedOutOfRewardsAccountsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "OptedOutOfRewardsAccounts", data); - return promise.then(data => QueryOptedOutOfRewardsAccountsResponse.decode(new BinaryReader(data))); - }; - /* MarketVolatility computes the volatility for spot and derivative markets - trading history. */ - marketVolatility = async (request: QueryMarketVolatilityRequest): Promise => { - const data = QueryMarketVolatilityRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "MarketVolatility", data); - return promise.then(data => QueryMarketVolatilityResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a spot market's orderbook by marketID */ - binaryOptionsMarkets = async (request: QueryBinaryMarketsRequest): Promise => { - const data = QueryBinaryMarketsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "BinaryOptionsMarkets", data); - return promise.then(data => QueryBinaryMarketsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves a trader's derivative conditional orders */ - traderDerivativeConditionalOrders = async (request: QueryTraderDerivativeConditionalOrdersRequest): Promise => { - const data = QueryTraderDerivativeConditionalOrdersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderDerivativeConditionalOrders", data); - return promise.then(data => QueryTraderDerivativeConditionalOrdersResponse.decode(new BinaryReader(data))); - }; - /* MarketAtomicExecutionFeeMultiplier */ - marketAtomicExecutionFeeMultiplier = async (request: QueryMarketAtomicExecutionFeeMultiplierRequest): Promise => { - const data = QueryMarketAtomicExecutionFeeMultiplierRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "MarketAtomicExecutionFeeMultiplier", data); - return promise.then(data => QueryMarketAtomicExecutionFeeMultiplierResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the active stake grant for a grantee */ - activeStakeGrant = async (request: QueryActiveStakeGrantRequest): Promise => { - const data = QueryActiveStakeGrantRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "ActiveStakeGrant", data); - return promise.then(data => QueryActiveStakeGrantResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the grant authorization amount for a granter and grantee */ - grantAuthorization = async (request: QueryGrantAuthorizationRequest): Promise => { - const data = QueryGrantAuthorizationRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "GrantAuthorization", data); - return promise.then(data => QueryGrantAuthorizationResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the grant authorization amount for a granter and grantee */ - grantAuthorizations = async (request: QueryGrantAuthorizationsRequest): Promise => { - const data = QueryGrantAuthorizationsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Query", "GrantAuthorizations", data); - return promise.then(data => QueryGrantAuthorizationsResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - queryExchangeParams(request?: QueryExchangeParamsRequest): Promise { - return queryService.queryExchangeParams(request); - }, - subaccountDeposits(request: QuerySubaccountDepositsRequest): Promise { - return queryService.subaccountDeposits(request); - }, - subaccountDeposit(request: QuerySubaccountDepositRequest): Promise { - return queryService.subaccountDeposit(request); - }, - exchangeBalances(request?: QueryExchangeBalancesRequest): Promise { - return queryService.exchangeBalances(request); - }, - aggregateVolume(request: QueryAggregateVolumeRequest): Promise { - return queryService.aggregateVolume(request); - }, - aggregateVolumes(request: QueryAggregateVolumesRequest): Promise { - return queryService.aggregateVolumes(request); - }, - aggregateMarketVolume(request: QueryAggregateMarketVolumeRequest): Promise { - return queryService.aggregateMarketVolume(request); - }, - aggregateMarketVolumes(request: QueryAggregateMarketVolumesRequest): Promise { - return queryService.aggregateMarketVolumes(request); - }, - denomDecimal(request: QueryDenomDecimalRequest): Promise { - return queryService.denomDecimal(request); - }, - denomDecimals(request: QueryDenomDecimalsRequest): Promise { - return queryService.denomDecimals(request); - }, - spotMarkets(request: QuerySpotMarketsRequest): Promise { - return queryService.spotMarkets(request); - }, - spotMarket(request: QuerySpotMarketRequest): Promise { - return queryService.spotMarket(request); - }, - fullSpotMarkets(request: QueryFullSpotMarketsRequest): Promise { - return queryService.fullSpotMarkets(request); - }, - fullSpotMarket(request: QueryFullSpotMarketRequest): Promise { - return queryService.fullSpotMarket(request); - }, - spotOrderbook(request: QuerySpotOrderbookRequest): Promise { - return queryService.spotOrderbook(request); - }, - traderSpotOrders(request: QueryTraderSpotOrdersRequest): Promise { - return queryService.traderSpotOrders(request); - }, - accountAddressSpotOrders(request: QueryAccountAddressSpotOrdersRequest): Promise { - return queryService.accountAddressSpotOrders(request); - }, - spotOrdersByHashes(request: QuerySpotOrdersByHashesRequest): Promise { - return queryService.spotOrdersByHashes(request); - }, - subaccountOrders(request: QuerySubaccountOrdersRequest): Promise { - return queryService.subaccountOrders(request); - }, - traderSpotTransientOrders(request: QueryTraderSpotOrdersRequest): Promise { - return queryService.traderSpotTransientOrders(request); - }, - spotMidPriceAndTOB(request: QuerySpotMidPriceAndTOBRequest): Promise { - return queryService.spotMidPriceAndTOB(request); - }, - derivativeMidPriceAndTOB(request: QueryDerivativeMidPriceAndTOBRequest): Promise { - return queryService.derivativeMidPriceAndTOB(request); - }, - derivativeOrderbook(request: QueryDerivativeOrderbookRequest): Promise { - return queryService.derivativeOrderbook(request); - }, - traderDerivativeOrders(request: QueryTraderDerivativeOrdersRequest): Promise { - return queryService.traderDerivativeOrders(request); - }, - accountAddressDerivativeOrders(request: QueryAccountAddressDerivativeOrdersRequest): Promise { - return queryService.accountAddressDerivativeOrders(request); - }, - derivativeOrdersByHashes(request: QueryDerivativeOrdersByHashesRequest): Promise { - return queryService.derivativeOrdersByHashes(request); - }, - traderDerivativeTransientOrders(request: QueryTraderDerivativeOrdersRequest): Promise { - return queryService.traderDerivativeTransientOrders(request); - }, - derivativeMarkets(request: QueryDerivativeMarketsRequest): Promise { - return queryService.derivativeMarkets(request); - }, - derivativeMarket(request: QueryDerivativeMarketRequest): Promise { - return queryService.derivativeMarket(request); - }, - derivativeMarketAddress(request: QueryDerivativeMarketAddressRequest): Promise { - return queryService.derivativeMarketAddress(request); - }, - subaccountTradeNonce(request: QuerySubaccountTradeNonceRequest): Promise { - return queryService.subaccountTradeNonce(request); - }, - exchangeModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.exchangeModuleState(request); - }, - positions(request?: QueryPositionsRequest): Promise { - return queryService.positions(request); - }, - subaccountPositions(request: QuerySubaccountPositionsRequest): Promise { - return queryService.subaccountPositions(request); - }, - subaccountPositionInMarket(request: QuerySubaccountPositionInMarketRequest): Promise { - return queryService.subaccountPositionInMarket(request); - }, - subaccountEffectivePositionInMarket(request: QuerySubaccountEffectivePositionInMarketRequest): Promise { - return queryService.subaccountEffectivePositionInMarket(request); - }, - perpetualMarketInfo(request: QueryPerpetualMarketInfoRequest): Promise { - return queryService.perpetualMarketInfo(request); - }, - expiryFuturesMarketInfo(request: QueryExpiryFuturesMarketInfoRequest): Promise { - return queryService.expiryFuturesMarketInfo(request); - }, - perpetualMarketFunding(request: QueryPerpetualMarketFundingRequest): Promise { - return queryService.perpetualMarketFunding(request); - }, - subaccountOrderMetadata(request: QuerySubaccountOrderMetadataRequest): Promise { - return queryService.subaccountOrderMetadata(request); - }, - tradeRewardPoints(request: QueryTradeRewardPointsRequest): Promise { - return queryService.tradeRewardPoints(request); - }, - pendingTradeRewardPoints(request: QueryTradeRewardPointsRequest): Promise { - return queryService.pendingTradeRewardPoints(request); - }, - tradeRewardCampaign(request?: QueryTradeRewardCampaignRequest): Promise { - return queryService.tradeRewardCampaign(request); - }, - feeDiscountAccountInfo(request: QueryFeeDiscountAccountInfoRequest): Promise { - return queryService.feeDiscountAccountInfo(request); - }, - feeDiscountSchedule(request?: QueryFeeDiscountScheduleRequest): Promise { - return queryService.feeDiscountSchedule(request); - }, - balanceMismatches(request: QueryBalanceMismatchesRequest): Promise { - return queryService.balanceMismatches(request); - }, - balanceWithBalanceHolds(request?: QueryBalanceWithBalanceHoldsRequest): Promise { - return queryService.balanceWithBalanceHolds(request); - }, - feeDiscountTierStatistics(request?: QueryFeeDiscountTierStatisticsRequest): Promise { - return queryService.feeDiscountTierStatistics(request); - }, - mitoVaultInfos(request?: MitoVaultInfosRequest): Promise { - return queryService.mitoVaultInfos(request); - }, - queryMarketIDFromVault(request: QueryMarketIDFromVaultRequest): Promise { - return queryService.queryMarketIDFromVault(request); - }, - historicalTradeRecords(request: QueryHistoricalTradeRecordsRequest): Promise { - return queryService.historicalTradeRecords(request); - }, - isOptedOutOfRewards(request: QueryIsOptedOutOfRewardsRequest): Promise { - return queryService.isOptedOutOfRewards(request); - }, - optedOutOfRewardsAccounts(request?: QueryOptedOutOfRewardsAccountsRequest): Promise { - return queryService.optedOutOfRewardsAccounts(request); - }, - marketVolatility(request: QueryMarketVolatilityRequest): Promise { - return queryService.marketVolatility(request); - }, - binaryOptionsMarkets(request: QueryBinaryMarketsRequest): Promise { - return queryService.binaryOptionsMarkets(request); - }, - traderDerivativeConditionalOrders(request: QueryTraderDerivativeConditionalOrdersRequest): Promise { - return queryService.traderDerivativeConditionalOrders(request); - }, - marketAtomicExecutionFeeMultiplier(request: QueryMarketAtomicExecutionFeeMultiplierRequest): Promise { - return queryService.marketAtomicExecutionFeeMultiplier(request); - }, - activeStakeGrant(request: QueryActiveStakeGrantRequest): Promise { - return queryService.activeStakeGrant(request); - }, - grantAuthorization(request: QueryGrantAuthorizationRequest): Promise { - return queryService.grantAuthorization(request); - }, - grantAuthorizations(request: QueryGrantAuthorizationsRequest): Promise { - return queryService.grantAuthorizations(request); - } - }; -}; -export interface UseQueryExchangeParamsQuery extends VueQueryParams { - request?: ReactiveQueryExchangeParamsRequest; -} -export interface UseSubaccountDepositsQuery extends VueQueryParams { - request: ReactiveQuerySubaccountDepositsRequest; -} -export interface UseSubaccountDepositQuery extends VueQueryParams { - request: ReactiveQuerySubaccountDepositRequest; -} -export interface UseExchangeBalancesQuery extends VueQueryParams { - request?: ReactiveQueryExchangeBalancesRequest; -} -export interface UseAggregateVolumeQuery extends VueQueryParams { - request: ReactiveQueryAggregateVolumeRequest; -} -export interface UseAggregateVolumesQuery extends VueQueryParams { - request: ReactiveQueryAggregateVolumesRequest; -} -export interface UseAggregateMarketVolumeQuery extends VueQueryParams { - request: ReactiveQueryAggregateMarketVolumeRequest; -} -export interface UseAggregateMarketVolumesQuery extends VueQueryParams { - request: ReactiveQueryAggregateMarketVolumesRequest; -} -export interface UseDenomDecimalQuery extends VueQueryParams { - request: ReactiveQueryDenomDecimalRequest; -} -export interface UseDenomDecimalsQuery extends VueQueryParams { - request: ReactiveQueryDenomDecimalsRequest; -} -export interface UseSpotMarketsQuery extends VueQueryParams { - request: ReactiveQuerySpotMarketsRequest; -} -export interface UseSpotMarketQuery extends VueQueryParams { - request: ReactiveQuerySpotMarketRequest; -} -export interface UseFullSpotMarketsQuery extends VueQueryParams { - request: ReactiveQueryFullSpotMarketsRequest; -} -export interface UseFullSpotMarketQuery extends VueQueryParams { - request: ReactiveQueryFullSpotMarketRequest; -} -export interface UseSpotOrderbookQuery extends VueQueryParams { - request: ReactiveQuerySpotOrderbookRequest; -} -export interface UseTraderSpotOrdersQuery extends VueQueryParams { - request: ReactiveQueryTraderSpotOrdersRequest; -} -export interface UseAccountAddressSpotOrdersQuery extends VueQueryParams { - request: ReactiveQueryAccountAddressSpotOrdersRequest; -} -export interface UseSpotOrdersByHashesQuery extends VueQueryParams { - request: ReactiveQuerySpotOrdersByHashesRequest; -} -export interface UseSubaccountOrdersQuery extends VueQueryParams { - request: ReactiveQuerySubaccountOrdersRequest; -} -export interface UseTraderSpotTransientOrdersQuery extends VueQueryParams { - request: ReactiveQueryTraderSpotOrdersRequest; -} -export interface UseSpotMidPriceAndTOBQuery extends VueQueryParams { - request: ReactiveQuerySpotMidPriceAndTOBRequest; -} -export interface UseDerivativeMidPriceAndTOBQuery extends VueQueryParams { - request: ReactiveQueryDerivativeMidPriceAndTOBRequest; -} -export interface UseDerivativeOrderbookQuery extends VueQueryParams { - request: ReactiveQueryDerivativeOrderbookRequest; -} -export interface UseTraderDerivativeOrdersQuery extends VueQueryParams { - request: ReactiveQueryTraderDerivativeOrdersRequest; -} -export interface UseAccountAddressDerivativeOrdersQuery extends VueQueryParams { - request: ReactiveQueryAccountAddressDerivativeOrdersRequest; -} -export interface UseDerivativeOrdersByHashesQuery extends VueQueryParams { - request: ReactiveQueryDerivativeOrdersByHashesRequest; -} -export interface UseTraderDerivativeTransientOrdersQuery extends VueQueryParams { - request: ReactiveQueryTraderDerivativeOrdersRequest; -} -export interface UseDerivativeMarketsQuery extends VueQueryParams { - request: ReactiveQueryDerivativeMarketsRequest; -} -export interface UseDerivativeMarketQuery extends VueQueryParams { - request: ReactiveQueryDerivativeMarketRequest; -} -export interface UseDerivativeMarketAddressQuery extends VueQueryParams { - request: ReactiveQueryDerivativeMarketAddressRequest; -} -export interface UseSubaccountTradeNonceQuery extends VueQueryParams { - request: ReactiveQuerySubaccountTradeNonceRequest; -} -export interface UseExchangeModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export interface UsePositionsQuery extends VueQueryParams { - request?: ReactiveQueryPositionsRequest; -} -export interface UseSubaccountPositionsQuery extends VueQueryParams { - request: ReactiveQuerySubaccountPositionsRequest; -} -export interface UseSubaccountPositionInMarketQuery extends VueQueryParams { - request: ReactiveQuerySubaccountPositionInMarketRequest; -} -export interface UseSubaccountEffectivePositionInMarketQuery extends VueQueryParams { - request: ReactiveQuerySubaccountEffectivePositionInMarketRequest; -} -export interface UsePerpetualMarketInfoQuery extends VueQueryParams { - request: ReactiveQueryPerpetualMarketInfoRequest; -} -export interface UseExpiryFuturesMarketInfoQuery extends VueQueryParams { - request: ReactiveQueryExpiryFuturesMarketInfoRequest; -} -export interface UsePerpetualMarketFundingQuery extends VueQueryParams { - request: ReactiveQueryPerpetualMarketFundingRequest; -} -export interface UseSubaccountOrderMetadataQuery extends VueQueryParams { - request: ReactiveQuerySubaccountOrderMetadataRequest; -} -export interface UseTradeRewardPointsQuery extends VueQueryParams { - request: ReactiveQueryTradeRewardPointsRequest; -} -export interface UsePendingTradeRewardPointsQuery extends VueQueryParams { - request: ReactiveQueryTradeRewardPointsRequest; -} -export interface UseTradeRewardCampaignQuery extends VueQueryParams { - request?: ReactiveQueryTradeRewardCampaignRequest; -} -export interface UseFeeDiscountAccountInfoQuery extends VueQueryParams { - request: ReactiveQueryFeeDiscountAccountInfoRequest; -} -export interface UseFeeDiscountScheduleQuery extends VueQueryParams { - request?: ReactiveQueryFeeDiscountScheduleRequest; -} -export interface UseBalanceMismatchesQuery extends VueQueryParams { - request: ReactiveQueryBalanceMismatchesRequest; -} -export interface UseBalanceWithBalanceHoldsQuery extends VueQueryParams { - request?: ReactiveQueryBalanceWithBalanceHoldsRequest; -} -export interface UseFeeDiscountTierStatisticsQuery extends VueQueryParams { - request?: ReactiveQueryFeeDiscountTierStatisticsRequest; -} -export interface UseMitoVaultInfosQuery extends VueQueryParams { - request?: ReactiveMitoVaultInfosRequest; -} -export interface UseQueryMarketIDFromVaultQuery extends VueQueryParams { - request: ReactiveQueryMarketIDFromVaultRequest; -} -export interface UseHistoricalTradeRecordsQuery extends VueQueryParams { - request: ReactiveQueryHistoricalTradeRecordsRequest; -} -export interface UseIsOptedOutOfRewardsQuery extends VueQueryParams { - request: ReactiveQueryIsOptedOutOfRewardsRequest; -} -export interface UseOptedOutOfRewardsAccountsQuery extends VueQueryParams { - request?: ReactiveQueryOptedOutOfRewardsAccountsRequest; -} -export interface UseMarketVolatilityQuery extends VueQueryParams { - request: ReactiveQueryMarketVolatilityRequest; -} -export interface UseBinaryOptionsMarketsQuery extends VueQueryParams { - request: ReactiveQueryBinaryMarketsRequest; -} -export interface UseTraderDerivativeConditionalOrdersQuery extends VueQueryParams { - request: ReactiveQueryTraderDerivativeConditionalOrdersRequest; -} -export interface UseMarketAtomicExecutionFeeMultiplierQuery extends VueQueryParams { - request: ReactiveQueryMarketAtomicExecutionFeeMultiplierRequest; -} -export interface UseActiveStakeGrantQuery extends VueQueryParams { - request: ReactiveQueryActiveStakeGrantRequest; -} -export interface UseGrantAuthorizationQuery extends VueQueryParams { - request: ReactiveQueryGrantAuthorizationRequest; -} -export interface UseGrantAuthorizationsQuery extends VueQueryParams { - request: ReactiveQueryGrantAuthorizationsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useQueryExchangeParams = ({ - request, - options - }: UseQueryExchangeParamsQuery) => { - const queryKey = ["queryExchangeParamsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.queryExchangeParams(params); - }, - ...options - }); - }; - const useSubaccountDeposits = ({ - request, - options - }: UseSubaccountDepositsQuery) => { - const queryKey = ["subaccountDepositsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountDeposits(params); - }, - ...options - }); - }; - const useSubaccountDeposit = ({ - request, - options - }: UseSubaccountDepositQuery) => { - const queryKey = ["subaccountDepositQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountDeposit(params); - }, - ...options - }); - }; - const useExchangeBalances = ({ - request, - options - }: UseExchangeBalancesQuery) => { - const queryKey = ["exchangeBalancesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.exchangeBalances(params); - }, - ...options - }); - }; - const useAggregateVolume = ({ - request, - options - }: UseAggregateVolumeQuery) => { - const queryKey = ["aggregateVolumeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.aggregateVolume(params); - }, - ...options - }); - }; - const useAggregateVolumes = ({ - request, - options - }: UseAggregateVolumesQuery) => { - const queryKey = ["aggregateVolumesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.aggregateVolumes(params); - }, - ...options - }); - }; - const useAggregateMarketVolume = ({ - request, - options - }: UseAggregateMarketVolumeQuery) => { - const queryKey = ["aggregateMarketVolumeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.aggregateMarketVolume(params); - }, - ...options - }); - }; - const useAggregateMarketVolumes = ({ - request, - options - }: UseAggregateMarketVolumesQuery) => { - const queryKey = ["aggregateMarketVolumesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.aggregateMarketVolumes(params); - }, - ...options - }); - }; - const useDenomDecimal = ({ - request, - options - }: UseDenomDecimalQuery) => { - const queryKey = ["denomDecimalQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomDecimal(params); - }, - ...options - }); - }; - const useDenomDecimals = ({ - request, - options - }: UseDenomDecimalsQuery) => { - const queryKey = ["denomDecimalsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomDecimals(params); - }, - ...options - }); - }; - const useSpotMarkets = ({ - request, - options - }: UseSpotMarketsQuery) => { - const queryKey = ["spotMarketsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spotMarkets(params); - }, - ...options - }); - }; - const useSpotMarket = ({ - request, - options - }: UseSpotMarketQuery) => { - const queryKey = ["spotMarketQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spotMarket(params); - }, - ...options - }); - }; - const useFullSpotMarkets = ({ - request, - options - }: UseFullSpotMarketsQuery) => { - const queryKey = ["fullSpotMarketsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.fullSpotMarkets(params); - }, - ...options - }); - }; - const useFullSpotMarket = ({ - request, - options - }: UseFullSpotMarketQuery) => { - const queryKey = ["fullSpotMarketQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.fullSpotMarket(params); - }, - ...options - }); - }; - const useSpotOrderbook = ({ - request, - options - }: UseSpotOrderbookQuery) => { - const queryKey = ["spotOrderbookQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spotOrderbook(params); - }, - ...options - }); - }; - const useTraderSpotOrders = ({ - request, - options - }: UseTraderSpotOrdersQuery) => { - const queryKey = ["traderSpotOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.traderSpotOrders(params); - }, - ...options - }); - }; - const useAccountAddressSpotOrders = ({ - request, - options - }: UseAccountAddressSpotOrdersQuery) => { - const queryKey = ["accountAddressSpotOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accountAddressSpotOrders(params); - }, - ...options - }); - }; - const useSpotOrdersByHashes = ({ - request, - options - }: UseSpotOrdersByHashesQuery) => { - const queryKey = ["spotOrdersByHashesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spotOrdersByHashes(params); - }, - ...options - }); - }; - const useSubaccountOrders = ({ - request, - options - }: UseSubaccountOrdersQuery) => { - const queryKey = ["subaccountOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountOrders(params); - }, - ...options - }); - }; - const useTraderSpotTransientOrders = ({ - request, - options - }: UseTraderSpotTransientOrdersQuery) => { - const queryKey = ["traderSpotTransientOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.traderSpotTransientOrders(params); - }, - ...options - }); - }; - const useSpotMidPriceAndTOB = ({ - request, - options - }: UseSpotMidPriceAndTOBQuery) => { - const queryKey = ["spotMidPriceAndTOBQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spotMidPriceAndTOB(params); - }, - ...options - }); - }; - const useDerivativeMidPriceAndTOB = ({ - request, - options - }: UseDerivativeMidPriceAndTOBQuery) => { - const queryKey = ["derivativeMidPriceAndTOBQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.derivativeMidPriceAndTOB(params); - }, - ...options - }); - }; - const useDerivativeOrderbook = ({ - request, - options - }: UseDerivativeOrderbookQuery) => { - const queryKey = ["derivativeOrderbookQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.derivativeOrderbook(params); - }, - ...options - }); - }; - const useTraderDerivativeOrders = ({ - request, - options - }: UseTraderDerivativeOrdersQuery) => { - const queryKey = ["traderDerivativeOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.traderDerivativeOrders(params); - }, - ...options - }); - }; - const useAccountAddressDerivativeOrders = ({ - request, - options - }: UseAccountAddressDerivativeOrdersQuery) => { - const queryKey = ["accountAddressDerivativeOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accountAddressDerivativeOrders(params); - }, - ...options - }); - }; - const useDerivativeOrdersByHashes = ({ - request, - options - }: UseDerivativeOrdersByHashesQuery) => { - const queryKey = ["derivativeOrdersByHashesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.derivativeOrdersByHashes(params); - }, - ...options - }); - }; - const useTraderDerivativeTransientOrders = ({ - request, - options - }: UseTraderDerivativeTransientOrdersQuery) => { - const queryKey = ["traderDerivativeTransientOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.traderDerivativeTransientOrders(params); - }, - ...options - }); - }; - const useDerivativeMarkets = ({ - request, - options - }: UseDerivativeMarketsQuery) => { - const queryKey = ["derivativeMarketsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.derivativeMarkets(params); - }, - ...options - }); - }; - const useDerivativeMarket = ({ - request, - options - }: UseDerivativeMarketQuery) => { - const queryKey = ["derivativeMarketQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.derivativeMarket(params); - }, - ...options - }); - }; - const useDerivativeMarketAddress = ({ - request, - options - }: UseDerivativeMarketAddressQuery) => { - const queryKey = ["derivativeMarketAddressQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.derivativeMarketAddress(params); - }, - ...options - }); - }; - const useSubaccountTradeNonce = ({ - request, - options - }: UseSubaccountTradeNonceQuery) => { - const queryKey = ["subaccountTradeNonceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountTradeNonce(params); - }, - ...options - }); - }; - const useExchangeModuleState = ({ - request, - options - }: UseExchangeModuleStateQuery) => { - const queryKey = ["exchangeModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.exchangeModuleState(params); - }, - ...options - }); - }; - const usePositions = ({ - request, - options - }: UsePositionsQuery) => { - const queryKey = ["positionsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.positions(params); - }, - ...options - }); - }; - const useSubaccountPositions = ({ - request, - options - }: UseSubaccountPositionsQuery) => { - const queryKey = ["subaccountPositionsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountPositions(params); - }, - ...options - }); - }; - const useSubaccountPositionInMarket = ({ - request, - options - }: UseSubaccountPositionInMarketQuery) => { - const queryKey = ["subaccountPositionInMarketQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountPositionInMarket(params); - }, - ...options - }); - }; - const useSubaccountEffectivePositionInMarket = ({ - request, - options - }: UseSubaccountEffectivePositionInMarketQuery) => { - const queryKey = ["subaccountEffectivePositionInMarketQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountEffectivePositionInMarket(params); - }, - ...options - }); - }; - const usePerpetualMarketInfo = ({ - request, - options - }: UsePerpetualMarketInfoQuery) => { - const queryKey = ["perpetualMarketInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.perpetualMarketInfo(params); - }, - ...options - }); - }; - const useExpiryFuturesMarketInfo = ({ - request, - options - }: UseExpiryFuturesMarketInfoQuery) => { - const queryKey = ["expiryFuturesMarketInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.expiryFuturesMarketInfo(params); - }, - ...options - }); - }; - const usePerpetualMarketFunding = ({ - request, - options - }: UsePerpetualMarketFundingQuery) => { - const queryKey = ["perpetualMarketFundingQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.perpetualMarketFunding(params); - }, - ...options - }); - }; - const useSubaccountOrderMetadata = ({ - request, - options - }: UseSubaccountOrderMetadataQuery) => { - const queryKey = ["subaccountOrderMetadataQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subaccountOrderMetadata(params); - }, - ...options - }); - }; - const useTradeRewardPoints = ({ - request, - options - }: UseTradeRewardPointsQuery) => { - const queryKey = ["tradeRewardPointsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.tradeRewardPoints(params); - }, - ...options - }); - }; - const usePendingTradeRewardPoints = ({ - request, - options - }: UsePendingTradeRewardPointsQuery) => { - const queryKey = ["pendingTradeRewardPointsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pendingTradeRewardPoints(params); - }, - ...options - }); - }; - const useTradeRewardCampaign = ({ - request, - options - }: UseTradeRewardCampaignQuery) => { - const queryKey = ["tradeRewardCampaignQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.tradeRewardCampaign(params); - }, - ...options - }); - }; - const useFeeDiscountAccountInfo = ({ - request, - options - }: UseFeeDiscountAccountInfoQuery) => { - const queryKey = ["feeDiscountAccountInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.feeDiscountAccountInfo(params); - }, - ...options - }); - }; - const useFeeDiscountSchedule = ({ - request, - options - }: UseFeeDiscountScheduleQuery) => { - const queryKey = ["feeDiscountScheduleQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.feeDiscountSchedule(params); - }, - ...options - }); - }; - const useBalanceMismatches = ({ - request, - options - }: UseBalanceMismatchesQuery) => { - const queryKey = ["balanceMismatchesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.balanceMismatches(params); - }, - ...options - }); - }; - const useBalanceWithBalanceHolds = ({ - request, - options - }: UseBalanceWithBalanceHoldsQuery) => { - const queryKey = ["balanceWithBalanceHoldsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.balanceWithBalanceHolds(params); - }, - ...options - }); - }; - const useFeeDiscountTierStatistics = ({ - request, - options - }: UseFeeDiscountTierStatisticsQuery) => { - const queryKey = ["feeDiscountTierStatisticsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.feeDiscountTierStatistics(params); - }, - ...options - }); - }; - const useMitoVaultInfos = ({ - request, - options - }: UseMitoVaultInfosQuery) => { - const queryKey = ["mitoVaultInfosQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.mitoVaultInfos(params); - }, - ...options - }); - }; - const useQueryMarketIDFromVault = ({ - request, - options - }: UseQueryMarketIDFromVaultQuery) => { - const queryKey = ["queryMarketIDFromVaultQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.queryMarketIDFromVault(params); - }, - ...options - }); - }; - const useHistoricalTradeRecords = ({ - request, - options - }: UseHistoricalTradeRecordsQuery) => { - const queryKey = ["historicalTradeRecordsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.historicalTradeRecords(params); - }, - ...options - }); - }; - const useIsOptedOutOfRewards = ({ - request, - options - }: UseIsOptedOutOfRewardsQuery) => { - const queryKey = ["isOptedOutOfRewardsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.isOptedOutOfRewards(params); - }, - ...options - }); - }; - const useOptedOutOfRewardsAccounts = ({ - request, - options - }: UseOptedOutOfRewardsAccountsQuery) => { - const queryKey = ["optedOutOfRewardsAccountsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.optedOutOfRewardsAccounts(params); - }, - ...options - }); - }; - const useMarketVolatility = ({ - request, - options - }: UseMarketVolatilityQuery) => { - const queryKey = ["marketVolatilityQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.marketVolatility(params); - }, - ...options - }); - }; - const useBinaryOptionsMarkets = ({ - request, - options - }: UseBinaryOptionsMarketsQuery) => { - const queryKey = ["binaryOptionsMarketsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.binaryOptionsMarkets(params); - }, - ...options - }); - }; - const useTraderDerivativeConditionalOrders = ({ - request, - options - }: UseTraderDerivativeConditionalOrdersQuery) => { - const queryKey = ["traderDerivativeConditionalOrdersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.traderDerivativeConditionalOrders(params); - }, - ...options - }); - }; - const useMarketAtomicExecutionFeeMultiplier = ({ - request, - options - }: UseMarketAtomicExecutionFeeMultiplierQuery) => { - const queryKey = ["marketAtomicExecutionFeeMultiplierQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.marketAtomicExecutionFeeMultiplier(params); - }, - ...options - }); - }; - const useActiveStakeGrant = ({ - request, - options - }: UseActiveStakeGrantQuery) => { - const queryKey = ["activeStakeGrantQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.activeStakeGrant(params); - }, - ...options - }); - }; - const useGrantAuthorization = ({ - request, - options - }: UseGrantAuthorizationQuery) => { - const queryKey = ["grantAuthorizationQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.grantAuthorization(params); - }, - ...options - }); - }; - const useGrantAuthorizations = ({ - request, - options - }: UseGrantAuthorizationsQuery) => { - const queryKey = ["grantAuthorizationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.grantAuthorizations(params); - }, - ...options - }); - }; - return { - /** Retrieves exchange params */useQueryExchangeParams, - /** Retrieves a Subaccount's Deposits */useSubaccountDeposits, - /** Retrieves a Subaccount's Deposits */useSubaccountDeposit, - /** Retrieves all of the balances of all users on the exchange. */useExchangeBalances, - /** Retrieves the aggregate volumes for the specified account or subaccount */useAggregateVolume, - /** Retrieves the aggregate volumes for specified accounts */useAggregateVolumes, - /** Retrieves the aggregate volume for the specified market */useAggregateMarketVolume, - /** Retrieves the aggregate market volumes for specified markets */useAggregateMarketVolumes, - /** Retrieves the denom decimals for a denom. */useDenomDecimal, - /** - * Retrieves the denom decimals for multiple denoms. Returns all denom - * decimals if unspecified. - */ - useDenomDecimals, - /** Retrieves a list of spot markets. */useSpotMarkets, - /** Retrieves a spot market by ticker */useSpotMarket, - /** Retrieves a list of spot markets with extra information. */useFullSpotMarkets, - /** Retrieves a spot market with extra information. */useFullSpotMarket, - /** Retrieves a spot market's orderbook by marketID */useSpotOrderbook, - /** Retrieves a trader's spot orders */useTraderSpotOrders, - /** Retrieves all account address spot orders */useAccountAddressSpotOrders, - /** - * Retrieves spot orders corresponding to specified order hashes for a given - * subaccountID and marketID - */ - useSpotOrdersByHashes, - /** Retrieves subaccount's orders */useSubaccountOrders, - /** Retrieves a trader's transient spot orders */useTraderSpotTransientOrders, - /** Retrieves a spot market's mid-price */useSpotMidPriceAndTOB, - /** Retrieves a derivative market's mid-price */useDerivativeMidPriceAndTOB, - /** Retrieves a derivative market's orderbook by marketID */useDerivativeOrderbook, - /** Retrieves a trader's derivative orders */useTraderDerivativeOrders, - /** Retrieves all account address derivative orders */useAccountAddressDerivativeOrders, - /** Retrieves a trader's derivative orders */useDerivativeOrdersByHashes, - /** Retrieves a trader's transient derivative orders */useTraderDerivativeTransientOrders, - /** Retrieves a list of derivative markets. */useDerivativeMarkets, - /** Retrieves a derivative market by ticker */useDerivativeMarket, - /** - * Retrieves a derivative market's corresponding address for fees that - * contribute to the market's insurance fund - */ - useDerivativeMarketAddress, - /** Retrieves a subaccount's trade nonce */useSubaccountTradeNonce, - /** Retrieves the entire exchange module's state */useExchangeModuleState, - /** Retrieves the entire exchange module's positions */usePositions, - /** Retrieves subaccount's positions */useSubaccountPositions, - /** Retrieves subaccount's position in market */useSubaccountPositionInMarket, - /** Retrieves subaccount's position in market */useSubaccountEffectivePositionInMarket, - /** Retrieves perpetual market info */usePerpetualMarketInfo, - /** Retrieves expiry market info */useExpiryFuturesMarketInfo, - /** Retrieves perpetual market funding */usePerpetualMarketFunding, - /** Retrieves subaccount's order metadata */useSubaccountOrderMetadata, - /** Retrieves the account and total trade rewards points */useTradeRewardPoints, - /** Retrieves the pending account and total trade rewards points */usePendingTradeRewardPoints, - /** Retrieves the trade reward campaign */useTradeRewardCampaign, - /** Retrieves the account's fee discount info */useFeeDiscountAccountInfo, - /** Retrieves the fee discount schedule */useFeeDiscountSchedule, - /** Retrieves mismatches between available vs. total balance */useBalanceMismatches, - /** Retrieves available and total balances with balance holds */useBalanceWithBalanceHolds, - /** Retrieves fee discount tier stats */useFeeDiscountTierStatistics, - /** Retrieves market making pool info */useMitoVaultInfos, - /** - * QueryMarketIDFromVault returns the market ID for a given vault subaccount - * ID - */ - useQueryMarketIDFromVault, - /** Retrieves historical trade records for a given market ID */useHistoricalTradeRecords, - /** Retrieves if the account is opted out of rewards */useIsOptedOutOfRewards, - /** Retrieves all accounts opted out of rewards */useOptedOutOfRewardsAccounts, - /** - * MarketVolatility computes the volatility for spot and derivative markets - * trading history. - */ - useMarketVolatility, - /** Retrieves a spot market's orderbook by marketID */useBinaryOptionsMarkets, - /** Retrieves a trader's derivative conditional orders */useTraderDerivativeConditionalOrders, - useMarketAtomicExecutionFeeMultiplier, - /** Retrieves the active stake grant for a grantee */useActiveStakeGrant, - /** Retrieves the grant authorization amount for a granter and grantee */useGrantAuthorization, - /** Retrieves the grant authorization amount for a granter and grantee */useGrantAuthorizations - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..d0f2be43 --- /dev/null +++ b/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.func.ts @@ -0,0 +1,422 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; +export const createGetQueryExchangeParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExchangeParamsRequest.encode, + decode: QueryExchangeParamsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "QueryExchangeParams", + clientResolver +}); +export const createGetSubaccountDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountDepositsRequest.encode, + decode: QuerySubaccountDepositsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountDeposits", + clientResolver +}); +export const createGetSubaccountDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountDepositRequest.encode, + decode: QuerySubaccountDepositResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountDeposit", + clientResolver +}); +export const createGetExchangeBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExchangeBalancesRequest.encode, + decode: QueryExchangeBalancesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExchangeBalances", + clientResolver +}); +export const createGetAggregateVolume = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateVolumeRequest.encode, + decode: QueryAggregateVolumeResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateVolume", + clientResolver +}); +export const createGetAggregateVolumes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateVolumesRequest.encode, + decode: QueryAggregateVolumesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateVolumes", + clientResolver +}); +export const createGetAggregateMarketVolume = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateMarketVolumeRequest.encode, + decode: QueryAggregateMarketVolumeResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateMarketVolume", + clientResolver +}); +export const createGetAggregateMarketVolumes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateMarketVolumesRequest.encode, + decode: QueryAggregateMarketVolumesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateMarketVolumes", + clientResolver +}); +export const createGetDenomDecimal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomDecimalRequest.encode, + decode: QueryDenomDecimalResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DenomDecimal", + clientResolver +}); +export const createGetDenomDecimals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomDecimalsRequest.encode, + decode: QueryDenomDecimalsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DenomDecimals", + clientResolver +}); +export const createGetSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMarketsRequest.encode, + decode: QuerySpotMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMarkets", + clientResolver +}); +export const createGetSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMarketRequest.encode, + decode: QuerySpotMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMarket", + clientResolver +}); +export const createGetFullSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFullSpotMarketsRequest.encode, + decode: QueryFullSpotMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FullSpotMarkets", + clientResolver +}); +export const createGetFullSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFullSpotMarketRequest.encode, + decode: QueryFullSpotMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FullSpotMarket", + clientResolver +}); +export const createGetSpotOrderbook = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotOrderbookRequest.encode, + decode: QuerySpotOrderbookResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotOrderbook", + clientResolver +}); +export const createGetTraderSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderSpotOrdersRequest.encode, + decode: QueryTraderSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderSpotOrders", + clientResolver +}); +export const createGetAccountAddressSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressSpotOrdersRequest.encode, + decode: QueryAccountAddressSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AccountAddressSpotOrders", + clientResolver +}); +export const createGetSpotOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotOrdersByHashesRequest.encode, + decode: QuerySpotOrdersByHashesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotOrdersByHashes", + clientResolver +}); +export const createGetSubaccountOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountOrdersRequest.encode, + decode: QuerySubaccountOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountOrders", + clientResolver +}); +export const createGetTraderSpotTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderSpotOrdersRequest.encode, + decode: QueryTraderSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderSpotTransientOrders", + clientResolver +}); +export const createGetSpotMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMidPriceAndTOBRequest.encode, + decode: QuerySpotMidPriceAndTOBResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMidPriceAndTOB", + clientResolver +}); +export const createGetDerivativeMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMidPriceAndTOBRequest.encode, + decode: QueryDerivativeMidPriceAndTOBResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMidPriceAndTOB", + clientResolver +}); +export const createGetDerivativeOrderbook = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeOrderbookRequest.encode, + decode: QueryDerivativeOrderbookResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeOrderbook", + clientResolver +}); +export const createGetTraderDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeOrdersRequest.encode, + decode: QueryTraderDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeOrders", + clientResolver +}); +export const createGetAccountAddressDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressDerivativeOrdersRequest.encode, + decode: QueryAccountAddressDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AccountAddressDerivativeOrders", + clientResolver +}); +export const createGetDerivativeOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeOrdersByHashesRequest.encode, + decode: QueryDerivativeOrdersByHashesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeOrdersByHashes", + clientResolver +}); +export const createGetTraderDerivativeTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeOrdersRequest.encode, + decode: QueryTraderDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeTransientOrders", + clientResolver +}); +export const createGetDerivativeMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketsRequest.encode, + decode: QueryDerivativeMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarkets", + clientResolver +}); +export const createGetDerivativeMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketRequest.encode, + decode: QueryDerivativeMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarket", + clientResolver +}); +export const createGetDerivativeMarketAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketAddressRequest.encode, + decode: QueryDerivativeMarketAddressResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarketAddress", + clientResolver +}); +export const createGetSubaccountTradeNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountTradeNonceRequest.encode, + decode: QuerySubaccountTradeNonceResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountTradeNonce", + clientResolver +}); +export const createGetExchangeModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExchangeModuleState", + clientResolver +}); +export const createGetPositions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPositionsRequest.encode, + decode: QueryPositionsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "Positions", + clientResolver +}); +export const createGetSubaccountPositions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountPositionsRequest.encode, + decode: QuerySubaccountPositionsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountPositions", + clientResolver +}); +export const createGetSubaccountPositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountPositionInMarketRequest.encode, + decode: QuerySubaccountPositionInMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountPositionInMarket", + clientResolver +}); +export const createGetSubaccountEffectivePositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountEffectivePositionInMarketRequest.encode, + decode: QuerySubaccountEffectivePositionInMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountEffectivePositionInMarket", + clientResolver +}); +export const createGetPerpetualMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPerpetualMarketInfoRequest.encode, + decode: QueryPerpetualMarketInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PerpetualMarketInfo", + clientResolver +}); +export const createGetExpiryFuturesMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExpiryFuturesMarketInfoRequest.encode, + decode: QueryExpiryFuturesMarketInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExpiryFuturesMarketInfo", + clientResolver +}); +export const createGetPerpetualMarketFunding = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPerpetualMarketFundingRequest.encode, + decode: QueryPerpetualMarketFundingResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PerpetualMarketFunding", + clientResolver +}); +export const createGetSubaccountOrderMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountOrderMetadataRequest.encode, + decode: QuerySubaccountOrderMetadataResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountOrderMetadata", + clientResolver +}); +export const createGetTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardPointsRequest.encode, + decode: QueryTradeRewardPointsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TradeRewardPoints", + clientResolver +}); +export const createGetPendingTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardPointsRequest.encode, + decode: QueryTradeRewardPointsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PendingTradeRewardPoints", + clientResolver +}); +export const createGetTradeRewardCampaign = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardCampaignRequest.encode, + decode: QueryTradeRewardCampaignResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TradeRewardCampaign", + clientResolver +}); +export const createGetFeeDiscountAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountAccountInfoRequest.encode, + decode: QueryFeeDiscountAccountInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountAccountInfo", + clientResolver +}); +export const createGetFeeDiscountSchedule = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountScheduleRequest.encode, + decode: QueryFeeDiscountScheduleResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountSchedule", + clientResolver +}); +export const createGetBalanceMismatches = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceMismatchesRequest.encode, + decode: QueryBalanceMismatchesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BalanceMismatches", + clientResolver +}); +export const createGetBalanceWithBalanceHolds = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceWithBalanceHoldsRequest.encode, + decode: QueryBalanceWithBalanceHoldsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BalanceWithBalanceHolds", + clientResolver +}); +export const createGetFeeDiscountTierStatistics = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountTierStatisticsRequest.encode, + decode: QueryFeeDiscountTierStatisticsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountTierStatistics", + clientResolver +}); +export const createGetMitoVaultInfos = (clientResolver?: RpcResolver) => buildQuery({ + encode: MitoVaultInfosRequest.encode, + decode: MitoVaultInfosResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MitoVaultInfos", + clientResolver +}); +export const createGetQueryMarketIDFromVault = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketIDFromVaultRequest.encode, + decode: QueryMarketIDFromVaultResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "QueryMarketIDFromVault", + clientResolver +}); +export const createGetHistoricalTradeRecords = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalTradeRecordsRequest.encode, + decode: QueryHistoricalTradeRecordsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "HistoricalTradeRecords", + clientResolver +}); +export const createGetIsOptedOutOfRewards = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryIsOptedOutOfRewardsRequest.encode, + decode: QueryIsOptedOutOfRewardsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "IsOptedOutOfRewards", + clientResolver +}); +export const createGetOptedOutOfRewardsAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOptedOutOfRewardsAccountsRequest.encode, + decode: QueryOptedOutOfRewardsAccountsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "OptedOutOfRewardsAccounts", + clientResolver +}); +export const createGetMarketVolatility = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketVolatilityRequest.encode, + decode: QueryMarketVolatilityResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MarketVolatility", + clientResolver +}); +export const createGetBinaryOptionsMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBinaryMarketsRequest.encode, + decode: QueryBinaryMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BinaryOptionsMarkets", + clientResolver +}); +export const createGetTraderDerivativeConditionalOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeConditionalOrdersRequest.encode, + decode: QueryTraderDerivativeConditionalOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeConditionalOrders", + clientResolver +}); +export const createGetMarketAtomicExecutionFeeMultiplier = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketAtomicExecutionFeeMultiplierRequest.encode, + decode: QueryMarketAtomicExecutionFeeMultiplierResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MarketAtomicExecutionFeeMultiplier", + clientResolver +}); +export const createGetActiveStakeGrant = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryActiveStakeGrantRequest.encode, + decode: QueryActiveStakeGrantResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ActiveStakeGrant", + clientResolver +}); +export const createGetGrantAuthorization = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGrantAuthorizationRequest.encode, + decode: QueryGrantAuthorizationResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "GrantAuthorization", + clientResolver +}); +export const createGetGrantAuthorizations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGrantAuthorizationsRequest.encode, + decode: QueryGrantAuthorizationsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "GrantAuthorizations", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..e0c72adb --- /dev/null +++ b/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts @@ -0,0 +1,243 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; +import { createGetQueryExchangeParams, createGetSubaccountDeposits, createGetSubaccountDeposit, createGetExchangeBalances, createGetAggregateVolume, createGetAggregateVolumes, createGetAggregateMarketVolume, createGetAggregateMarketVolumes, createGetDenomDecimal, createGetDenomDecimals, createGetSpotMarkets, createGetSpotMarket, createGetFullSpotMarkets, createGetFullSpotMarket, createGetSpotOrderbook, createGetTraderSpotOrders, createGetAccountAddressSpotOrders, createGetSpotOrdersByHashes, createGetSubaccountOrders, createGetTraderSpotTransientOrders, createGetSpotMidPriceAndTOB, createGetDerivativeMidPriceAndTOB, createGetDerivativeOrderbook, createGetTraderDerivativeOrders, createGetAccountAddressDerivativeOrders, createGetDerivativeOrdersByHashes, createGetTraderDerivativeTransientOrders, createGetDerivativeMarkets, createGetDerivativeMarket, createGetDerivativeMarketAddress, createGetSubaccountTradeNonce, createGetExchangeModuleState, createGetPositions, createGetSubaccountPositions, createGetSubaccountPositionInMarket, createGetSubaccountEffectivePositionInMarket, createGetPerpetualMarketInfo, createGetExpiryFuturesMarketInfo, createGetPerpetualMarketFunding, createGetSubaccountOrderMetadata, createGetTradeRewardPoints, createGetPendingTradeRewardPoints, createGetTradeRewardCampaign, createGetFeeDiscountAccountInfo, createGetFeeDiscountSchedule, createGetBalanceMismatches, createGetBalanceWithBalanceHolds, createGetFeeDiscountTierStatistics, createGetMitoVaultInfos, createGetQueryMarketIDFromVault, createGetHistoricalTradeRecords, createGetIsOptedOutOfRewards, createGetOptedOutOfRewardsAccounts, createGetMarketVolatility, createGetBinaryOptionsMarkets, createGetTraderDerivativeConditionalOrders, createGetMarketAtomicExecutionFeeMultiplier, createGetActiveStakeGrant, createGetGrantAuthorization, createGetGrantAuthorizations } from "./query.rpc.func.ts"; +export const useGetQueryExchangeParams = buildUseVueQuery({ + builderQueryFn: createGetQueryExchangeParams, + queryKeyPrefix: "QueryExchangeParamsQuery" +}); +export const useGetSubaccountDeposits = buildUseVueQuery({ + builderQueryFn: createGetSubaccountDeposits, + queryKeyPrefix: "SubaccountDepositsQuery" +}); +export const useGetSubaccountDeposit = buildUseVueQuery({ + builderQueryFn: createGetSubaccountDeposit, + queryKeyPrefix: "SubaccountDepositQuery" +}); +export const useGetExchangeBalances = buildUseVueQuery({ + builderQueryFn: createGetExchangeBalances, + queryKeyPrefix: "ExchangeBalancesQuery" +}); +export const useGetAggregateVolume = buildUseVueQuery({ + builderQueryFn: createGetAggregateVolume, + queryKeyPrefix: "AggregateVolumeQuery" +}); +export const useGetAggregateVolumes = buildUseVueQuery({ + builderQueryFn: createGetAggregateVolumes, + queryKeyPrefix: "AggregateVolumesQuery" +}); +export const useGetAggregateMarketVolume = buildUseVueQuery({ + builderQueryFn: createGetAggregateMarketVolume, + queryKeyPrefix: "AggregateMarketVolumeQuery" +}); +export const useGetAggregateMarketVolumes = buildUseVueQuery({ + builderQueryFn: createGetAggregateMarketVolumes, + queryKeyPrefix: "AggregateMarketVolumesQuery" +}); +export const useGetDenomDecimal = buildUseVueQuery({ + builderQueryFn: createGetDenomDecimal, + queryKeyPrefix: "DenomDecimalQuery" +}); +export const useGetDenomDecimals = buildUseVueQuery({ + builderQueryFn: createGetDenomDecimals, + queryKeyPrefix: "DenomDecimalsQuery" +}); +export const useGetSpotMarkets = buildUseVueQuery({ + builderQueryFn: createGetSpotMarkets, + queryKeyPrefix: "SpotMarketsQuery" +}); +export const useGetSpotMarket = buildUseVueQuery({ + builderQueryFn: createGetSpotMarket, + queryKeyPrefix: "SpotMarketQuery" +}); +export const useGetFullSpotMarkets = buildUseVueQuery({ + builderQueryFn: createGetFullSpotMarkets, + queryKeyPrefix: "FullSpotMarketsQuery" +}); +export const useGetFullSpotMarket = buildUseVueQuery({ + builderQueryFn: createGetFullSpotMarket, + queryKeyPrefix: "FullSpotMarketQuery" +}); +export const useGetSpotOrderbook = buildUseVueQuery({ + builderQueryFn: createGetSpotOrderbook, + queryKeyPrefix: "SpotOrderbookQuery" +}); +export const useGetTraderSpotOrders = buildUseVueQuery({ + builderQueryFn: createGetTraderSpotOrders, + queryKeyPrefix: "TraderSpotOrdersQuery" +}); +export const useGetAccountAddressSpotOrders = buildUseVueQuery({ + builderQueryFn: createGetAccountAddressSpotOrders, + queryKeyPrefix: "AccountAddressSpotOrdersQuery" +}); +export const useGetSpotOrdersByHashes = buildUseVueQuery({ + builderQueryFn: createGetSpotOrdersByHashes, + queryKeyPrefix: "SpotOrdersByHashesQuery" +}); +export const useGetSubaccountOrders = buildUseVueQuery({ + builderQueryFn: createGetSubaccountOrders, + queryKeyPrefix: "SubaccountOrdersQuery" +}); +export const useGetTraderSpotTransientOrders = buildUseVueQuery({ + builderQueryFn: createGetTraderSpotTransientOrders, + queryKeyPrefix: "TraderSpotTransientOrdersQuery" +}); +export const useGetSpotMidPriceAndTOB = buildUseVueQuery({ + builderQueryFn: createGetSpotMidPriceAndTOB, + queryKeyPrefix: "SpotMidPriceAndTOBQuery" +}); +export const useGetDerivativeMidPriceAndTOB = buildUseVueQuery({ + builderQueryFn: createGetDerivativeMidPriceAndTOB, + queryKeyPrefix: "DerivativeMidPriceAndTOBQuery" +}); +export const useGetDerivativeOrderbook = buildUseVueQuery({ + builderQueryFn: createGetDerivativeOrderbook, + queryKeyPrefix: "DerivativeOrderbookQuery" +}); +export const useGetTraderDerivativeOrders = buildUseVueQuery({ + builderQueryFn: createGetTraderDerivativeOrders, + queryKeyPrefix: "TraderDerivativeOrdersQuery" +}); +export const useGetAccountAddressDerivativeOrders = buildUseVueQuery({ + builderQueryFn: createGetAccountAddressDerivativeOrders, + queryKeyPrefix: "AccountAddressDerivativeOrdersQuery" +}); +export const useGetDerivativeOrdersByHashes = buildUseVueQuery({ + builderQueryFn: createGetDerivativeOrdersByHashes, + queryKeyPrefix: "DerivativeOrdersByHashesQuery" +}); +export const useGetTraderDerivativeTransientOrders = buildUseVueQuery({ + builderQueryFn: createGetTraderDerivativeTransientOrders, + queryKeyPrefix: "TraderDerivativeTransientOrdersQuery" +}); +export const useGetDerivativeMarkets = buildUseVueQuery({ + builderQueryFn: createGetDerivativeMarkets, + queryKeyPrefix: "DerivativeMarketsQuery" +}); +export const useGetDerivativeMarket = buildUseVueQuery({ + builderQueryFn: createGetDerivativeMarket, + queryKeyPrefix: "DerivativeMarketQuery" +}); +export const useGetDerivativeMarketAddress = buildUseVueQuery({ + builderQueryFn: createGetDerivativeMarketAddress, + queryKeyPrefix: "DerivativeMarketAddressQuery" +}); +export const useGetSubaccountTradeNonce = buildUseVueQuery({ + builderQueryFn: createGetSubaccountTradeNonce, + queryKeyPrefix: "SubaccountTradeNonceQuery" +}); +export const useGetExchangeModuleState = buildUseVueQuery({ + builderQueryFn: createGetExchangeModuleState, + queryKeyPrefix: "ExchangeModuleStateQuery" +}); +export const useGetPositions = buildUseVueQuery({ + builderQueryFn: createGetPositions, + queryKeyPrefix: "PositionsQuery" +}); +export const useGetSubaccountPositions = buildUseVueQuery({ + builderQueryFn: createGetSubaccountPositions, + queryKeyPrefix: "SubaccountPositionsQuery" +}); +export const useGetSubaccountPositionInMarket = buildUseVueQuery({ + builderQueryFn: createGetSubaccountPositionInMarket, + queryKeyPrefix: "SubaccountPositionInMarketQuery" +}); +export const useGetSubaccountEffectivePositionInMarket = buildUseVueQuery({ + builderQueryFn: createGetSubaccountEffectivePositionInMarket, + queryKeyPrefix: "SubaccountEffectivePositionInMarketQuery" +}); +export const useGetPerpetualMarketInfo = buildUseVueQuery({ + builderQueryFn: createGetPerpetualMarketInfo, + queryKeyPrefix: "PerpetualMarketInfoQuery" +}); +export const useGetExpiryFuturesMarketInfo = buildUseVueQuery({ + builderQueryFn: createGetExpiryFuturesMarketInfo, + queryKeyPrefix: "ExpiryFuturesMarketInfoQuery" +}); +export const useGetPerpetualMarketFunding = buildUseVueQuery({ + builderQueryFn: createGetPerpetualMarketFunding, + queryKeyPrefix: "PerpetualMarketFundingQuery" +}); +export const useGetSubaccountOrderMetadata = buildUseVueQuery({ + builderQueryFn: createGetSubaccountOrderMetadata, + queryKeyPrefix: "SubaccountOrderMetadataQuery" +}); +export const useGetTradeRewardPoints = buildUseVueQuery({ + builderQueryFn: createGetTradeRewardPoints, + queryKeyPrefix: "TradeRewardPointsQuery" +}); +export const useGetPendingTradeRewardPoints = buildUseVueQuery({ + builderQueryFn: createGetPendingTradeRewardPoints, + queryKeyPrefix: "PendingTradeRewardPointsQuery" +}); +export const useGetTradeRewardCampaign = buildUseVueQuery({ + builderQueryFn: createGetTradeRewardCampaign, + queryKeyPrefix: "TradeRewardCampaignQuery" +}); +export const useGetFeeDiscountAccountInfo = buildUseVueQuery({ + builderQueryFn: createGetFeeDiscountAccountInfo, + queryKeyPrefix: "FeeDiscountAccountInfoQuery" +}); +export const useGetFeeDiscountSchedule = buildUseVueQuery({ + builderQueryFn: createGetFeeDiscountSchedule, + queryKeyPrefix: "FeeDiscountScheduleQuery" +}); +export const useGetBalanceMismatches = buildUseVueQuery({ + builderQueryFn: createGetBalanceMismatches, + queryKeyPrefix: "BalanceMismatchesQuery" +}); +export const useGetBalanceWithBalanceHolds = buildUseVueQuery({ + builderQueryFn: createGetBalanceWithBalanceHolds, + queryKeyPrefix: "BalanceWithBalanceHoldsQuery" +}); +export const useGetFeeDiscountTierStatistics = buildUseVueQuery({ + builderQueryFn: createGetFeeDiscountTierStatistics, + queryKeyPrefix: "FeeDiscountTierStatisticsQuery" +}); +export const useGetMitoVaultInfos = buildUseVueQuery({ + builderQueryFn: createGetMitoVaultInfos, + queryKeyPrefix: "MitoVaultInfosQuery" +}); +export const useGetQueryMarketIDFromVault = buildUseVueQuery({ + builderQueryFn: createGetQueryMarketIDFromVault, + queryKeyPrefix: "QueryMarketIDFromVaultQuery" +}); +export const useGetHistoricalTradeRecords = buildUseVueQuery({ + builderQueryFn: createGetHistoricalTradeRecords, + queryKeyPrefix: "HistoricalTradeRecordsQuery" +}); +export const useGetIsOptedOutOfRewards = buildUseVueQuery({ + builderQueryFn: createGetIsOptedOutOfRewards, + queryKeyPrefix: "IsOptedOutOfRewardsQuery" +}); +export const useGetOptedOutOfRewardsAccounts = buildUseVueQuery({ + builderQueryFn: createGetOptedOutOfRewardsAccounts, + queryKeyPrefix: "OptedOutOfRewardsAccountsQuery" +}); +export const useGetMarketVolatility = buildUseVueQuery({ + builderQueryFn: createGetMarketVolatility, + queryKeyPrefix: "MarketVolatilityQuery" +}); +export const useGetBinaryOptionsMarkets = buildUseVueQuery({ + builderQueryFn: createGetBinaryOptionsMarkets, + queryKeyPrefix: "BinaryOptionsMarketsQuery" +}); +export const useGetTraderDerivativeConditionalOrders = buildUseVueQuery({ + builderQueryFn: createGetTraderDerivativeConditionalOrders, + queryKeyPrefix: "TraderDerivativeConditionalOrdersQuery" +}); +export const useGetMarketAtomicExecutionFeeMultiplier = buildUseVueQuery({ + builderQueryFn: createGetMarketAtomicExecutionFeeMultiplier, + queryKeyPrefix: "MarketAtomicExecutionFeeMultiplierQuery" +}); +export const useGetActiveStakeGrant = buildUseVueQuery({ + builderQueryFn: createGetActiveStakeGrant, + queryKeyPrefix: "ActiveStakeGrantQuery" +}); +export const useGetGrantAuthorization = buildUseVueQuery({ + builderQueryFn: createGetGrantAuthorization, + queryKeyPrefix: "GrantAuthorizationQuery" +}); +export const useGetGrantAuthorizations = buildUseVueQuery({ + builderQueryFn: createGetGrantAuthorizations, + queryKeyPrefix: "GrantAuthorizationsQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/query.ts b/libs/injective-vue/src/injective/exchange/v1beta1/query.ts index 8edd2a7b..a03e3cd0 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/query.ts @@ -4,7 +4,6 @@ import { MetadataStatistics, MetadataStatisticsAmino } from "../../oracle/v1beta import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export enum OrderSide { /** Side_Unspecified - will return both */ Side_Unspecified = 0, @@ -88,10 +87,6 @@ export interface Subaccount { trader: string; subaccountNonce: number; } -export interface ReactiveSubaccount { - trader: ComputedRef; - subaccountNonce: ComputedRef; -} export interface SubaccountProtoMsg { typeUrl: "/injective.exchange.v1beta1.Subaccount"; value: Uint8Array; @@ -108,10 +103,6 @@ export interface QuerySubaccountOrdersRequest { subaccountId: string; marketId: string; } -export interface ReactiveQuerySubaccountOrdersRequest { - subaccountId: ComputedRef; - marketId: ComputedRef; -} export interface QuerySubaccountOrdersRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest"; value: Uint8Array; @@ -128,10 +119,6 @@ export interface QuerySubaccountOrdersResponse { buyOrders: SubaccountOrderData[]; sellOrders: SubaccountOrderData[]; } -export interface ReactiveQuerySubaccountOrdersResponse { - buyOrders: ComputedRef; - sellOrders: ComputedRef; -} export interface QuerySubaccountOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse"; value: Uint8Array; @@ -149,11 +136,6 @@ export interface SubaccountOrderbookMetadataWithMarket { marketId: string; isBuy: boolean; } -export interface ReactiveSubaccountOrderbookMetadataWithMarket { - metadata?: ComputedRef; - marketId: ComputedRef; - isBuy: ComputedRef; -} export interface SubaccountOrderbookMetadataWithMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket"; value: Uint8Array; @@ -172,7 +154,6 @@ export interface SubaccountOrderbookMetadataWithMarketAminoMsg { * RPC method. */ export interface QueryExchangeParamsRequest {} -export interface ReactiveQueryExchangeParamsRequest {} export interface QueryExchangeParamsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsRequest"; value: Uint8Array; @@ -193,9 +174,6 @@ export interface QueryExchangeParamsRequestAminoMsg { export interface QueryExchangeParamsResponse { params: Params; } -export interface ReactiveQueryExchangeParamsResponse { - params: ComputedRef; -} export interface QueryExchangeParamsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsResponse"; value: Uint8Array; @@ -219,10 +197,6 @@ export interface QuerySubaccountDepositsRequest { subaccountId: string; subaccount?: Subaccount; } -export interface ReactiveQuerySubaccountDepositsRequest { - subaccountId: ComputedRef; - subaccount?: ComputedRef; -} export interface QuerySubaccountDepositsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest"; value: Uint8Array; @@ -243,10 +217,6 @@ export interface QuerySubaccountDepositsResponse_DepositsEntry { key: string; value?: Deposit; } -export interface ReactiveQuerySubaccountDepositsResponse_DepositsEntry { - key: ComputedRef; - value?: ComputedRef; -} export interface QuerySubaccountDepositsResponse_DepositsEntryProtoMsg { typeUrl: string; value: Uint8Array; @@ -268,11 +238,6 @@ export interface QuerySubaccountDepositsResponse { [key: string]: Deposit; }; } -export interface ReactiveQuerySubaccountDepositsResponse { - deposits: ComputedRef<{ - [key: string]: Deposit; - }>; -} export interface QuerySubaccountDepositsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse"; value: Uint8Array; @@ -295,7 +260,6 @@ export interface QuerySubaccountDepositsResponseAminoMsg { * Query/ExchangeBalances RPC method. */ export interface QueryExchangeBalancesRequest {} -export interface ReactiveQueryExchangeBalancesRequest {} export interface QueryExchangeBalancesRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest"; value: Uint8Array; @@ -316,9 +280,6 @@ export interface QueryExchangeBalancesRequestAminoMsg { export interface QueryExchangeBalancesResponse { balances: Balance[]; } -export interface ReactiveQueryExchangeBalancesResponse { - balances: ComputedRef; -} export interface QueryExchangeBalancesResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse"; value: Uint8Array; @@ -342,9 +303,6 @@ export interface QueryAggregateVolumeRequest { /** can either be an address or a subaccount */ account: string; } -export interface ReactiveQueryAggregateVolumeRequest { - account: ComputedRef; -} export interface QueryAggregateVolumeRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest"; value: Uint8Array; @@ -372,9 +330,6 @@ export interface QueryAggregateVolumeResponse { */ aggregateVolumes: MarketVolume[]; } -export interface ReactiveQueryAggregateVolumeResponse { - aggregateVolumes: ComputedRef; -} export interface QueryAggregateVolumeResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse"; value: Uint8Array; @@ -402,10 +357,6 @@ export interface QueryAggregateVolumesRequest { accounts: string[]; marketIds: string[]; } -export interface ReactiveQueryAggregateVolumesRequest { - accounts: ComputedRef; - marketIds: ComputedRef; -} export interface QueryAggregateVolumesRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest"; value: Uint8Array; @@ -432,10 +383,6 @@ export interface QueryAggregateVolumesResponse { /** the aggregate volumes for the markets specified */ aggregateMarketVolumes: MarketVolume[]; } -export interface ReactiveQueryAggregateVolumesResponse { - aggregateAccountVolumes: ComputedRef; - aggregateMarketVolumes: ComputedRef; -} export interface QueryAggregateVolumesResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse"; value: Uint8Array; @@ -461,9 +408,6 @@ export interface QueryAggregateVolumesResponseAminoMsg { export interface QueryAggregateMarketVolumeRequest { marketId: string; } -export interface ReactiveQueryAggregateMarketVolumeRequest { - marketId: ComputedRef; -} export interface QueryAggregateMarketVolumeRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest"; value: Uint8Array; @@ -486,9 +430,6 @@ export interface QueryAggregateMarketVolumeRequestAminoMsg { export interface QueryAggregateMarketVolumeResponse { volume: VolumeRecord; } -export interface ReactiveQueryAggregateMarketVolumeResponse { - volume: ComputedRef; -} export interface QueryAggregateMarketVolumeResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse"; value: Uint8Array; @@ -511,9 +452,6 @@ export interface QueryAggregateMarketVolumeResponseAminoMsg { export interface QueryDenomDecimalRequest { denom: string; } -export interface ReactiveQueryDenomDecimalRequest { - denom: ComputedRef; -} export interface QueryDenomDecimalRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalRequest"; value: Uint8Array; @@ -536,9 +474,6 @@ export interface QueryDenomDecimalRequestAminoMsg { export interface QueryDenomDecimalResponse { decimal: bigint; } -export interface ReactiveQueryDenomDecimalResponse { - decimal: ComputedRef; -} export interface QueryDenomDecimalResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalResponse"; value: Uint8Array; @@ -562,9 +497,6 @@ export interface QueryDenomDecimalsRequest { /** denoms can be empty to query all denom decimals */ denoms: string[]; } -export interface ReactiveQueryDenomDecimalsRequest { - denoms: ComputedRef; -} export interface QueryDenomDecimalsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest"; value: Uint8Array; @@ -588,9 +520,6 @@ export interface QueryDenomDecimalsRequestAminoMsg { export interface QueryDenomDecimalsResponse { denomDecimals: DenomDecimals[]; } -export interface ReactiveQueryDenomDecimalsResponse { - denomDecimals: ComputedRef; -} export interface QueryDenomDecimalsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse"; value: Uint8Array; @@ -613,9 +542,6 @@ export interface QueryDenomDecimalsResponseAminoMsg { export interface QueryAggregateMarketVolumesRequest { marketIds: string[]; } -export interface ReactiveQueryAggregateMarketVolumesRequest { - marketIds: ComputedRef; -} export interface QueryAggregateMarketVolumesRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest"; value: Uint8Array; @@ -639,9 +565,6 @@ export interface QueryAggregateMarketVolumesResponse { /** the aggregate volumes for the entire market */ volumes: MarketVolume[]; } -export interface ReactiveQueryAggregateMarketVolumesResponse { - volumes: ComputedRef; -} export interface QueryAggregateMarketVolumesResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse"; value: Uint8Array; @@ -666,10 +589,6 @@ export interface QuerySubaccountDepositRequest { subaccountId: string; denom: string; } -export interface ReactiveQuerySubaccountDepositRequest { - subaccountId: ComputedRef; - denom: ComputedRef; -} export interface QuerySubaccountDepositRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest"; value: Uint8Array; @@ -693,9 +612,6 @@ export interface QuerySubaccountDepositRequestAminoMsg { export interface QuerySubaccountDepositResponse { deposits?: Deposit; } -export interface ReactiveQuerySubaccountDepositResponse { - deposits?: ComputedRef; -} export interface QuerySubaccountDepositResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse"; value: Uint8Array; @@ -721,10 +637,6 @@ export interface QuerySpotMarketsRequest { /** Filter by market IDs */ marketIds: string[]; } -export interface ReactiveQuerySpotMarketsRequest { - status: ComputedRef; - marketIds: ComputedRef; -} export interface QuerySpotMarketsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsRequest"; value: Uint8Array; @@ -750,9 +662,6 @@ export interface QuerySpotMarketsRequestAminoMsg { export interface QuerySpotMarketsResponse { markets: SpotMarket[]; } -export interface ReactiveQuerySpotMarketsResponse { - markets: ComputedRef; -} export interface QuerySpotMarketsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsResponse"; value: Uint8Array; @@ -776,9 +685,6 @@ export interface QuerySpotMarketRequest { /** Market ID for the market */ marketId: string; } -export interface ReactiveQuerySpotMarketRequest { - marketId: ComputedRef; -} export interface QuerySpotMarketRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketRequest"; value: Uint8Array; @@ -802,9 +708,6 @@ export interface QuerySpotMarketRequestAminoMsg { export interface QuerySpotMarketResponse { market?: SpotMarket; } -export interface ReactiveQuerySpotMarketResponse { - market?: ComputedRef; -} export interface QuerySpotMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketResponse"; value: Uint8Array; @@ -832,13 +735,6 @@ export interface QuerySpotOrderbookRequest { limitCumulativeNotional?: string; limitCumulativeQuantity?: string; } -export interface ReactiveQuerySpotOrderbookRequest { - marketId: ComputedRef; - limit: ComputedRef; - orderSide: ComputedRef; - limitCumulativeNotional?: ComputedRef; - limitCumulativeQuantity?: ComputedRef; -} export interface QuerySpotOrderbookRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest"; value: Uint8Array; @@ -867,10 +763,6 @@ export interface QuerySpotOrderbookResponse { buysPriceLevel: Level[]; sellsPriceLevel: Level[]; } -export interface ReactiveQuerySpotOrderbookResponse { - buysPriceLevel: ComputedRef; - sellsPriceLevel: ComputedRef; -} export interface QuerySpotOrderbookResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse"; value: Uint8Array; @@ -895,10 +787,6 @@ export interface FullSpotMarket { */ midPriceAndTob?: MidPriceAndTOB; } -export interface ReactiveFullSpotMarket { - market?: ComputedRef; - midPriceAndTob?: ComputedRef; -} export interface FullSpotMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.FullSpotMarket"; value: Uint8Array; @@ -930,11 +818,6 @@ export interface QueryFullSpotMarketsRequest { */ withMidPriceAndTob: boolean; } -export interface ReactiveQueryFullSpotMarketsRequest { - status: ComputedRef; - marketIds: ComputedRef; - withMidPriceAndTob: ComputedRef; -} export interface QueryFullSpotMarketsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest"; value: Uint8Array; @@ -965,9 +848,6 @@ export interface QueryFullSpotMarketsRequestAminoMsg { export interface QueryFullSpotMarketsResponse { markets: FullSpotMarket[]; } -export interface ReactiveQueryFullSpotMarketsResponse { - markets: ComputedRef; -} export interface QueryFullSpotMarketsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse"; value: Uint8Array; @@ -996,10 +876,6 @@ export interface QueryFullSpotMarketRequest { */ withMidPriceAndTob: boolean; } -export interface ReactiveQueryFullSpotMarketRequest { - marketId: ComputedRef; - withMidPriceAndTob: ComputedRef; -} export interface QueryFullSpotMarketRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest"; value: Uint8Array; @@ -1028,9 +904,6 @@ export interface QueryFullSpotMarketRequestAminoMsg { export interface QueryFullSpotMarketResponse { market?: FullSpotMarket; } -export interface ReactiveQueryFullSpotMarketResponse { - market?: ComputedRef; -} export interface QueryFullSpotMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse"; value: Uint8Array; @@ -1058,11 +931,6 @@ export interface QuerySpotOrdersByHashesRequest { /** the order hashes */ orderHashes: string[]; } -export interface ReactiveQuerySpotOrdersByHashesRequest { - marketId: ComputedRef; - subaccountId: ComputedRef; - orderHashes: ComputedRef; -} export interface QuerySpotOrdersByHashesRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest"; value: Uint8Array; @@ -1090,9 +958,6 @@ export interface QuerySpotOrdersByHashesRequestAminoMsg { export interface QuerySpotOrdersByHashesResponse { orders: TrimmedSpotLimitOrder[]; } -export interface ReactiveQuerySpotOrdersByHashesResponse { - orders: ComputedRef; -} export interface QuerySpotOrdersByHashesResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse"; value: Uint8Array; @@ -1118,10 +983,6 @@ export interface QueryTraderSpotOrdersRequest { /** SubaccountID of the trader */ subaccountId: string; } -export interface ReactiveQueryTraderSpotOrdersRequest { - marketId: ComputedRef; - subaccountId: ComputedRef; -} export interface QueryTraderSpotOrdersRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest"; value: Uint8Array; @@ -1150,10 +1011,6 @@ export interface QueryAccountAddressSpotOrdersRequest { /** Account address of the trader */ accountAddress: string; } -export interface ReactiveQueryAccountAddressSpotOrdersRequest { - marketId: ComputedRef; - accountAddress: ComputedRef; -} export interface QueryAccountAddressSpotOrdersRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest"; value: Uint8Array; @@ -1184,14 +1041,6 @@ export interface TrimmedSpotLimitOrder { orderHash: string; cid: string; } -export interface ReactiveTrimmedSpotLimitOrder { - price: ComputedRef; - quantity: ComputedRef; - fillable: ComputedRef; - isBuy: ComputedRef; - orderHash: ComputedRef; - cid: ComputedRef; -} export interface TrimmedSpotLimitOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder"; value: Uint8Array; @@ -1219,9 +1068,6 @@ export interface TrimmedSpotLimitOrderAminoMsg { export interface QueryTraderSpotOrdersResponse { orders: TrimmedSpotLimitOrder[]; } -export interface ReactiveQueryTraderSpotOrdersResponse { - orders: ComputedRef; -} export interface QueryTraderSpotOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse"; value: Uint8Array; @@ -1244,9 +1090,6 @@ export interface QueryTraderSpotOrdersResponseAminoMsg { export interface QueryAccountAddressSpotOrdersResponse { orders: TrimmedSpotLimitOrder[]; } -export interface ReactiveQueryAccountAddressSpotOrdersResponse { - orders: ComputedRef; -} export interface QueryAccountAddressSpotOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse"; value: Uint8Array; @@ -1270,9 +1113,6 @@ export interface QuerySpotMidPriceAndTOBRequest { /** Market ID for the market */ marketId: string; } -export interface ReactiveQuerySpotMidPriceAndTOBRequest { - marketId: ComputedRef; -} export interface QuerySpotMidPriceAndTOBRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest"; value: Uint8Array; @@ -1301,11 +1141,6 @@ export interface QuerySpotMidPriceAndTOBResponse { /** best sell price of the market */ bestSellPrice?: string; } -export interface ReactiveQuerySpotMidPriceAndTOBResponse { - midPrice?: ComputedRef; - bestBuyPrice?: ComputedRef; - bestSellPrice?: ComputedRef; -} export interface QuerySpotMidPriceAndTOBResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse"; value: Uint8Array; @@ -1334,9 +1169,6 @@ export interface QueryDerivativeMidPriceAndTOBRequest { /** Market ID for the market */ marketId: string; } -export interface ReactiveQueryDerivativeMidPriceAndTOBRequest { - marketId: ComputedRef; -} export interface QueryDerivativeMidPriceAndTOBRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest"; value: Uint8Array; @@ -1365,11 +1197,6 @@ export interface QueryDerivativeMidPriceAndTOBResponse { /** best sell price of the market */ bestSellPrice?: string; } -export interface ReactiveQueryDerivativeMidPriceAndTOBResponse { - midPrice?: ComputedRef; - bestBuyPrice?: ComputedRef; - bestSellPrice?: ComputedRef; -} export interface QueryDerivativeMidPriceAndTOBResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse"; value: Uint8Array; @@ -1400,11 +1227,6 @@ export interface QueryDerivativeOrderbookRequest { limit: bigint; limitCumulativeNotional?: string; } -export interface ReactiveQueryDerivativeOrderbookRequest { - marketId: ComputedRef; - limit: ComputedRef; - limitCumulativeNotional?: ComputedRef; -} export interface QueryDerivativeOrderbookRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest"; value: Uint8Array; @@ -1431,10 +1253,6 @@ export interface QueryDerivativeOrderbookResponse { buysPriceLevel: Level[]; sellsPriceLevel: Level[]; } -export interface ReactiveQueryDerivativeOrderbookResponse { - buysPriceLevel: ComputedRef; - sellsPriceLevel: ComputedRef; -} export interface QueryDerivativeOrderbookResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse"; value: Uint8Array; @@ -1472,14 +1290,6 @@ export interface QueryTraderSpotOrdersToCancelUpToAmountRequest { */ referencePrice?: string; } -export interface ReactiveQueryTraderSpotOrdersToCancelUpToAmountRequest { - marketId: ComputedRef; - subaccountId: ComputedRef; - baseAmount: ComputedRef; - quoteAmount: ComputedRef; - strategy: ComputedRef; - referencePrice?: ComputedRef; -} export interface QueryTraderSpotOrdersToCancelUpToAmountRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest"; value: Uint8Array; @@ -1528,13 +1338,6 @@ export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequest { */ referencePrice?: string; } -export interface ReactiveQueryTraderDerivativeOrdersToCancelUpToAmountRequest { - marketId: ComputedRef; - subaccountId: ComputedRef; - quoteAmount: ComputedRef; - strategy: ComputedRef; - referencePrice?: ComputedRef; -} export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest"; value: Uint8Array; @@ -1572,10 +1375,6 @@ export interface QueryTraderDerivativeOrdersRequest { /** SubaccountID of the trader */ subaccountId: string; } -export interface ReactiveQueryTraderDerivativeOrdersRequest { - marketId: ComputedRef; - subaccountId: ComputedRef; -} export interface QueryTraderDerivativeOrdersRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest"; value: Uint8Array; @@ -1604,10 +1403,6 @@ export interface QueryAccountAddressDerivativeOrdersRequest { /** Account address of the trader */ accountAddress: string; } -export interface ReactiveQueryAccountAddressDerivativeOrdersRequest { - marketId: ComputedRef; - accountAddress: ComputedRef; -} export interface QueryAccountAddressDerivativeOrdersRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest"; value: Uint8Array; @@ -1640,15 +1435,6 @@ export interface TrimmedDerivativeLimitOrder { orderHash: string; cid: string; } -export interface ReactiveTrimmedDerivativeLimitOrder { - price: ComputedRef; - quantity: ComputedRef; - margin: ComputedRef; - fillable: ComputedRef; - isBuy: ComputedRef; - orderHash: ComputedRef; - cid: ComputedRef; -} export interface TrimmedDerivativeLimitOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder"; value: Uint8Array; @@ -1678,9 +1464,6 @@ export interface TrimmedDerivativeLimitOrderAminoMsg { export interface QueryTraderDerivativeOrdersResponse { orders: TrimmedDerivativeLimitOrder[]; } -export interface ReactiveQueryTraderDerivativeOrdersResponse { - orders: ComputedRef; -} export interface QueryTraderDerivativeOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse"; value: Uint8Array; @@ -1703,9 +1486,6 @@ export interface QueryTraderDerivativeOrdersResponseAminoMsg { export interface QueryAccountAddressDerivativeOrdersResponse { orders: TrimmedDerivativeLimitOrder[]; } -export interface ReactiveQueryAccountAddressDerivativeOrdersResponse { - orders: ComputedRef; -} export interface QueryAccountAddressDerivativeOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse"; value: Uint8Array; @@ -1733,11 +1513,6 @@ export interface QueryDerivativeOrdersByHashesRequest { /** the order hashes */ orderHashes: string[]; } -export interface ReactiveQueryDerivativeOrdersByHashesRequest { - marketId: ComputedRef; - subaccountId: ComputedRef; - orderHashes: ComputedRef; -} export interface QueryDerivativeOrdersByHashesRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest"; value: Uint8Array; @@ -1765,9 +1540,6 @@ export interface QueryDerivativeOrdersByHashesRequestAminoMsg { export interface QueryDerivativeOrdersByHashesResponse { orders: TrimmedDerivativeLimitOrder[]; } -export interface ReactiveQueryDerivativeOrdersByHashesResponse { - orders: ComputedRef; -} export interface QueryDerivativeOrdersByHashesResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse"; value: Uint8Array; @@ -1798,11 +1570,6 @@ export interface QueryDerivativeMarketsRequest { */ withMidPriceAndTob: boolean; } -export interface ReactiveQueryDerivativeMarketsRequest { - status: ComputedRef; - marketIds: ComputedRef; - withMidPriceAndTob: ComputedRef; -} export interface QueryDerivativeMarketsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest"; value: Uint8Array; @@ -1831,10 +1598,6 @@ export interface PriceLevel { /** quantity */ quantity: string; } -export interface ReactivePriceLevel { - price: ComputedRef; - quantity: ComputedRef; -} export interface PriceLevelProtoMsg { typeUrl: "/injective.exchange.v1beta1.PriceLevel"; value: Uint8Array; @@ -1852,10 +1615,6 @@ export interface PerpetualMarketState { marketInfo?: PerpetualMarketInfo; fundingInfo?: PerpetualMarketFunding; } -export interface ReactivePerpetualMarketState { - marketInfo?: ComputedRef; - fundingInfo?: ComputedRef; -} export interface PerpetualMarketStateProtoMsg { typeUrl: "/injective.exchange.v1beta1.PerpetualMarketState"; value: Uint8Array; @@ -1879,13 +1638,6 @@ export interface FullDerivativeMarket { */ midPriceAndTob?: MidPriceAndTOB; } -export interface ReactiveFullDerivativeMarket { - market?: ComputedRef; - perpetualInfo?: ComputedRef; - futuresInfo?: ComputedRef; - markPrice: ComputedRef; - midPriceAndTob?: ComputedRef; -} export interface FullDerivativeMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.FullDerivativeMarket"; value: Uint8Array; @@ -1912,9 +1664,6 @@ export interface FullDerivativeMarketAminoMsg { export interface QueryDerivativeMarketsResponse { markets: FullDerivativeMarket[]; } -export interface ReactiveQueryDerivativeMarketsResponse { - markets: ComputedRef; -} export interface QueryDerivativeMarketsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse"; value: Uint8Array; @@ -1938,9 +1687,6 @@ export interface QueryDerivativeMarketRequest { /** Market ID for the market */ marketId: string; } -export interface ReactiveQueryDerivativeMarketRequest { - marketId: ComputedRef; -} export interface QueryDerivativeMarketRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest"; value: Uint8Array; @@ -1964,9 +1710,6 @@ export interface QueryDerivativeMarketRequestAminoMsg { export interface QueryDerivativeMarketResponse { market?: FullDerivativeMarket; } -export interface ReactiveQueryDerivativeMarketResponse { - market?: ComputedRef; -} export interface QueryDerivativeMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse"; value: Uint8Array; @@ -1990,9 +1733,6 @@ export interface QueryDerivativeMarketAddressRequest { /** Market ID for the market */ marketId: string; } -export interface ReactiveQueryDerivativeMarketAddressRequest { - marketId: ComputedRef; -} export interface QueryDerivativeMarketAddressRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest"; value: Uint8Array; @@ -2019,10 +1759,6 @@ export interface QueryDerivativeMarketAddressResponse { /** subaccountID for the market */ subaccountId: string; } -export interface ReactiveQueryDerivativeMarketAddressResponse { - address: ComputedRef; - subaccountId: ComputedRef; -} export interface QueryDerivativeMarketAddressResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse"; value: Uint8Array; @@ -2048,9 +1784,6 @@ export interface QueryDerivativeMarketAddressResponseAminoMsg { export interface QuerySubaccountTradeNonceRequest { subaccountId: string; } -export interface ReactiveQuerySubaccountTradeNonceRequest { - subaccountId: ComputedRef; -} export interface QuerySubaccountTradeNonceRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest"; value: Uint8Array; @@ -2073,9 +1806,6 @@ export interface QuerySubaccountTradeNonceRequestAminoMsg { export interface QuerySubaccountPositionsRequest { subaccountId: string; } -export interface ReactiveQuerySubaccountPositionsRequest { - subaccountId: ComputedRef; -} export interface QuerySubaccountPositionsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest"; value: Uint8Array; @@ -2099,10 +1829,6 @@ export interface QuerySubaccountPositionInMarketRequest { subaccountId: string; marketId: string; } -export interface ReactiveQuerySubaccountPositionInMarketRequest { - subaccountId: ComputedRef; - marketId: ComputedRef; -} export interface QuerySubaccountPositionInMarketRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest"; value: Uint8Array; @@ -2127,10 +1853,6 @@ export interface QuerySubaccountEffectivePositionInMarketRequest { subaccountId: string; marketId: string; } -export interface ReactiveQuerySubaccountEffectivePositionInMarketRequest { - subaccountId: ComputedRef; - marketId: ComputedRef; -} export interface QuerySubaccountEffectivePositionInMarketRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest"; value: Uint8Array; @@ -2154,9 +1876,6 @@ export interface QuerySubaccountEffectivePositionInMarketRequestAminoMsg { export interface QuerySubaccountOrderMetadataRequest { subaccountId: string; } -export interface ReactiveQuerySubaccountOrderMetadataRequest { - subaccountId: ComputedRef; -} export interface QuerySubaccountOrderMetadataRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest"; value: Uint8Array; @@ -2179,9 +1898,6 @@ export interface QuerySubaccountOrderMetadataRequestAminoMsg { export interface QuerySubaccountPositionsResponse { state: DerivativePosition[]; } -export interface ReactiveQuerySubaccountPositionsResponse { - state: ComputedRef; -} export interface QuerySubaccountPositionsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse"; value: Uint8Array; @@ -2204,9 +1920,6 @@ export interface QuerySubaccountPositionsResponseAminoMsg { export interface QuerySubaccountPositionInMarketResponse { state?: Position; } -export interface ReactiveQuerySubaccountPositionInMarketResponse { - state?: ComputedRef; -} export interface QuerySubaccountPositionInMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse"; value: Uint8Array; @@ -2228,12 +1941,6 @@ export interface EffectivePosition { entryPrice: string; effectiveMargin: string; } -export interface ReactiveEffectivePosition { - isLong: ComputedRef; - quantity: ComputedRef; - entryPrice: ComputedRef; - effectiveMargin: ComputedRef; -} export interface EffectivePositionProtoMsg { typeUrl: "/injective.exchange.v1beta1.EffectivePosition"; value: Uint8Array; @@ -2255,9 +1962,6 @@ export interface EffectivePositionAminoMsg { export interface QuerySubaccountEffectivePositionInMarketResponse { state?: EffectivePosition; } -export interface ReactiveQuerySubaccountEffectivePositionInMarketResponse { - state?: ComputedRef; -} export interface QuerySubaccountEffectivePositionInMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse"; value: Uint8Array; @@ -2280,9 +1984,6 @@ export interface QuerySubaccountEffectivePositionInMarketResponseAminoMsg { export interface QueryPerpetualMarketInfoRequest { marketId: string; } -export interface ReactiveQueryPerpetualMarketInfoRequest { - marketId: ComputedRef; -} export interface QueryPerpetualMarketInfoRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest"; value: Uint8Array; @@ -2305,9 +2006,6 @@ export interface QueryPerpetualMarketInfoRequestAminoMsg { export interface QueryPerpetualMarketInfoResponse { info: PerpetualMarketInfo; } -export interface ReactiveQueryPerpetualMarketInfoResponse { - info: ComputedRef; -} export interface QueryPerpetualMarketInfoResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse"; value: Uint8Array; @@ -2330,9 +2028,6 @@ export interface QueryPerpetualMarketInfoResponseAminoMsg { export interface QueryExpiryFuturesMarketInfoRequest { marketId: string; } -export interface ReactiveQueryExpiryFuturesMarketInfoRequest { - marketId: ComputedRef; -} export interface QueryExpiryFuturesMarketInfoRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest"; value: Uint8Array; @@ -2355,9 +2050,6 @@ export interface QueryExpiryFuturesMarketInfoRequestAminoMsg { export interface QueryExpiryFuturesMarketInfoResponse { info: ExpiryFuturesMarketInfo; } -export interface ReactiveQueryExpiryFuturesMarketInfoResponse { - info: ComputedRef; -} export interface QueryExpiryFuturesMarketInfoResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse"; value: Uint8Array; @@ -2380,9 +2072,6 @@ export interface QueryExpiryFuturesMarketInfoResponseAminoMsg { export interface QueryPerpetualMarketFundingRequest { marketId: string; } -export interface ReactiveQueryPerpetualMarketFundingRequest { - marketId: ComputedRef; -} export interface QueryPerpetualMarketFundingRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest"; value: Uint8Array; @@ -2405,9 +2094,6 @@ export interface QueryPerpetualMarketFundingRequestAminoMsg { export interface QueryPerpetualMarketFundingResponse { state: PerpetualMarketFunding; } -export interface ReactiveQueryPerpetualMarketFundingResponse { - state: ComputedRef; -} export interface QueryPerpetualMarketFundingResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse"; value: Uint8Array; @@ -2430,9 +2116,6 @@ export interface QueryPerpetualMarketFundingResponseAminoMsg { export interface QuerySubaccountOrderMetadataResponse { metadata: SubaccountOrderbookMetadataWithMarket[]; } -export interface ReactiveQuerySubaccountOrderMetadataResponse { - metadata: ComputedRef; -} export interface QuerySubaccountOrderMetadataResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse"; value: Uint8Array; @@ -2455,9 +2138,6 @@ export interface QuerySubaccountOrderMetadataResponseAminoMsg { export interface QuerySubaccountTradeNonceResponse { nonce: number; } -export interface ReactiveQuerySubaccountTradeNonceResponse { - nonce: ComputedRef; -} export interface QuerySubaccountTradeNonceResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse"; value: Uint8Array; @@ -2478,7 +2158,6 @@ export interface QuerySubaccountTradeNonceResponseAminoMsg { * RPC method. */ export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryModuleStateRequest"; value: Uint8Array; @@ -2499,9 +2178,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryModuleStateResponse"; value: Uint8Array; @@ -2519,7 +2195,6 @@ export interface QueryModuleStateResponseAminoMsg { } /** QueryPositionsRequest is the request type for the Query/Positions RPC method. */ export interface QueryPositionsRequest {} -export interface ReactiveQueryPositionsRequest {} export interface QueryPositionsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryPositionsRequest"; value: Uint8Array; @@ -2537,9 +2212,6 @@ export interface QueryPositionsRequestAminoMsg { export interface QueryPositionsResponse { state: DerivativePosition[]; } -export interface ReactiveQueryPositionsResponse { - state: ComputedRef; -} export interface QueryPositionsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryPositionsResponse"; value: Uint8Array; @@ -2563,10 +2235,6 @@ export interface QueryTradeRewardPointsRequest { accounts: string[]; pendingPoolTimestamp: bigint; } -export interface ReactiveQueryTradeRewardPointsRequest { - accounts: ComputedRef; - pendingPoolTimestamp: ComputedRef; -} export interface QueryTradeRewardPointsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest"; value: Uint8Array; @@ -2590,9 +2258,6 @@ export interface QueryTradeRewardPointsRequestAminoMsg { export interface QueryTradeRewardPointsResponse { accountTradeRewardPoints: string[]; } -export interface ReactiveQueryTradeRewardPointsResponse { - accountTradeRewardPoints: ComputedRef; -} export interface QueryTradeRewardPointsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse"; value: Uint8Array; @@ -2613,7 +2278,6 @@ export interface QueryTradeRewardPointsResponseAminoMsg { * Query/TradeRewardCampaign RPC method. */ export interface QueryTradeRewardCampaignRequest {} -export interface ReactiveQueryTradeRewardCampaignRequest {} export interface QueryTradeRewardCampaignRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest"; value: Uint8Array; @@ -2638,13 +2302,6 @@ export interface QueryTradeRewardCampaignResponse { pendingTradingRewardPoolCampaignSchedule: CampaignRewardPool[]; pendingTotalTradeRewardPoints: string[]; } -export interface ReactiveQueryTradeRewardCampaignResponse { - tradingRewardCampaignInfo?: ComputedRef; - tradingRewardPoolCampaignSchedule: ComputedRef; - totalTradeRewardPoints: ComputedRef; - pendingTradingRewardPoolCampaignSchedule: ComputedRef; - pendingTotalTradeRewardPoints: ComputedRef; -} export interface QueryTradeRewardCampaignResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse"; value: Uint8Array; @@ -2671,9 +2328,6 @@ export interface QueryTradeRewardCampaignResponseAminoMsg { export interface QueryIsOptedOutOfRewardsRequest { account: string; } -export interface ReactiveQueryIsOptedOutOfRewardsRequest { - account: ComputedRef; -} export interface QueryIsOptedOutOfRewardsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest"; value: Uint8Array; @@ -2696,9 +2350,6 @@ export interface QueryIsOptedOutOfRewardsRequestAminoMsg { export interface QueryIsOptedOutOfRewardsResponse { isOptedOut: boolean; } -export interface ReactiveQueryIsOptedOutOfRewardsResponse { - isOptedOut: ComputedRef; -} export interface QueryIsOptedOutOfRewardsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse"; value: Uint8Array; @@ -2719,7 +2370,6 @@ export interface QueryIsOptedOutOfRewardsResponseAminoMsg { * RPC method. */ export interface QueryOptedOutOfRewardsAccountsRequest {} -export interface ReactiveQueryOptedOutOfRewardsAccountsRequest {} export interface QueryOptedOutOfRewardsAccountsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest"; value: Uint8Array; @@ -2740,9 +2390,6 @@ export interface QueryOptedOutOfRewardsAccountsRequestAminoMsg { export interface QueryOptedOutOfRewardsAccountsResponse { accounts: string[]; } -export interface ReactiveQueryOptedOutOfRewardsAccountsResponse { - accounts: ComputedRef; -} export interface QueryOptedOutOfRewardsAccountsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse"; value: Uint8Array; @@ -2765,9 +2412,6 @@ export interface QueryOptedOutOfRewardsAccountsResponseAminoMsg { export interface QueryFeeDiscountAccountInfoRequest { account: string; } -export interface ReactiveQueryFeeDiscountAccountInfoRequest { - account: ComputedRef; -} export interface QueryFeeDiscountAccountInfoRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest"; value: Uint8Array; @@ -2792,11 +2436,6 @@ export interface QueryFeeDiscountAccountInfoResponse { accountInfo?: FeeDiscountTierInfo; accountTtl?: FeeDiscountTierTTL; } -export interface ReactiveQueryFeeDiscountAccountInfoResponse { - tierLevel: ComputedRef; - accountInfo?: ComputedRef; - accountTtl?: ComputedRef; -} export interface QueryFeeDiscountAccountInfoResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse"; value: Uint8Array; @@ -2819,7 +2458,6 @@ export interface QueryFeeDiscountAccountInfoResponseAminoMsg { * Query/FeeDiscountSchedule RPC method. */ export interface QueryFeeDiscountScheduleRequest {} -export interface ReactiveQueryFeeDiscountScheduleRequest {} export interface QueryFeeDiscountScheduleRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest"; value: Uint8Array; @@ -2840,9 +2478,6 @@ export interface QueryFeeDiscountScheduleRequestAminoMsg { export interface QueryFeeDiscountScheduleResponse { feeDiscountSchedule?: FeeDiscountSchedule; } -export interface ReactiveQueryFeeDiscountScheduleResponse { - feeDiscountSchedule?: ComputedRef; -} export interface QueryFeeDiscountScheduleResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse"; value: Uint8Array; @@ -2865,9 +2500,6 @@ export interface QueryFeeDiscountScheduleResponseAminoMsg { export interface QueryBalanceMismatchesRequest { dustFactor: bigint; } -export interface ReactiveQueryBalanceMismatchesRequest { - dustFactor: ComputedRef; -} export interface QueryBalanceMismatchesRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest"; value: Uint8Array; @@ -2892,15 +2524,6 @@ export interface BalanceMismatch { expectedTotal: string; difference: string; } -export interface ReactiveBalanceMismatch { - subaccountId: ComputedRef; - denom: ComputedRef; - available: ComputedRef; - total: ComputedRef; - balanceHold: ComputedRef; - expectedTotal: ComputedRef; - difference: ComputedRef; -} export interface BalanceMismatchProtoMsg { typeUrl: "/injective.exchange.v1beta1.BalanceMismatch"; value: Uint8Array; @@ -2925,9 +2548,6 @@ export interface BalanceMismatchAminoMsg { export interface QueryBalanceMismatchesResponse { balanceMismatches: BalanceMismatch[]; } -export interface ReactiveQueryBalanceMismatchesResponse { - balanceMismatches: ComputedRef; -} export interface QueryBalanceMismatchesResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse"; value: Uint8Array; @@ -2948,7 +2568,6 @@ export interface QueryBalanceMismatchesResponseAminoMsg { * Query/QueryBalanceWithBalanceHolds RPC method. */ export interface QueryBalanceWithBalanceHoldsRequest {} -export interface ReactiveQueryBalanceWithBalanceHoldsRequest {} export interface QueryBalanceWithBalanceHoldsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest"; value: Uint8Array; @@ -2969,13 +2588,6 @@ export interface BalanceWithMarginHold { total: string; balanceHold: string; } -export interface ReactiveBalanceWithMarginHold { - subaccountId: ComputedRef; - denom: ComputedRef; - available: ComputedRef; - total: ComputedRef; - balanceHold: ComputedRef; -} export interface BalanceWithMarginHoldProtoMsg { typeUrl: "/injective.exchange.v1beta1.BalanceWithMarginHold"; value: Uint8Array; @@ -2998,9 +2610,6 @@ export interface BalanceWithMarginHoldAminoMsg { export interface QueryBalanceWithBalanceHoldsResponse { balanceWithBalanceHolds: BalanceWithMarginHold[]; } -export interface ReactiveQueryBalanceWithBalanceHoldsResponse { - balanceWithBalanceHolds: ComputedRef; -} export interface QueryBalanceWithBalanceHoldsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse"; value: Uint8Array; @@ -3021,7 +2630,6 @@ export interface QueryBalanceWithBalanceHoldsResponseAminoMsg { * Query/QueryFeeDiscountTierStatistics RPC method. */ export interface QueryFeeDiscountTierStatisticsRequest {} -export interface ReactiveQueryFeeDiscountTierStatisticsRequest {} export interface QueryFeeDiscountTierStatisticsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest"; value: Uint8Array; @@ -3039,10 +2647,6 @@ export interface TierStatistic { tier: bigint; count: bigint; } -export interface ReactiveTierStatistic { - tier: ComputedRef; - count: ComputedRef; -} export interface TierStatisticProtoMsg { typeUrl: "/injective.exchange.v1beta1.TierStatistic"; value: Uint8Array; @@ -3062,9 +2666,6 @@ export interface TierStatisticAminoMsg { export interface QueryFeeDiscountTierStatisticsResponse { statistics: TierStatistic[]; } -export interface ReactiveQueryFeeDiscountTierStatisticsResponse { - statistics: ComputedRef; -} export interface QueryFeeDiscountTierStatisticsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse"; value: Uint8Array; @@ -3085,7 +2686,6 @@ export interface QueryFeeDiscountTierStatisticsResponseAminoMsg { * method. */ export interface MitoVaultInfosRequest {} -export interface ReactiveMitoVaultInfosRequest {} export interface MitoVaultInfosRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosRequest"; value: Uint8Array; @@ -3109,12 +2709,6 @@ export interface MitoVaultInfosResponse { spotAddresses: string[]; cw20Addresses: string[]; } -export interface ReactiveMitoVaultInfosResponse { - masterAddresses: ComputedRef; - derivativeAddresses: ComputedRef; - spotAddresses: ComputedRef; - cw20Addresses: ComputedRef; -} export interface MitoVaultInfosResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosResponse"; value: Uint8Array; @@ -3140,9 +2734,6 @@ export interface MitoVaultInfosResponseAminoMsg { export interface QueryMarketIDFromVaultRequest { vaultAddress: string; } -export interface ReactiveQueryMarketIDFromVaultRequest { - vaultAddress: ComputedRef; -} export interface QueryMarketIDFromVaultRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest"; value: Uint8Array; @@ -3165,9 +2756,6 @@ export interface QueryMarketIDFromVaultRequestAminoMsg { export interface QueryMarketIDFromVaultResponse { marketId: string; } -export interface ReactiveQueryMarketIDFromVaultResponse { - marketId: ComputedRef; -} export interface QueryMarketIDFromVaultResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse"; value: Uint8Array; @@ -3186,9 +2774,6 @@ export interface QueryMarketIDFromVaultResponseAminoMsg { export interface QueryHistoricalTradeRecordsRequest { marketId: string; } -export interface ReactiveQueryHistoricalTradeRecordsRequest { - marketId: ComputedRef; -} export interface QueryHistoricalTradeRecordsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest"; value: Uint8Array; @@ -3203,9 +2788,6 @@ export interface QueryHistoricalTradeRecordsRequestAminoMsg { export interface QueryHistoricalTradeRecordsResponse { tradeRecords: TradeRecords[]; } -export interface ReactiveQueryHistoricalTradeRecordsResponse { - tradeRecords: ComputedRef; -} export interface QueryHistoricalTradeRecordsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse"; value: Uint8Array; @@ -3241,12 +2823,6 @@ export interface TradeHistoryOptions { */ includeMetadata: boolean; } -export interface ReactiveTradeHistoryOptions { - tradeGroupingSec: ComputedRef; - maxAge: ComputedRef; - includeRawHistory: ComputedRef; - includeMetadata: ComputedRef; -} export interface TradeHistoryOptionsProtoMsg { typeUrl: "/injective.exchange.v1beta1.TradeHistoryOptions"; value: Uint8Array; @@ -3287,10 +2863,6 @@ export interface QueryMarketVolatilityRequest { marketId: string; tradeHistoryOptions?: TradeHistoryOptions; } -export interface ReactiveQueryMarketVolatilityRequest { - marketId: ComputedRef; - tradeHistoryOptions?: ComputedRef; -} export interface QueryMarketVolatilityRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest"; value: Uint8Array; @@ -3316,11 +2888,6 @@ export interface QueryMarketVolatilityResponse { historyMetadata?: MetadataStatistics; rawHistory: TradeRecord[]; } -export interface ReactiveQueryMarketVolatilityResponse { - volatility: ComputedRef; - historyMetadata?: ComputedRef; - rawHistory: ComputedRef; -} export interface QueryMarketVolatilityResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse"; value: Uint8Array; @@ -3346,9 +2913,6 @@ export interface QueryBinaryMarketsRequest { /** Status of the market, for convenience it is set to string - not enum */ status: string; } -export interface ReactiveQueryBinaryMarketsRequest { - status: ComputedRef; -} export interface QueryBinaryMarketsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest"; value: Uint8Array; @@ -3372,9 +2936,6 @@ export interface QueryBinaryMarketsRequestAminoMsg { export interface QueryBinaryMarketsResponse { markets: BinaryOptionsMarket[]; } -export interface ReactiveQueryBinaryMarketsResponse { - markets: ComputedRef; -} export interface QueryBinaryMarketsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse"; value: Uint8Array; @@ -3398,10 +2959,6 @@ export interface QueryTraderDerivativeConditionalOrdersRequest { subaccountId: string; marketId: string; } -export interface ReactiveQueryTraderDerivativeConditionalOrdersRequest { - subaccountId: ComputedRef; - marketId: ComputedRef; -} export interface QueryTraderDerivativeConditionalOrdersRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest"; value: Uint8Array; @@ -3433,16 +2990,6 @@ export interface TrimmedDerivativeConditionalOrder { orderHash: string; cid: string; } -export interface ReactiveTrimmedDerivativeConditionalOrder { - price: ComputedRef; - quantity: ComputedRef; - margin: ComputedRef; - triggerPrice: ComputedRef; - isBuy: ComputedRef; - isLimit: ComputedRef; - orderHash: ComputedRef; - cid: ComputedRef; -} export interface TrimmedDerivativeConditionalOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder"; value: Uint8Array; @@ -3473,9 +3020,6 @@ export interface TrimmedDerivativeConditionalOrderAminoMsg { export interface QueryTraderDerivativeConditionalOrdersResponse { orders: TrimmedDerivativeConditionalOrder[]; } -export interface ReactiveQueryTraderDerivativeConditionalOrdersResponse { - orders: ComputedRef; -} export interface QueryTraderDerivativeConditionalOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse"; value: Uint8Array; @@ -3494,9 +3038,6 @@ export interface QueryTraderDerivativeConditionalOrdersResponseAminoMsg { export interface QueryMarketAtomicExecutionFeeMultiplierRequest { marketId: string; } -export interface ReactiveQueryMarketAtomicExecutionFeeMultiplierRequest { - marketId: ComputedRef; -} export interface QueryMarketAtomicExecutionFeeMultiplierRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest"; value: Uint8Array; @@ -3511,9 +3052,6 @@ export interface QueryMarketAtomicExecutionFeeMultiplierRequestAminoMsg { export interface QueryMarketAtomicExecutionFeeMultiplierResponse { multiplier: string; } -export interface ReactiveQueryMarketAtomicExecutionFeeMultiplierResponse { - multiplier: ComputedRef; -} export interface QueryMarketAtomicExecutionFeeMultiplierResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse"; value: Uint8Array; @@ -3528,9 +3066,6 @@ export interface QueryMarketAtomicExecutionFeeMultiplierResponseAminoMsg { export interface QueryActiveStakeGrantRequest { grantee: string; } -export interface ReactiveQueryActiveStakeGrantRequest { - grantee: ComputedRef; -} export interface QueryActiveStakeGrantRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest"; value: Uint8Array; @@ -3546,10 +3081,6 @@ export interface QueryActiveStakeGrantResponse { grant?: ActiveGrant; effectiveGrant?: EffectiveGrant; } -export interface ReactiveQueryActiveStakeGrantResponse { - grant?: ComputedRef; - effectiveGrant?: ComputedRef; -} export interface QueryActiveStakeGrantResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse"; value: Uint8Array; @@ -3566,10 +3097,6 @@ export interface QueryGrantAuthorizationRequest { granter: string; grantee: string; } -export interface ReactiveQueryGrantAuthorizationRequest { - granter: ComputedRef; - grantee: ComputedRef; -} export interface QueryGrantAuthorizationRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest"; value: Uint8Array; @@ -3585,9 +3112,6 @@ export interface QueryGrantAuthorizationRequestAminoMsg { export interface QueryGrantAuthorizationResponse { amount: string; } -export interface ReactiveQueryGrantAuthorizationResponse { - amount: ComputedRef; -} export interface QueryGrantAuthorizationResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse"; value: Uint8Array; @@ -3602,9 +3126,6 @@ export interface QueryGrantAuthorizationResponseAminoMsg { export interface QueryGrantAuthorizationsRequest { granter: string; } -export interface ReactiveQueryGrantAuthorizationsRequest { - granter: ComputedRef; -} export interface QueryGrantAuthorizationsRequestProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest"; value: Uint8Array; @@ -3620,10 +3141,6 @@ export interface QueryGrantAuthorizationsResponse { totalGrantAmount: string; grants: GrantAuthorization[]; } -export interface ReactiveQueryGrantAuthorizationsResponse { - totalGrantAmount: ComputedRef; - grants: ComputedRef; -} export interface QueryGrantAuthorizationsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/tx.amino.ts b/libs/injective-vue/src/injective/exchange/v1beta1/tx.amino.ts deleted file mode 100644 index 93d6ccab..00000000 --- a/libs/injective-vue/src/injective/exchange/v1beta1/tx.amino.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; -export const AminoConverter = { - "/injective.exchange.v1beta1.MsgDeposit": { - aminoType: "exchange/MsgDeposit", - toAmino: MsgDeposit.toAmino, - fromAmino: MsgDeposit.fromAmino - }, - "/injective.exchange.v1beta1.MsgWithdraw": { - aminoType: "exchange/MsgWithdraw", - toAmino: MsgWithdraw.toAmino, - fromAmino: MsgWithdraw.fromAmino - }, - "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch": { - aminoType: "exchange/MsgInstantSpotMarketLaunch", - toAmino: MsgInstantSpotMarketLaunch.toAmino, - fromAmino: MsgInstantSpotMarketLaunch.fromAmino - }, - "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch": { - aminoType: "exchange/MsgInstantPerpetualMarketLaunch", - toAmino: MsgInstantPerpetualMarketLaunch.toAmino, - fromAmino: MsgInstantPerpetualMarketLaunch.fromAmino - }, - "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch": { - aminoType: "exchange/MsgInstantExpiryFuturesMarketLaunch", - toAmino: MsgInstantExpiryFuturesMarketLaunch.toAmino, - fromAmino: MsgInstantExpiryFuturesMarketLaunch.fromAmino - }, - "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder": { - aminoType: "exchange/MsgCreateSpotLimitOrder", - toAmino: MsgCreateSpotLimitOrder.toAmino, - fromAmino: MsgCreateSpotLimitOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders": { - aminoType: "exchange/MsgBatchCreateSpotLimitOrders", - toAmino: MsgBatchCreateSpotLimitOrders.toAmino, - fromAmino: MsgBatchCreateSpotLimitOrders.fromAmino - }, - "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder": { - aminoType: "exchange/MsgCreateSpotMarketOrder", - toAmino: MsgCreateSpotMarketOrder.toAmino, - fromAmino: MsgCreateSpotMarketOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgCancelSpotOrder": { - aminoType: "exchange/MsgCancelSpotOrder", - toAmino: MsgCancelSpotOrder.toAmino, - fromAmino: MsgCancelSpotOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders": { - aminoType: "exchange/MsgBatchCancelSpotOrders", - toAmino: MsgBatchCancelSpotOrders.toAmino, - fromAmino: MsgBatchCancelSpotOrders.fromAmino - }, - "/injective.exchange.v1beta1.MsgBatchUpdateOrders": { - aminoType: "exchange/MsgBatchUpdateOrders", - toAmino: MsgBatchUpdateOrders.toAmino, - fromAmino: MsgBatchUpdateOrders.fromAmino - }, - "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract": { - aminoType: "exchange/MsgPrivilegedExecuteContract", - toAmino: MsgPrivilegedExecuteContract.toAmino, - fromAmino: MsgPrivilegedExecuteContract.fromAmino - }, - "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder": { - aminoType: "exchange/MsgCreateDerivativeLimitOrder", - toAmino: MsgCreateDerivativeLimitOrder.toAmino, - fromAmino: MsgCreateDerivativeLimitOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders": { - aminoType: "exchange/MsgBatchCreateDerivativeLimitOrders", - toAmino: MsgBatchCreateDerivativeLimitOrders.toAmino, - fromAmino: MsgBatchCreateDerivativeLimitOrders.fromAmino - }, - "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder": { - aminoType: "exchange/MsgCreateDerivativeMarketOrder", - toAmino: MsgCreateDerivativeMarketOrder.toAmino, - fromAmino: MsgCreateDerivativeMarketOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgCancelDerivativeOrder": { - aminoType: "exchange/MsgCancelDerivativeOrder", - toAmino: MsgCancelDerivativeOrder.toAmino, - fromAmino: MsgCancelDerivativeOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders": { - aminoType: "exchange/MsgBatchCancelDerivativeOrders", - toAmino: MsgBatchCancelDerivativeOrders.toAmino, - fromAmino: MsgBatchCancelDerivativeOrders.fromAmino - }, - "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch": { - aminoType: "exchange/MsgInstantBinaryOptionsMarketLaunch", - toAmino: MsgInstantBinaryOptionsMarketLaunch.toAmino, - fromAmino: MsgInstantBinaryOptionsMarketLaunch.fromAmino - }, - "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder": { - aminoType: "exchange/MsgCreateBinaryOptionsLimitOrder", - toAmino: MsgCreateBinaryOptionsLimitOrder.toAmino, - fromAmino: MsgCreateBinaryOptionsLimitOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder": { - aminoType: "exchange/MsgCreateBinaryOptionsMarketOrder", - toAmino: MsgCreateBinaryOptionsMarketOrder.toAmino, - fromAmino: MsgCreateBinaryOptionsMarketOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder": { - aminoType: "exchange/MsgCancelBinaryOptionsOrder", - toAmino: MsgCancelBinaryOptionsOrder.toAmino, - fromAmino: MsgCancelBinaryOptionsOrder.fromAmino - }, - "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders": { - aminoType: "exchange/MsgBatchCancelBinaryOptionsOrders", - toAmino: MsgBatchCancelBinaryOptionsOrders.toAmino, - fromAmino: MsgBatchCancelBinaryOptionsOrders.fromAmino - }, - "/injective.exchange.v1beta1.MsgSubaccountTransfer": { - aminoType: "exchange/MsgSubaccountTransfer", - toAmino: MsgSubaccountTransfer.toAmino, - fromAmino: MsgSubaccountTransfer.fromAmino - }, - "/injective.exchange.v1beta1.MsgExternalTransfer": { - aminoType: "exchange/MsgExternalTransfer", - toAmino: MsgExternalTransfer.toAmino, - fromAmino: MsgExternalTransfer.fromAmino - }, - "/injective.exchange.v1beta1.MsgLiquidatePosition": { - aminoType: "exchange/MsgLiquidatePosition", - toAmino: MsgLiquidatePosition.toAmino, - fromAmino: MsgLiquidatePosition.fromAmino - }, - "/injective.exchange.v1beta1.MsgEmergencySettleMarket": { - aminoType: "exchange/MsgEmergencySettleMarket", - toAmino: MsgEmergencySettleMarket.toAmino, - fromAmino: MsgEmergencySettleMarket.fromAmino - }, - "/injective.exchange.v1beta1.MsgIncreasePositionMargin": { - aminoType: "exchange/MsgIncreasePositionMargin", - toAmino: MsgIncreasePositionMargin.toAmino, - fromAmino: MsgIncreasePositionMargin.fromAmino - }, - "/injective.exchange.v1beta1.MsgDecreasePositionMargin": { - aminoType: "exchange/MsgDecreasePositionMargin", - toAmino: MsgDecreasePositionMargin.toAmino, - fromAmino: MsgDecreasePositionMargin.fromAmino - }, - "/injective.exchange.v1beta1.MsgRewardsOptOut": { - aminoType: "exchange/MsgRewardsOptOut", - toAmino: MsgRewardsOptOut.toAmino, - fromAmino: MsgRewardsOptOut.fromAmino - }, - "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket": { - aminoType: "exchange/MsgAdminUpdateBinaryOptionsMarket", - toAmino: MsgAdminUpdateBinaryOptionsMarket.toAmino, - fromAmino: MsgAdminUpdateBinaryOptionsMarket.fromAmino - }, - "/injective.exchange.v1beta1.MsgUpdateParams": { - aminoType: "exchange/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/injective.exchange.v1beta1.MsgUpdateSpotMarket": { - aminoType: "exchange/MsgUpdateSpotMarket", - toAmino: MsgUpdateSpotMarket.toAmino, - fromAmino: MsgUpdateSpotMarket.fromAmino - }, - "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket": { - aminoType: "exchange/MsgUpdateDerivativeMarket", - toAmino: MsgUpdateDerivativeMarket.toAmino, - fromAmino: MsgUpdateDerivativeMarket.fromAmino - }, - "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants": { - aminoType: "exchange/MsgAuthorizeStakeGrants", - toAmino: MsgAuthorizeStakeGrants.toAmino, - fromAmino: MsgAuthorizeStakeGrants.fromAmino - }, - "/injective.exchange.v1beta1.MsgActivateStakeGrant": { - aminoType: "exchange/MsgActivateStakeGrant", - toAmino: MsgActivateStakeGrant.toAmino, - fromAmino: MsgActivateStakeGrant.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..aefb5bab --- /dev/null +++ b/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.func.ts @@ -0,0 +1,213 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const createWithdraw = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdraw.typeUrl, + encoders: toEncoders(MsgWithdraw), + converters: toConverters(MsgWithdraw) +}); +export const createInstantSpotMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantSpotMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantSpotMarketLaunch), + converters: toConverters(MsgInstantSpotMarketLaunch) +}); +export const createInstantPerpetualMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantPerpetualMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantPerpetualMarketLaunch), + converters: toConverters(MsgInstantPerpetualMarketLaunch) +}); +export const createInstantExpiryFuturesMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantExpiryFuturesMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantExpiryFuturesMarketLaunch), + converters: toConverters(MsgInstantExpiryFuturesMarketLaunch) +}); +export const createCreateSpotLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateSpotLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateSpotLimitOrder), + converters: toConverters(MsgCreateSpotLimitOrder) +}); +export const createBatchCreateSpotLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCreateSpotLimitOrders.typeUrl, + encoders: toEncoders(MsgBatchCreateSpotLimitOrders), + converters: toConverters(MsgBatchCreateSpotLimitOrders) +}); +export const createCreateSpotMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateSpotMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateSpotMarketOrder), + converters: toConverters(MsgCreateSpotMarketOrder) +}); +export const createCancelSpotOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelSpotOrder.typeUrl, + encoders: toEncoders(MsgCancelSpotOrder), + converters: toConverters(MsgCancelSpotOrder) +}); +export const createBatchCancelSpotOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelSpotOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelSpotOrders), + converters: toConverters(MsgBatchCancelSpotOrders) +}); +export const createBatchUpdateOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchUpdateOrders.typeUrl, + encoders: toEncoders(MsgBatchUpdateOrders), + converters: toConverters(MsgBatchUpdateOrders) +}); +export const createPrivilegedExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPrivilegedExecuteContract.typeUrl, + encoders: toEncoders(MsgPrivilegedExecuteContract), + converters: toConverters(MsgPrivilegedExecuteContract) +}); +export const createCreateDerivativeLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDerivativeLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateDerivativeLimitOrder), + converters: toConverters(MsgCreateDerivativeLimitOrder) +}); +export const createBatchCreateDerivativeLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCreateDerivativeLimitOrders.typeUrl, + encoders: toEncoders(MsgBatchCreateDerivativeLimitOrders), + converters: toConverters(MsgBatchCreateDerivativeLimitOrders) +}); +export const createCreateDerivativeMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDerivativeMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateDerivativeMarketOrder), + converters: toConverters(MsgCreateDerivativeMarketOrder) +}); +export const createCancelDerivativeOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelDerivativeOrder.typeUrl, + encoders: toEncoders(MsgCancelDerivativeOrder), + converters: toConverters(MsgCancelDerivativeOrder) +}); +export const createBatchCancelDerivativeOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelDerivativeOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelDerivativeOrders), + converters: toConverters(MsgBatchCancelDerivativeOrders) +}); +export const createInstantBinaryOptionsMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantBinaryOptionsMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantBinaryOptionsMarketLaunch), + converters: toConverters(MsgInstantBinaryOptionsMarketLaunch) +}); +export const createCreateBinaryOptionsLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateBinaryOptionsLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateBinaryOptionsLimitOrder), + converters: toConverters(MsgCreateBinaryOptionsLimitOrder) +}); +export const createCreateBinaryOptionsMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateBinaryOptionsMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateBinaryOptionsMarketOrder), + converters: toConverters(MsgCreateBinaryOptionsMarketOrder) +}); +export const createCancelBinaryOptionsOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelBinaryOptionsOrder.typeUrl, + encoders: toEncoders(MsgCancelBinaryOptionsOrder), + converters: toConverters(MsgCancelBinaryOptionsOrder) +}); +export const createBatchCancelBinaryOptionsOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelBinaryOptionsOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelBinaryOptionsOrders), + converters: toConverters(MsgBatchCancelBinaryOptionsOrders) +}); +export const createSubaccountTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubaccountTransfer.typeUrl, + encoders: toEncoders(MsgSubaccountTransfer), + converters: toConverters(MsgSubaccountTransfer) +}); +export const createExternalTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExternalTransfer.typeUrl, + encoders: toEncoders(MsgExternalTransfer), + converters: toConverters(MsgExternalTransfer) +}); +export const createLiquidatePosition = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgLiquidatePosition.typeUrl, + encoders: toEncoders(MsgLiquidatePosition), + converters: toConverters(MsgLiquidatePosition) +}); +export const createEmergencySettleMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgEmergencySettleMarket.typeUrl, + encoders: toEncoders(MsgEmergencySettleMarket), + converters: toConverters(MsgEmergencySettleMarket) +}); +export const createIncreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgIncreasePositionMargin.typeUrl, + encoders: toEncoders(MsgIncreasePositionMargin), + converters: toConverters(MsgIncreasePositionMargin) +}); +export const createDecreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDecreasePositionMargin.typeUrl, + encoders: toEncoders(MsgDecreasePositionMargin), + converters: toConverters(MsgDecreasePositionMargin) +}); +export const createRewardsOptOut = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRewardsOptOut.typeUrl, + encoders: toEncoders(MsgRewardsOptOut), + converters: toConverters(MsgRewardsOptOut) +}); +export const createAdminUpdateBinaryOptionsMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAdminUpdateBinaryOptionsMarket.typeUrl, + encoders: toEncoders(MsgAdminUpdateBinaryOptionsMarket), + converters: toConverters(MsgAdminUpdateBinaryOptionsMarket) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createUpdateSpotMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateSpotMarket.typeUrl, + encoders: toEncoders(MsgUpdateSpotMarket), + converters: toConverters(MsgUpdateSpotMarket) +}); +export const createUpdateDerivativeMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateDerivativeMarket.typeUrl, + encoders: toEncoders(MsgUpdateDerivativeMarket), + converters: toConverters(MsgUpdateDerivativeMarket) +}); +export const createAuthorizeStakeGrants = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAuthorizeStakeGrants.typeUrl, + encoders: toEncoders(MsgAuthorizeStakeGrants), + converters: toConverters(MsgAuthorizeStakeGrants) +}); +export const createActivateStakeGrant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgActivateStakeGrant.typeUrl, + encoders: toEncoders(MsgActivateStakeGrant), + converters: toConverters(MsgActivateStakeGrant) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 30a1411a..00000000 --- a/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,376 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgDeposit, MsgDepositResponse, MsgWithdraw, MsgWithdrawResponse, MsgInstantSpotMarketLaunch, MsgInstantSpotMarketLaunchResponse, MsgInstantPerpetualMarketLaunch, MsgInstantPerpetualMarketLaunchResponse, MsgInstantExpiryFuturesMarketLaunch, MsgInstantExpiryFuturesMarketLaunchResponse, MsgCreateSpotLimitOrder, MsgCreateSpotLimitOrderResponse, MsgBatchCreateSpotLimitOrders, MsgBatchCreateSpotLimitOrdersResponse, MsgCreateSpotMarketOrder, MsgCreateSpotMarketOrderResponse, MsgCancelSpotOrder, MsgCancelSpotOrderResponse, MsgBatchCancelSpotOrders, MsgBatchCancelSpotOrdersResponse, MsgBatchUpdateOrders, MsgBatchUpdateOrdersResponse, MsgPrivilegedExecuteContract, MsgPrivilegedExecuteContractResponse, MsgCreateDerivativeLimitOrder, MsgCreateDerivativeLimitOrderResponse, MsgBatchCreateDerivativeLimitOrders, MsgBatchCreateDerivativeLimitOrdersResponse, MsgCreateDerivativeMarketOrder, MsgCreateDerivativeMarketOrderResponse, MsgCancelDerivativeOrder, MsgCancelDerivativeOrderResponse, MsgBatchCancelDerivativeOrders, MsgBatchCancelDerivativeOrdersResponse, MsgInstantBinaryOptionsMarketLaunch, MsgInstantBinaryOptionsMarketLaunchResponse, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsLimitOrderResponse, MsgCreateBinaryOptionsMarketOrder, MsgCreateBinaryOptionsMarketOrderResponse, MsgCancelBinaryOptionsOrder, MsgCancelBinaryOptionsOrderResponse, MsgBatchCancelBinaryOptionsOrders, MsgBatchCancelBinaryOptionsOrdersResponse, MsgSubaccountTransfer, MsgSubaccountTransferResponse, MsgExternalTransfer, MsgExternalTransferResponse, MsgLiquidatePosition, MsgLiquidatePositionResponse, MsgEmergencySettleMarket, MsgEmergencySettleMarketResponse, MsgIncreasePositionMargin, MsgIncreasePositionMarginResponse, MsgDecreasePositionMargin, MsgDecreasePositionMarginResponse, MsgRewardsOptOut, MsgRewardsOptOutResponse, MsgAdminUpdateBinaryOptionsMarket, MsgAdminUpdateBinaryOptionsMarketResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgUpdateSpotMarket, MsgUpdateSpotMarketResponse, MsgUpdateDerivativeMarket, MsgUpdateDerivativeMarketResponse, MsgAuthorizeStakeGrants, MsgAuthorizeStakeGrantsResponse, MsgActivateStakeGrant, MsgActivateStakeGrantResponse } from "./tx"; -/** Msg defines the exchange Msg service. */ -export interface Msg { - /** - * Deposit defines a method for transferring coins from the sender's bank - * balance into the subaccount's exchange deposits - */ - deposit(request: MsgDeposit): Promise; - /** - * Withdraw defines a method for withdrawing coins from a subaccount's - * deposits to the user's bank balance - */ - withdraw(request: MsgWithdraw): Promise; - /** - * InstantSpotMarketLaunch defines method for creating a spot market by paying - * listing fee without governance - */ - instantSpotMarketLaunch(request: MsgInstantSpotMarketLaunch): Promise; - /** - * InstantPerpetualMarketLaunch defines a method for creating a new perpetual - * futures market by paying listing fee without governance - */ - instantPerpetualMarketLaunch(request: MsgInstantPerpetualMarketLaunch): Promise; - /** - * InstantExpiryFuturesMarketLaunch defines a method for creating a new expiry - * futures market by paying listing fee without governance - */ - instantExpiryFuturesMarketLaunch(request: MsgInstantExpiryFuturesMarketLaunch): Promise; - /** CreateSpotLimitOrder defines a method for creating a new spot limit order. */ - createSpotLimitOrder(request: MsgCreateSpotLimitOrder): Promise; - /** - * BatchCreateSpotLimitOrder defines a method for creating a new batch of spot - * limit orders. - */ - batchCreateSpotLimitOrders(request: MsgBatchCreateSpotLimitOrders): Promise; - /** - * CreateSpotMarketOrder defines a method for creating a new spot market - * order. - */ - createSpotMarketOrder(request: MsgCreateSpotMarketOrder): Promise; - /** MsgCancelSpotOrder defines a method for cancelling a spot order. */ - cancelSpotOrder(request: MsgCancelSpotOrder): Promise; - /** - * BatchCancelSpotOrders defines a method for cancelling a batch of spot - * orders in a given market. - */ - batchCancelSpotOrders(request: MsgBatchCancelSpotOrders): Promise; - /** BatchUpdateOrders defines a method for updating a batch of orders. */ - batchUpdateOrders(request: MsgBatchUpdateOrders): Promise; - /** - * PrivilegedExecuteContract defines a method for executing a Cosmwasm - * contract from the exchange module with privileged capabilities. - */ - privilegedExecuteContract(request: MsgPrivilegedExecuteContract): Promise; - /** - * CreateDerivativeLimitOrder defines a method for creating a new derivative - * limit order. - */ - createDerivativeLimitOrder(request: MsgCreateDerivativeLimitOrder): Promise; - /** - * BatchCreateDerivativeLimitOrders defines a method for creating a new batch - * of derivative limit orders. - */ - batchCreateDerivativeLimitOrders(request: MsgBatchCreateDerivativeLimitOrders): Promise; - /** - * MsgCreateDerivativeLimitOrder defines a method for creating a new - * derivative market order. - */ - createDerivativeMarketOrder(request: MsgCreateDerivativeMarketOrder): Promise; - /** - * MsgCancelDerivativeOrder defines a method for cancelling a derivative - * order. - */ - cancelDerivativeOrder(request: MsgCancelDerivativeOrder): Promise; - /** - * MsgBatchCancelDerivativeOrders defines a method for cancelling a batch of - * derivative limit orders. - */ - batchCancelDerivativeOrders(request: MsgBatchCancelDerivativeOrders): Promise; - /** - * InstantBinaryOptionsMarketLaunch defines method for creating a binary - * options market by paying listing fee without governance - */ - instantBinaryOptionsMarketLaunch(request: MsgInstantBinaryOptionsMarketLaunch): Promise; - /** - * CreateBinaryOptionsLimitOrder defines a method for creating a new binary - * options limit order. - */ - createBinaryOptionsLimitOrder(request: MsgCreateBinaryOptionsLimitOrder): Promise; - /** - * CreateBinaryOptionsMarketOrder defines a method for creating a new binary - * options market order. - */ - createBinaryOptionsMarketOrder(request: MsgCreateBinaryOptionsMarketOrder): Promise; - /** - * MsgCancelBinaryOptionsOrder defines a method for cancelling a binary - * options order. - */ - cancelBinaryOptionsOrder(request: MsgCancelBinaryOptionsOrder): Promise; - /** - * BatchCancelBinaryOptionsOrders defines a method for cancelling a batch of - * binary options limit orders. - */ - batchCancelBinaryOptionsOrders(request: MsgBatchCancelBinaryOptionsOrders): Promise; - /** SubaccountTransfer defines a method for transfer between subaccounts */ - subaccountTransfer(request: MsgSubaccountTransfer): Promise; - /** ExternalTransfer defines a method for transfer between external accounts */ - externalTransfer(request: MsgExternalTransfer): Promise; - /** LiquidatePosition defines a method for liquidating a position */ - liquidatePosition(request: MsgLiquidatePosition): Promise; - /** EmergencySettleMarket defines a method for emergency settling a market */ - emergencySettleMarket(request: MsgEmergencySettleMarket): Promise; - /** IncreasePositionMargin defines a method for increasing margin of a position */ - increasePositionMargin(request: MsgIncreasePositionMargin): Promise; - /** DecreasePositionMargin defines a method for decreasing margin of a position */ - decreasePositionMargin(request: MsgDecreasePositionMargin): Promise; - /** RewardsOptOut defines a method for opting out of rewards */ - rewardsOptOut(request: MsgRewardsOptOut): Promise; - /** - * AdminUpdateBinaryOptionsMarket defines method for updating a binary options - * market by admin - */ - adminUpdateBinaryOptionsMarket(request: MsgAdminUpdateBinaryOptionsMarket): Promise; - updateParams(request: MsgUpdateParams): Promise; - /** UpdateSpotMarket modifies certain spot market fields (admin only) */ - updateSpotMarket(request: MsgUpdateSpotMarket): Promise; - /** - * UpdateDerivativeMarket modifies certain derivative market fields (admin - * only) - */ - updateDerivativeMarket(request: MsgUpdateDerivativeMarket): Promise; - authorizeStakeGrants(request: MsgAuthorizeStakeGrants): Promise; - activateStakeGrant(request: MsgActivateStakeGrant): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Deposit defines a method for transferring coins from the sender's bank - balance into the subaccount's exchange deposits */ - deposit = async (request: MsgDeposit): Promise => { - const data = MsgDeposit.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "Deposit", data); - return promise.then(data => MsgDepositResponse.decode(new BinaryReader(data))); - }; - /* Withdraw defines a method for withdrawing coins from a subaccount's - deposits to the user's bank balance */ - withdraw = async (request: MsgWithdraw): Promise => { - const data = MsgWithdraw.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "Withdraw", data); - return promise.then(data => MsgWithdrawResponse.decode(new BinaryReader(data))); - }; - /* InstantSpotMarketLaunch defines method for creating a spot market by paying - listing fee without governance */ - instantSpotMarketLaunch = async (request: MsgInstantSpotMarketLaunch): Promise => { - const data = MsgInstantSpotMarketLaunch.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "InstantSpotMarketLaunch", data); - return promise.then(data => MsgInstantSpotMarketLaunchResponse.decode(new BinaryReader(data))); - }; - /* InstantPerpetualMarketLaunch defines a method for creating a new perpetual - futures market by paying listing fee without governance */ - instantPerpetualMarketLaunch = async (request: MsgInstantPerpetualMarketLaunch): Promise => { - const data = MsgInstantPerpetualMarketLaunch.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "InstantPerpetualMarketLaunch", data); - return promise.then(data => MsgInstantPerpetualMarketLaunchResponse.decode(new BinaryReader(data))); - }; - /* InstantExpiryFuturesMarketLaunch defines a method for creating a new expiry - futures market by paying listing fee without governance */ - instantExpiryFuturesMarketLaunch = async (request: MsgInstantExpiryFuturesMarketLaunch): Promise => { - const data = MsgInstantExpiryFuturesMarketLaunch.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "InstantExpiryFuturesMarketLaunch", data); - return promise.then(data => MsgInstantExpiryFuturesMarketLaunchResponse.decode(new BinaryReader(data))); - }; - /* CreateSpotLimitOrder defines a method for creating a new spot limit order. */ - createSpotLimitOrder = async (request: MsgCreateSpotLimitOrder): Promise => { - const data = MsgCreateSpotLimitOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CreateSpotLimitOrder", data); - return promise.then(data => MsgCreateSpotLimitOrderResponse.decode(new BinaryReader(data))); - }; - /* BatchCreateSpotLimitOrder defines a method for creating a new batch of spot - limit orders. */ - batchCreateSpotLimitOrders = async (request: MsgBatchCreateSpotLimitOrders): Promise => { - const data = MsgBatchCreateSpotLimitOrders.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "BatchCreateSpotLimitOrders", data); - return promise.then(data => MsgBatchCreateSpotLimitOrdersResponse.decode(new BinaryReader(data))); - }; - /* CreateSpotMarketOrder defines a method for creating a new spot market - order. */ - createSpotMarketOrder = async (request: MsgCreateSpotMarketOrder): Promise => { - const data = MsgCreateSpotMarketOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CreateSpotMarketOrder", data); - return promise.then(data => MsgCreateSpotMarketOrderResponse.decode(new BinaryReader(data))); - }; - /* MsgCancelSpotOrder defines a method for cancelling a spot order. */ - cancelSpotOrder = async (request: MsgCancelSpotOrder): Promise => { - const data = MsgCancelSpotOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CancelSpotOrder", data); - return promise.then(data => MsgCancelSpotOrderResponse.decode(new BinaryReader(data))); - }; - /* BatchCancelSpotOrders defines a method for cancelling a batch of spot - orders in a given market. */ - batchCancelSpotOrders = async (request: MsgBatchCancelSpotOrders): Promise => { - const data = MsgBatchCancelSpotOrders.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "BatchCancelSpotOrders", data); - return promise.then(data => MsgBatchCancelSpotOrdersResponse.decode(new BinaryReader(data))); - }; - /* BatchUpdateOrders defines a method for updating a batch of orders. */ - batchUpdateOrders = async (request: MsgBatchUpdateOrders): Promise => { - const data = MsgBatchUpdateOrders.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "BatchUpdateOrders", data); - return promise.then(data => MsgBatchUpdateOrdersResponse.decode(new BinaryReader(data))); - }; - /* PrivilegedExecuteContract defines a method for executing a Cosmwasm - contract from the exchange module with privileged capabilities. */ - privilegedExecuteContract = async (request: MsgPrivilegedExecuteContract): Promise => { - const data = MsgPrivilegedExecuteContract.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "PrivilegedExecuteContract", data); - return promise.then(data => MsgPrivilegedExecuteContractResponse.decode(new BinaryReader(data))); - }; - /* CreateDerivativeLimitOrder defines a method for creating a new derivative - limit order. */ - createDerivativeLimitOrder = async (request: MsgCreateDerivativeLimitOrder): Promise => { - const data = MsgCreateDerivativeLimitOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CreateDerivativeLimitOrder", data); - return promise.then(data => MsgCreateDerivativeLimitOrderResponse.decode(new BinaryReader(data))); - }; - /* BatchCreateDerivativeLimitOrders defines a method for creating a new batch - of derivative limit orders. */ - batchCreateDerivativeLimitOrders = async (request: MsgBatchCreateDerivativeLimitOrders): Promise => { - const data = MsgBatchCreateDerivativeLimitOrders.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "BatchCreateDerivativeLimitOrders", data); - return promise.then(data => MsgBatchCreateDerivativeLimitOrdersResponse.decode(new BinaryReader(data))); - }; - /* MsgCreateDerivativeLimitOrder defines a method for creating a new - derivative market order. */ - createDerivativeMarketOrder = async (request: MsgCreateDerivativeMarketOrder): Promise => { - const data = MsgCreateDerivativeMarketOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CreateDerivativeMarketOrder", data); - return promise.then(data => MsgCreateDerivativeMarketOrderResponse.decode(new BinaryReader(data))); - }; - /* MsgCancelDerivativeOrder defines a method for cancelling a derivative - order. */ - cancelDerivativeOrder = async (request: MsgCancelDerivativeOrder): Promise => { - const data = MsgCancelDerivativeOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CancelDerivativeOrder", data); - return promise.then(data => MsgCancelDerivativeOrderResponse.decode(new BinaryReader(data))); - }; - /* MsgBatchCancelDerivativeOrders defines a method for cancelling a batch of - derivative limit orders. */ - batchCancelDerivativeOrders = async (request: MsgBatchCancelDerivativeOrders): Promise => { - const data = MsgBatchCancelDerivativeOrders.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "BatchCancelDerivativeOrders", data); - return promise.then(data => MsgBatchCancelDerivativeOrdersResponse.decode(new BinaryReader(data))); - }; - /* InstantBinaryOptionsMarketLaunch defines method for creating a binary - options market by paying listing fee without governance */ - instantBinaryOptionsMarketLaunch = async (request: MsgInstantBinaryOptionsMarketLaunch): Promise => { - const data = MsgInstantBinaryOptionsMarketLaunch.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "InstantBinaryOptionsMarketLaunch", data); - return promise.then(data => MsgInstantBinaryOptionsMarketLaunchResponse.decode(new BinaryReader(data))); - }; - /* CreateBinaryOptionsLimitOrder defines a method for creating a new binary - options limit order. */ - createBinaryOptionsLimitOrder = async (request: MsgCreateBinaryOptionsLimitOrder): Promise => { - const data = MsgCreateBinaryOptionsLimitOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CreateBinaryOptionsLimitOrder", data); - return promise.then(data => MsgCreateBinaryOptionsLimitOrderResponse.decode(new BinaryReader(data))); - }; - /* CreateBinaryOptionsMarketOrder defines a method for creating a new binary - options market order. */ - createBinaryOptionsMarketOrder = async (request: MsgCreateBinaryOptionsMarketOrder): Promise => { - const data = MsgCreateBinaryOptionsMarketOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CreateBinaryOptionsMarketOrder", data); - return promise.then(data => MsgCreateBinaryOptionsMarketOrderResponse.decode(new BinaryReader(data))); - }; - /* MsgCancelBinaryOptionsOrder defines a method for cancelling a binary - options order. */ - cancelBinaryOptionsOrder = async (request: MsgCancelBinaryOptionsOrder): Promise => { - const data = MsgCancelBinaryOptionsOrder.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "CancelBinaryOptionsOrder", data); - return promise.then(data => MsgCancelBinaryOptionsOrderResponse.decode(new BinaryReader(data))); - }; - /* BatchCancelBinaryOptionsOrders defines a method for cancelling a batch of - binary options limit orders. */ - batchCancelBinaryOptionsOrders = async (request: MsgBatchCancelBinaryOptionsOrders): Promise => { - const data = MsgBatchCancelBinaryOptionsOrders.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "BatchCancelBinaryOptionsOrders", data); - return promise.then(data => MsgBatchCancelBinaryOptionsOrdersResponse.decode(new BinaryReader(data))); - }; - /* SubaccountTransfer defines a method for transfer between subaccounts */ - subaccountTransfer = async (request: MsgSubaccountTransfer): Promise => { - const data = MsgSubaccountTransfer.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "SubaccountTransfer", data); - return promise.then(data => MsgSubaccountTransferResponse.decode(new BinaryReader(data))); - }; - /* ExternalTransfer defines a method for transfer between external accounts */ - externalTransfer = async (request: MsgExternalTransfer): Promise => { - const data = MsgExternalTransfer.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "ExternalTransfer", data); - return promise.then(data => MsgExternalTransferResponse.decode(new BinaryReader(data))); - }; - /* LiquidatePosition defines a method for liquidating a position */ - liquidatePosition = async (request: MsgLiquidatePosition): Promise => { - const data = MsgLiquidatePosition.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "LiquidatePosition", data); - return promise.then(data => MsgLiquidatePositionResponse.decode(new BinaryReader(data))); - }; - /* EmergencySettleMarket defines a method for emergency settling a market */ - emergencySettleMarket = async (request: MsgEmergencySettleMarket): Promise => { - const data = MsgEmergencySettleMarket.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "EmergencySettleMarket", data); - return promise.then(data => MsgEmergencySettleMarketResponse.decode(new BinaryReader(data))); - }; - /* IncreasePositionMargin defines a method for increasing margin of a position */ - increasePositionMargin = async (request: MsgIncreasePositionMargin): Promise => { - const data = MsgIncreasePositionMargin.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "IncreasePositionMargin", data); - return promise.then(data => MsgIncreasePositionMarginResponse.decode(new BinaryReader(data))); - }; - /* DecreasePositionMargin defines a method for decreasing margin of a position */ - decreasePositionMargin = async (request: MsgDecreasePositionMargin): Promise => { - const data = MsgDecreasePositionMargin.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "DecreasePositionMargin", data); - return promise.then(data => MsgDecreasePositionMarginResponse.decode(new BinaryReader(data))); - }; - /* RewardsOptOut defines a method for opting out of rewards */ - rewardsOptOut = async (request: MsgRewardsOptOut): Promise => { - const data = MsgRewardsOptOut.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "RewardsOptOut", data); - return promise.then(data => MsgRewardsOptOutResponse.decode(new BinaryReader(data))); - }; - /* AdminUpdateBinaryOptionsMarket defines method for updating a binary options - market by admin */ - adminUpdateBinaryOptionsMarket = async (request: MsgAdminUpdateBinaryOptionsMarket): Promise => { - const data = MsgAdminUpdateBinaryOptionsMarket.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "AdminUpdateBinaryOptionsMarket", data); - return promise.then(data => MsgAdminUpdateBinaryOptionsMarketResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; - /* UpdateSpotMarket modifies certain spot market fields (admin only) */ - updateSpotMarket = async (request: MsgUpdateSpotMarket): Promise => { - const data = MsgUpdateSpotMarket.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "UpdateSpotMarket", data); - return promise.then(data => MsgUpdateSpotMarketResponse.decode(new BinaryReader(data))); - }; - /* UpdateDerivativeMarket modifies certain derivative market fields (admin - only) */ - updateDerivativeMarket = async (request: MsgUpdateDerivativeMarket): Promise => { - const data = MsgUpdateDerivativeMarket.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "UpdateDerivativeMarket", data); - return promise.then(data => MsgUpdateDerivativeMarketResponse.decode(new BinaryReader(data))); - }; - /* AuthorizeStakeGrants */ - authorizeStakeGrants = async (request: MsgAuthorizeStakeGrants): Promise => { - const data = MsgAuthorizeStakeGrants.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "AuthorizeStakeGrants", data); - return promise.then(data => MsgAuthorizeStakeGrantsResponse.decode(new BinaryReader(data))); - }; - /* ActivateStakeGrant */ - activateStakeGrant = async (request: MsgActivateStakeGrant): Promise => { - const data = MsgActivateStakeGrant.encode(request).finish(); - const promise = this.rpc.request("injective.exchange.v1beta1.Msg", "ActivateStakeGrant", data); - return promise.then(data => MsgActivateStakeGrantResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..09b7405e --- /dev/null +++ b/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,108 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; +import { createDeposit, createWithdraw, createInstantSpotMarketLaunch, createInstantPerpetualMarketLaunch, createInstantExpiryFuturesMarketLaunch, createCreateSpotLimitOrder, createBatchCreateSpotLimitOrders, createCreateSpotMarketOrder, createCancelSpotOrder, createBatchCancelSpotOrders, createBatchUpdateOrders, createPrivilegedExecuteContract, createCreateDerivativeLimitOrder, createBatchCreateDerivativeLimitOrders, createCreateDerivativeMarketOrder, createCancelDerivativeOrder, createBatchCancelDerivativeOrders, createInstantBinaryOptionsMarketLaunch, createCreateBinaryOptionsLimitOrder, createCreateBinaryOptionsMarketOrder, createCancelBinaryOptionsOrder, createBatchCancelBinaryOptionsOrders, createSubaccountTransfer, createExternalTransfer, createLiquidatePosition, createEmergencySettleMarket, createIncreasePositionMargin, createDecreasePositionMargin, createRewardsOptOut, createAdminUpdateBinaryOptionsMarket, createUpdateParams, createUpdateSpotMarket, createUpdateDerivativeMarket, createAuthorizeStakeGrants, createActivateStakeGrant } from "./tx.rpc.func.ts"; +export const useDeposit = buildUseVueMutation({ + builderMutationFn: createDeposit +}); +export const useWithdraw = buildUseVueMutation({ + builderMutationFn: createWithdraw +}); +export const useInstantSpotMarketLaunch = buildUseVueMutation({ + builderMutationFn: createInstantSpotMarketLaunch +}); +export const useInstantPerpetualMarketLaunch = buildUseVueMutation({ + builderMutationFn: createInstantPerpetualMarketLaunch +}); +export const useInstantExpiryFuturesMarketLaunch = buildUseVueMutation({ + builderMutationFn: createInstantExpiryFuturesMarketLaunch +}); +export const useCreateSpotLimitOrder = buildUseVueMutation({ + builderMutationFn: createCreateSpotLimitOrder +}); +export const useBatchCreateSpotLimitOrders = buildUseVueMutation({ + builderMutationFn: createBatchCreateSpotLimitOrders +}); +export const useCreateSpotMarketOrder = buildUseVueMutation({ + builderMutationFn: createCreateSpotMarketOrder +}); +export const useCancelSpotOrder = buildUseVueMutation({ + builderMutationFn: createCancelSpotOrder +}); +export const useBatchCancelSpotOrders = buildUseVueMutation({ + builderMutationFn: createBatchCancelSpotOrders +}); +export const useBatchUpdateOrders = buildUseVueMutation({ + builderMutationFn: createBatchUpdateOrders +}); +export const usePrivilegedExecuteContract = buildUseVueMutation({ + builderMutationFn: createPrivilegedExecuteContract +}); +export const useCreateDerivativeLimitOrder = buildUseVueMutation({ + builderMutationFn: createCreateDerivativeLimitOrder +}); +export const useBatchCreateDerivativeLimitOrders = buildUseVueMutation({ + builderMutationFn: createBatchCreateDerivativeLimitOrders +}); +export const useCreateDerivativeMarketOrder = buildUseVueMutation({ + builderMutationFn: createCreateDerivativeMarketOrder +}); +export const useCancelDerivativeOrder = buildUseVueMutation({ + builderMutationFn: createCancelDerivativeOrder +}); +export const useBatchCancelDerivativeOrders = buildUseVueMutation({ + builderMutationFn: createBatchCancelDerivativeOrders +}); +export const useInstantBinaryOptionsMarketLaunch = buildUseVueMutation({ + builderMutationFn: createInstantBinaryOptionsMarketLaunch +}); +export const useCreateBinaryOptionsLimitOrder = buildUseVueMutation({ + builderMutationFn: createCreateBinaryOptionsLimitOrder +}); +export const useCreateBinaryOptionsMarketOrder = buildUseVueMutation({ + builderMutationFn: createCreateBinaryOptionsMarketOrder +}); +export const useCancelBinaryOptionsOrder = buildUseVueMutation({ + builderMutationFn: createCancelBinaryOptionsOrder +}); +export const useBatchCancelBinaryOptionsOrders = buildUseVueMutation({ + builderMutationFn: createBatchCancelBinaryOptionsOrders +}); +export const useSubaccountTransfer = buildUseVueMutation({ + builderMutationFn: createSubaccountTransfer +}); +export const useExternalTransfer = buildUseVueMutation({ + builderMutationFn: createExternalTransfer +}); +export const useLiquidatePosition = buildUseVueMutation({ + builderMutationFn: createLiquidatePosition +}); +export const useEmergencySettleMarket = buildUseVueMutation({ + builderMutationFn: createEmergencySettleMarket +}); +export const useIncreasePositionMargin = buildUseVueMutation({ + builderMutationFn: createIncreasePositionMargin +}); +export const useDecreasePositionMargin = buildUseVueMutation({ + builderMutationFn: createDecreasePositionMargin +}); +export const useRewardsOptOut = buildUseVueMutation({ + builderMutationFn: createRewardsOptOut +}); +export const useAdminUpdateBinaryOptionsMarket = buildUseVueMutation({ + builderMutationFn: createAdminUpdateBinaryOptionsMarket +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useUpdateSpotMarket = buildUseVueMutation({ + builderMutationFn: createUpdateSpotMarket +}); +export const useUpdateDerivativeMarket = buildUseVueMutation({ + builderMutationFn: createUpdateDerivativeMarket +}); +export const useAuthorizeStakeGrants = buildUseVueMutation({ + builderMutationFn: createAuthorizeStakeGrants +}); +export const useActivateStakeGrant = buildUseVueMutation({ + builderMutationFn: createActivateStakeGrant +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/tx.ts b/libs/injective-vue/src/injective/exchange/v1beta1/tx.ts index c1b85541..5508578a 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/tx.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/tx.ts @@ -5,7 +5,6 @@ import { Params, ParamsAmino } from "../../../cosmos/distribution/v1beta1/distri import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface MsgUpdateSpotMarket { /** current admin address of the associated market */ admin: string; @@ -20,14 +19,6 @@ export interface MsgUpdateSpotMarket { /** (optional) updated min notional */ newMinNotional: string; } -export interface ReactiveMsgUpdateSpotMarket { - admin: ComputedRef; - marketId: ComputedRef; - newTicker: ComputedRef; - newMinPriceTickSize: ComputedRef; - newMinQuantityTickSize: ComputedRef; - newMinNotional: ComputedRef; -} export interface MsgUpdateSpotMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarket"; value: Uint8Array; @@ -51,7 +42,6 @@ export interface MsgUpdateSpotMarketAminoMsg { value: MsgUpdateSpotMarketAmino; } export interface MsgUpdateSpotMarketResponse {} -export interface ReactiveMsgUpdateSpotMarketResponse {} export interface MsgUpdateSpotMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse"; value: Uint8Array; @@ -79,16 +69,6 @@ export interface MsgUpdateDerivativeMarket { /** (optional) updated value for maintenance_margin_ratio */ newMaintenanceMarginRatio: string; } -export interface ReactiveMsgUpdateDerivativeMarket { - admin: ComputedRef; - marketId: ComputedRef; - newTicker: ComputedRef; - newMinPriceTickSize: ComputedRef; - newMinQuantityTickSize: ComputedRef; - newMinNotional: ComputedRef; - newInitialMarginRatio: ComputedRef; - newMaintenanceMarginRatio: ComputedRef; -} export interface MsgUpdateDerivativeMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket"; value: Uint8Array; @@ -116,7 +96,6 @@ export interface MsgUpdateDerivativeMarketAminoMsg { value: MsgUpdateDerivativeMarketAmino; } export interface MsgUpdateDerivativeMarketResponse {} -export interface ReactiveMsgUpdateDerivativeMarketResponse {} export interface MsgUpdateDerivativeMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse"; value: Uint8Array; @@ -136,10 +115,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -159,7 +134,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -182,11 +156,6 @@ export interface MsgDeposit { subaccountId: string; amount: Coin; } -export interface ReactiveMsgDeposit { - sender: ComputedRef; - subaccountId: ComputedRef; - amount: ComputedRef; -} export interface MsgDepositProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgDeposit"; value: Uint8Array; @@ -210,7 +179,6 @@ export interface MsgDepositAminoMsg { } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponse {} -export interface ReactiveMsgDepositResponse {} export interface MsgDepositResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgDepositResponse"; value: Uint8Array; @@ -231,11 +199,6 @@ export interface MsgWithdraw { subaccountId: string; amount: Coin; } -export interface ReactiveMsgWithdraw { - sender: ComputedRef; - subaccountId: ComputedRef; - amount: ComputedRef; -} export interface MsgWithdrawProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgWithdraw"; value: Uint8Array; @@ -256,7 +219,6 @@ export interface MsgWithdrawAminoMsg { } /** MsgWithdraw defines the Msg/Withdraw response type. */ export interface MsgWithdrawResponse {} -export interface ReactiveMsgWithdrawResponse {} export interface MsgWithdrawResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgWithdrawResponse"; value: Uint8Array; @@ -275,10 +237,6 @@ export interface MsgCreateSpotLimitOrder { sender: string; order: SpotOrder; } -export interface ReactiveMsgCreateSpotLimitOrder { - sender: ComputedRef; - order: ComputedRef; -} export interface MsgCreateSpotLimitOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder"; value: Uint8Array; @@ -303,10 +261,6 @@ export interface MsgCreateSpotLimitOrderResponse { orderHash: string; cid: string; } -export interface ReactiveMsgCreateSpotLimitOrderResponse { - orderHash: ComputedRef; - cid: ComputedRef; -} export interface MsgCreateSpotLimitOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse"; value: Uint8Array; @@ -331,10 +285,6 @@ export interface MsgBatchCreateSpotLimitOrders { sender: string; orders: SpotOrder[]; } -export interface ReactiveMsgBatchCreateSpotLimitOrders { - sender: ComputedRef; - orders: ComputedRef; -} export interface MsgBatchCreateSpotLimitOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders"; value: Uint8Array; @@ -360,11 +310,6 @@ export interface MsgBatchCreateSpotLimitOrdersResponse { createdOrdersCids: string[]; failedOrdersCids: string[]; } -export interface ReactiveMsgBatchCreateSpotLimitOrdersResponse { - orderHashes: ComputedRef; - createdOrdersCids: ComputedRef; - failedOrdersCids: ComputedRef; -} export interface MsgBatchCreateSpotLimitOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse"; value: Uint8Array; @@ -407,15 +352,6 @@ export interface MsgInstantSpotMarketLaunch { */ minNotional: string; } -export interface ReactiveMsgInstantSpotMarketLaunch { - sender: ComputedRef; - ticker: ComputedRef; - baseDenom: ComputedRef; - quoteDenom: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; -} export interface MsgInstantSpotMarketLaunchProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch"; value: Uint8Array; @@ -454,7 +390,6 @@ export interface MsgInstantSpotMarketLaunchAminoMsg { * response type. */ export interface MsgInstantSpotMarketLaunchResponse {} -export interface ReactiveMsgInstantSpotMarketLaunchResponse {} export interface MsgInstantSpotMarketLaunchResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse"; value: Uint8Array; @@ -522,22 +457,6 @@ export interface MsgInstantPerpetualMarketLaunch { */ minNotional: string; } -export interface ReactiveMsgInstantPerpetualMarketLaunch { - sender: ComputedRef; - ticker: ComputedRef; - quoteDenom: ComputedRef; - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleScaleFactor: ComputedRef; - oracleType: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - initialMarginRatio: ComputedRef; - maintenanceMarginRatio: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; -} export interface MsgInstantPerpetualMarketLaunchProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch"; value: Uint8Array; @@ -605,7 +524,6 @@ export interface MsgInstantPerpetualMarketLaunchAminoMsg { * Msg/InstantPerpetualMarketLaunchResponse response type. */ export interface MsgInstantPerpetualMarketLaunchResponse {} -export interface ReactiveMsgInstantPerpetualMarketLaunchResponse {} export interface MsgInstantPerpetualMarketLaunchResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse"; value: Uint8Array; @@ -669,23 +587,6 @@ export interface MsgInstantBinaryOptionsMarketLaunch { */ minNotional: string; } -export interface ReactiveMsgInstantBinaryOptionsMarketLaunch { - sender: ComputedRef; - ticker: ComputedRef; - oracleSymbol: ComputedRef; - oracleProvider: ComputedRef; - oracleType: ComputedRef; - oracleScaleFactor: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - expirationTimestamp: ComputedRef; - settlementTimestamp: ComputedRef; - admin: ComputedRef; - quoteDenom: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; -} export interface MsgInstantBinaryOptionsMarketLaunchProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch"; value: Uint8Array; @@ -749,7 +650,6 @@ export interface MsgInstantBinaryOptionsMarketLaunchAminoMsg { * Msg/InstantBinaryOptionsMarketLaunchResponse response type. */ export interface MsgInstantBinaryOptionsMarketLaunchResponse {} -export interface ReactiveMsgInstantBinaryOptionsMarketLaunchResponse {} export interface MsgInstantBinaryOptionsMarketLaunchResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse"; value: Uint8Array; @@ -819,23 +719,6 @@ export interface MsgInstantExpiryFuturesMarketLaunch { */ minNotional: string; } -export interface ReactiveMsgInstantExpiryFuturesMarketLaunch { - sender: ComputedRef; - ticker: ComputedRef; - quoteDenom: ComputedRef; - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleType: ComputedRef; - oracleScaleFactor: ComputedRef; - expiry: ComputedRef; - makerFeeRate: ComputedRef; - takerFeeRate: ComputedRef; - initialMarginRatio: ComputedRef; - maintenanceMarginRatio: ComputedRef; - minPriceTickSize: ComputedRef; - minQuantityTickSize: ComputedRef; - minNotional: ComputedRef; -} export interface MsgInstantExpiryFuturesMarketLaunchProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch"; value: Uint8Array; @@ -905,7 +788,6 @@ export interface MsgInstantExpiryFuturesMarketLaunchAminoMsg { * Msg/InstantExpiryFuturesMarketLaunch response type. */ export interface MsgInstantExpiryFuturesMarketLaunchResponse {} -export interface ReactiveMsgInstantExpiryFuturesMarketLaunchResponse {} export interface MsgInstantExpiryFuturesMarketLaunchResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse"; value: Uint8Array; @@ -927,10 +809,6 @@ export interface MsgCreateSpotMarketOrder { sender: string; order: SpotOrder; } -export interface ReactiveMsgCreateSpotMarketOrder { - sender: ComputedRef; - order: ComputedRef; -} export interface MsgCreateSpotMarketOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder"; value: Uint8Array; @@ -956,11 +834,6 @@ export interface MsgCreateSpotMarketOrderResponse { results?: SpotMarketOrderResults; cid: string; } -export interface ReactiveMsgCreateSpotMarketOrderResponse { - orderHash: ComputedRef; - results?: ComputedRef; - cid: ComputedRef; -} export interface MsgCreateSpotMarketOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse"; value: Uint8Array; @@ -983,11 +856,6 @@ export interface SpotMarketOrderResults { price: string; fee: string; } -export interface ReactiveSpotMarketOrderResults { - quantity: ComputedRef; - price: ComputedRef; - fee: ComputedRef; -} export interface SpotMarketOrderResultsProtoMsg { typeUrl: "/injective.exchange.v1beta1.SpotMarketOrderResults"; value: Uint8Array; @@ -1006,10 +874,6 @@ export interface MsgCreateDerivativeLimitOrder { sender: string; order: DerivativeOrder; } -export interface ReactiveMsgCreateDerivativeLimitOrder { - sender: ComputedRef; - order: ComputedRef; -} export interface MsgCreateDerivativeLimitOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder"; value: Uint8Array; @@ -1031,10 +895,6 @@ export interface MsgCreateDerivativeLimitOrderResponse { orderHash: string; cid: string; } -export interface ReactiveMsgCreateDerivativeLimitOrderResponse { - orderHash: ComputedRef; - cid: ComputedRef; -} export interface MsgCreateDerivativeLimitOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse"; value: Uint8Array; @@ -1056,10 +916,6 @@ export interface MsgCreateBinaryOptionsLimitOrder { sender: string; order: DerivativeOrder; } -export interface ReactiveMsgCreateBinaryOptionsLimitOrder { - sender: ComputedRef; - order: ComputedRef; -} export interface MsgCreateBinaryOptionsLimitOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder"; value: Uint8Array; @@ -1081,10 +937,6 @@ export interface MsgCreateBinaryOptionsLimitOrderResponse { orderHash: string; cid: string; } -export interface ReactiveMsgCreateBinaryOptionsLimitOrderResponse { - orderHash: ComputedRef; - cid: ComputedRef; -} export interface MsgCreateBinaryOptionsLimitOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse"; value: Uint8Array; @@ -1106,10 +958,6 @@ export interface MsgBatchCreateDerivativeLimitOrders { sender: string; orders: DerivativeOrder[]; } -export interface ReactiveMsgBatchCreateDerivativeLimitOrders { - sender: ComputedRef; - orders: ComputedRef; -} export interface MsgBatchCreateDerivativeLimitOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders"; value: Uint8Array; @@ -1132,11 +980,6 @@ export interface MsgBatchCreateDerivativeLimitOrdersResponse { createdOrdersCids: string[]; failedOrdersCids: string[]; } -export interface ReactiveMsgBatchCreateDerivativeLimitOrdersResponse { - orderHashes: ComputedRef; - createdOrdersCids: ComputedRef; - failedOrdersCids: ComputedRef; -} export interface MsgBatchCreateDerivativeLimitOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse"; value: Uint8Array; @@ -1162,13 +1005,6 @@ export interface MsgCancelSpotOrder { orderHash: string; cid: string; } -export interface ReactiveMsgCancelSpotOrder { - sender: ComputedRef; - marketId: ComputedRef; - subaccountId: ComputedRef; - orderHash: ComputedRef; - cid: ComputedRef; -} export interface MsgCancelSpotOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrder"; value: Uint8Array; @@ -1187,7 +1023,6 @@ export interface MsgCancelSpotOrderAminoMsg { } /** MsgCancelSpotOrderResponse defines the Msg/CancelSpotOrder response type. */ export interface MsgCancelSpotOrderResponse {} -export interface ReactiveMsgCancelSpotOrderResponse {} export interface MsgCancelSpotOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse"; value: Uint8Array; @@ -1203,10 +1038,6 @@ export interface MsgBatchCancelSpotOrders { sender: string; data: OrderData[]; } -export interface ReactiveMsgBatchCancelSpotOrders { - sender: ComputedRef; - data: ComputedRef; -} export interface MsgBatchCancelSpotOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders"; value: Uint8Array; @@ -1227,9 +1058,6 @@ export interface MsgBatchCancelSpotOrdersAminoMsg { export interface MsgBatchCancelSpotOrdersResponse { success: boolean[]; } -export interface ReactiveMsgBatchCancelSpotOrdersResponse { - success: ComputedRef; -} export interface MsgBatchCancelSpotOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse"; value: Uint8Array; @@ -1253,10 +1081,6 @@ export interface MsgBatchCancelBinaryOptionsOrders { sender: string; data: OrderData[]; } -export interface ReactiveMsgBatchCancelBinaryOptionsOrders { - sender: ComputedRef; - data: ComputedRef; -} export interface MsgBatchCancelBinaryOptionsOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders"; value: Uint8Array; @@ -1280,9 +1104,6 @@ export interface MsgBatchCancelBinaryOptionsOrdersAminoMsg { export interface MsgBatchCancelBinaryOptionsOrdersResponse { success: boolean[]; } -export interface ReactiveMsgBatchCancelBinaryOptionsOrdersResponse { - success: ComputedRef; -} export interface MsgBatchCancelBinaryOptionsOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse"; value: Uint8Array; @@ -1316,19 +1137,6 @@ export interface MsgBatchUpdateOrders { binaryOptionsMarketIdsToCancelAll: string[]; binaryOptionsOrdersToCreate?: DerivativeOrder[]; } -export interface ReactiveMsgBatchUpdateOrders { - sender: ComputedRef; - subaccountId: ComputedRef; - spotMarketIdsToCancelAll: ComputedRef; - derivativeMarketIdsToCancelAll: ComputedRef; - spotOrdersToCancel?: ComputedRef; - derivativeOrdersToCancel?: ComputedRef; - spotOrdersToCreate?: ComputedRef; - derivativeOrdersToCreate?: ComputedRef; - binaryOptionsOrdersToCancel?: ComputedRef; - binaryOptionsMarketIdsToCancelAll: ComputedRef; - binaryOptionsOrdersToCreate?: ComputedRef; -} export interface MsgBatchUpdateOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrders"; value: Uint8Array; @@ -1370,20 +1178,6 @@ export interface MsgBatchUpdateOrdersResponse { createdBinaryOptionsOrdersCids: string[]; failedBinaryOptionsOrdersCids: string[]; } -export interface ReactiveMsgBatchUpdateOrdersResponse { - spotCancelSuccess: ComputedRef; - derivativeCancelSuccess: ComputedRef; - spotOrderHashes: ComputedRef; - derivativeOrderHashes: ComputedRef; - binaryOptionsCancelSuccess: ComputedRef; - binaryOptionsOrderHashes: ComputedRef; - createdSpotOrdersCids: ComputedRef; - failedSpotOrdersCids: ComputedRef; - createdDerivativeOrdersCids: ComputedRef; - failedDerivativeOrdersCids: ComputedRef; - createdBinaryOptionsOrdersCids: ComputedRef; - failedBinaryOptionsOrdersCids: ComputedRef; -} export interface MsgBatchUpdateOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse"; value: Uint8Array; @@ -1412,10 +1206,6 @@ export interface MsgCreateDerivativeMarketOrder { sender: string; order: DerivativeOrder; } -export interface ReactiveMsgCreateDerivativeMarketOrder { - sender: ComputedRef; - order: ComputedRef; -} export interface MsgCreateDerivativeMarketOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder"; value: Uint8Array; @@ -1438,11 +1228,6 @@ export interface MsgCreateDerivativeMarketOrderResponse { results?: DerivativeMarketOrderResults; cid: string; } -export interface ReactiveMsgCreateDerivativeMarketOrderResponse { - orderHash: ComputedRef; - results?: ComputedRef; - cid: ComputedRef; -} export interface MsgCreateDerivativeMarketOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse"; value: Uint8Array; @@ -1467,13 +1252,6 @@ export interface DerivativeMarketOrderResults { positionDelta: PositionDelta; payout: string; } -export interface ReactiveDerivativeMarketOrderResults { - quantity: ComputedRef; - price: ComputedRef; - fee: ComputedRef; - positionDelta: ComputedRef; - payout: ComputedRef; -} export interface DerivativeMarketOrderResultsProtoMsg { typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderResults"; value: Uint8Array; @@ -1494,10 +1272,6 @@ export interface MsgCreateBinaryOptionsMarketOrder { sender: string; order: DerivativeOrder; } -export interface ReactiveMsgCreateBinaryOptionsMarketOrder { - sender: ComputedRef; - order: ComputedRef; -} export interface MsgCreateBinaryOptionsMarketOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder"; value: Uint8Array; @@ -1520,11 +1294,6 @@ export interface MsgCreateBinaryOptionsMarketOrderResponse { results?: DerivativeMarketOrderResults; cid: string; } -export interface ReactiveMsgCreateBinaryOptionsMarketOrderResponse { - orderHash: ComputedRef; - results?: ComputedRef; - cid: ComputedRef; -} export interface MsgCreateBinaryOptionsMarketOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse"; value: Uint8Array; @@ -1552,14 +1321,6 @@ export interface MsgCancelDerivativeOrder { orderMask: number; cid: string; } -export interface ReactiveMsgCancelDerivativeOrder { - sender: ComputedRef; - marketId: ComputedRef; - subaccountId: ComputedRef; - orderHash: ComputedRef; - orderMask: ComputedRef; - cid: ComputedRef; -} export interface MsgCancelDerivativeOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder"; value: Uint8Array; @@ -1583,7 +1344,6 @@ export interface MsgCancelDerivativeOrderAminoMsg { * Msg/CancelDerivativeOrderResponse response type. */ export interface MsgCancelDerivativeOrderResponse {} -export interface ReactiveMsgCancelDerivativeOrderResponse {} export interface MsgCancelDerivativeOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse"; value: Uint8Array; @@ -1610,14 +1370,6 @@ export interface MsgCancelBinaryOptionsOrder { orderMask: number; cid: string; } -export interface ReactiveMsgCancelBinaryOptionsOrder { - sender: ComputedRef; - marketId: ComputedRef; - subaccountId: ComputedRef; - orderHash: ComputedRef; - orderMask: ComputedRef; - cid: ComputedRef; -} export interface MsgCancelBinaryOptionsOrderProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder"; value: Uint8Array; @@ -1644,7 +1396,6 @@ export interface MsgCancelBinaryOptionsOrderAminoMsg { * Msg/CancelBinaryOptionsOrderResponse response type. */ export interface MsgCancelBinaryOptionsOrderResponse {} -export interface ReactiveMsgCancelBinaryOptionsOrderResponse {} export interface MsgCancelBinaryOptionsOrderResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse"; value: Uint8Array; @@ -1666,13 +1417,6 @@ export interface OrderData { orderMask: number; cid: string; } -export interface ReactiveOrderData { - marketId: ComputedRef; - subaccountId: ComputedRef; - orderHash: ComputedRef; - orderMask: ComputedRef; - cid: ComputedRef; -} export interface OrderDataProtoMsg { typeUrl: "/injective.exchange.v1beta1.OrderData"; value: Uint8Array; @@ -1697,10 +1441,6 @@ export interface MsgBatchCancelDerivativeOrders { sender: string; data: OrderData[]; } -export interface ReactiveMsgBatchCancelDerivativeOrders { - sender: ComputedRef; - data: ComputedRef; -} export interface MsgBatchCancelDerivativeOrdersProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders"; value: Uint8Array; @@ -1724,9 +1464,6 @@ export interface MsgBatchCancelDerivativeOrdersAminoMsg { export interface MsgBatchCancelDerivativeOrdersResponse { success: boolean[]; } -export interface ReactiveMsgBatchCancelDerivativeOrdersResponse { - success: ComputedRef; -} export interface MsgBatchCancelDerivativeOrdersResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse"; value: Uint8Array; @@ -1749,12 +1486,6 @@ export interface MsgSubaccountTransfer { destinationSubaccountId: string; amount: Coin; } -export interface ReactiveMsgSubaccountTransfer { - sender: ComputedRef; - sourceSubaccountId: ComputedRef; - destinationSubaccountId: ComputedRef; - amount: ComputedRef; -} export interface MsgSubaccountTransferProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransfer"; value: Uint8Array; @@ -1775,7 +1506,6 @@ export interface MsgSubaccountTransferAminoMsg { * type. */ export interface MsgSubaccountTransferResponse {} -export interface ReactiveMsgSubaccountTransferResponse {} export interface MsgSubaccountTransferResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse"; value: Uint8Array; @@ -1796,12 +1526,6 @@ export interface MsgExternalTransfer { destinationSubaccountId: string; amount: Coin; } -export interface ReactiveMsgExternalTransfer { - sender: ComputedRef; - sourceSubaccountId: ComputedRef; - destinationSubaccountId: ComputedRef; - amount: ComputedRef; -} export interface MsgExternalTransferProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgExternalTransfer"; value: Uint8Array; @@ -1819,7 +1543,6 @@ export interface MsgExternalTransferAminoMsg { } /** MsgExternalTransferResponse defines the Msg/ExternalTransfer response type. */ export interface MsgExternalTransferResponse {} -export interface ReactiveMsgExternalTransferResponse {} export interface MsgExternalTransferResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgExternalTransferResponse"; value: Uint8Array; @@ -1838,12 +1561,6 @@ export interface MsgLiquidatePosition { /** optional order to provide for liquidation */ order?: DerivativeOrder; } -export interface ReactiveMsgLiquidatePosition { - sender: ComputedRef; - subaccountId: ComputedRef; - marketId: ComputedRef; - order?: ComputedRef; -} export interface MsgLiquidatePositionProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePosition"; value: Uint8Array; @@ -1862,7 +1579,6 @@ export interface MsgLiquidatePositionAminoMsg { } /** MsgLiquidatePositionResponse defines the Msg/LiquidatePosition response type. */ export interface MsgLiquidatePositionResponse {} -export interface ReactiveMsgLiquidatePositionResponse {} export interface MsgLiquidatePositionResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse"; value: Uint8Array; @@ -1879,11 +1595,6 @@ export interface MsgEmergencySettleMarket { subaccountId: string; marketId: string; } -export interface ReactiveMsgEmergencySettleMarket { - sender: ComputedRef; - subaccountId: ComputedRef; - marketId: ComputedRef; -} export interface MsgEmergencySettleMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarket"; value: Uint8Array; @@ -1903,7 +1614,6 @@ export interface MsgEmergencySettleMarketAminoMsg { * response type. */ export interface MsgEmergencySettleMarketResponse {} -export interface ReactiveMsgEmergencySettleMarketResponse {} export interface MsgEmergencySettleMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse"; value: Uint8Array; @@ -1926,13 +1636,6 @@ export interface MsgIncreasePositionMargin { /** amount defines the amount of margin to add to the position */ amount: string; } -export interface ReactiveMsgIncreasePositionMargin { - sender: ComputedRef; - sourceSubaccountId: ComputedRef; - destinationSubaccountId: ComputedRef; - marketId: ComputedRef; - amount: ComputedRef; -} export interface MsgIncreasePositionMarginProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMargin"; value: Uint8Array; @@ -1955,7 +1658,6 @@ export interface MsgIncreasePositionMarginAminoMsg { * response type. */ export interface MsgIncreasePositionMarginResponse {} -export interface ReactiveMsgIncreasePositionMarginResponse {} export interface MsgIncreasePositionMarginResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse"; value: Uint8Array; @@ -1978,13 +1680,6 @@ export interface MsgDecreasePositionMargin { /** amount defines the amount of margin to withdraw from the position */ amount: string; } -export interface ReactiveMsgDecreasePositionMargin { - sender: ComputedRef; - sourceSubaccountId: ComputedRef; - destinationSubaccountId: ComputedRef; - marketId: ComputedRef; - amount: ComputedRef; -} export interface MsgDecreasePositionMarginProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMargin"; value: Uint8Array; @@ -2007,7 +1702,6 @@ export interface MsgDecreasePositionMarginAminoMsg { * response type. */ export interface MsgDecreasePositionMarginResponse {} -export interface ReactiveMsgDecreasePositionMarginResponse {} export interface MsgDecreasePositionMarginResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse"; value: Uint8Array; @@ -2034,12 +1728,6 @@ export interface MsgPrivilegedExecuteContract { /** data defines the call data used when executing the contract */ data: string; } -export interface ReactiveMsgPrivilegedExecuteContract { - sender: ComputedRef; - funds: ComputedRef; - contractAddress: ComputedRef; - data: ComputedRef; -} export interface MsgPrivilegedExecuteContractProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract"; value: Uint8Array; @@ -2065,9 +1753,6 @@ export interface MsgPrivilegedExecuteContractAminoMsg { export interface MsgPrivilegedExecuteContractResponse { fundsDiff: Coin[]; } -export interface ReactiveMsgPrivilegedExecuteContractResponse { - fundsDiff: ComputedRef; -} export interface MsgPrivilegedExecuteContractResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse"; value: Uint8Array; @@ -2084,9 +1769,6 @@ export interface MsgPrivilegedExecuteContractResponseAminoMsg { export interface MsgRewardsOptOut { sender: string; } -export interface ReactiveMsgRewardsOptOut { - sender: ComputedRef; -} export interface MsgRewardsOptOutProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOut"; value: Uint8Array; @@ -2101,7 +1783,6 @@ export interface MsgRewardsOptOutAminoMsg { } /** MsgRewardsOptOutResponse defines the Msg/RewardsOptOut response type. */ export interface MsgRewardsOptOutResponse {} -export interface ReactiveMsgRewardsOptOutResponse {} export interface MsgRewardsOptOutResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse"; value: Uint8Array; @@ -2118,11 +1799,6 @@ export interface MsgReclaimLockedFunds { lockedAccountPubKey: Uint8Array; signature: Uint8Array; } -export interface ReactiveMsgReclaimLockedFunds { - sender: ComputedRef; - lockedAccountPubKey: ComputedRef; - signature: ComputedRef; -} export interface MsgReclaimLockedFundsProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFunds"; value: Uint8Array; @@ -2142,7 +1818,6 @@ export interface MsgReclaimLockedFundsAminoMsg { * type. */ export interface MsgReclaimLockedFundsResponse {} -export interface ReactiveMsgReclaimLockedFundsResponse {} export interface MsgReclaimLockedFundsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse"; value: Uint8Array; @@ -2166,10 +1841,6 @@ export interface MsgSignData { */ data: Uint8Array; } -export interface ReactiveMsgSignData { - signer: ComputedRef; - data: ComputedRef; -} export interface MsgSignDataProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgSignData"; value: Uint8Array; @@ -2193,10 +1864,6 @@ export interface MsgSignDoc { signType: string; value: MsgSignData; } -export interface ReactiveMsgSignDoc { - signType: ComputedRef; - value: ComputedRef; -} export interface MsgSignDocProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgSignDoc"; value: Uint8Array; @@ -2226,14 +1893,6 @@ export interface MsgAdminUpdateBinaryOptionsMarket { /** Status of the market */ status: MarketStatus; } -export interface ReactiveMsgAdminUpdateBinaryOptionsMarket { - sender: ComputedRef; - marketId: ComputedRef; - settlementPrice?: ComputedRef; - expirationTimestamp: ComputedRef; - settlementTimestamp: ComputedRef; - status: ComputedRef; -} export interface MsgAdminUpdateBinaryOptionsMarketProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket"; value: Uint8Array; @@ -2263,7 +1922,6 @@ export interface MsgAdminUpdateBinaryOptionsMarketAminoMsg { * AdminUpdateBinaryOptionsMarket rpc method */ export interface MsgAdminUpdateBinaryOptionsMarketResponse {} -export interface ReactiveMsgAdminUpdateBinaryOptionsMarketResponse {} export interface MsgAdminUpdateBinaryOptionsMarketResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse"; value: Uint8Array; @@ -2282,10 +1940,6 @@ export interface MsgAuthorizeStakeGrants { sender: string; grants: GrantAuthorization[]; } -export interface ReactiveMsgAuthorizeStakeGrants { - sender: ComputedRef; - grants: ComputedRef; -} export interface MsgAuthorizeStakeGrantsProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants"; value: Uint8Array; @@ -2300,7 +1954,6 @@ export interface MsgAuthorizeStakeGrantsAminoMsg { value: MsgAuthorizeStakeGrantsAmino; } export interface MsgAuthorizeStakeGrantsResponse {} -export interface ReactiveMsgAuthorizeStakeGrantsResponse {} export interface MsgAuthorizeStakeGrantsResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse"; value: Uint8Array; @@ -2315,10 +1968,6 @@ export interface MsgActivateStakeGrant { sender: string; granter: string; } -export interface ReactiveMsgActivateStakeGrant { - sender: ComputedRef; - granter: ComputedRef; -} export interface MsgActivateStakeGrantProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrant"; value: Uint8Array; @@ -2333,7 +1982,6 @@ export interface MsgActivateStakeGrantAminoMsg { value: MsgActivateStakeGrantAmino; } export interface MsgActivateStakeGrantResponse {} -export interface ReactiveMsgActivateStakeGrantResponse {} export interface MsgActivateStakeGrantResponseProtoMsg { typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/events.ts b/libs/injective-vue/src/injective/insurance/v1beta1/events.ts index 5a996e43..b185e56b 100644 --- a/libs/injective-vue/src/injective/insurance/v1beta1/events.ts +++ b/libs/injective-vue/src/injective/insurance/v1beta1/events.ts @@ -3,13 +3,9 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface EventInsuranceFundUpdate { fund?: InsuranceFund; } -export interface ReactiveEventInsuranceFundUpdate { - fund?: ComputedRef; -} export interface EventInsuranceFundUpdateProtoMsg { typeUrl: "/injective.insurance.v1beta1.EventInsuranceFundUpdate"; value: Uint8Array; @@ -24,9 +20,6 @@ export interface EventInsuranceFundUpdateAminoMsg { export interface EventRequestRedemption { schedule?: RedemptionSchedule; } -export interface ReactiveEventRequestRedemption { - schedule?: ComputedRef; -} export interface EventRequestRedemptionProtoMsg { typeUrl: "/injective.insurance.v1beta1.EventRequestRedemption"; value: Uint8Array; @@ -44,10 +37,6 @@ export interface EventWithdrawRedemption { /** redeem coin amount in base_currency */ redeemCoin: Coin; } -export interface ReactiveEventWithdrawRedemption { - schedule?: ComputedRef; - redeemCoin: ComputedRef; -} export interface EventWithdrawRedemptionProtoMsg { typeUrl: "/injective.insurance.v1beta1.EventWithdrawRedemption"; value: Uint8Array; @@ -72,12 +61,6 @@ export interface EventUnderwrite { /** share coin amount */ shares: Coin; } -export interface ReactiveEventUnderwrite { - underwriter: ComputedRef; - marketId: ComputedRef; - deposit: ComputedRef; - shares: ComputedRef; -} export interface EventUnderwriteProtoMsg { typeUrl: "/injective.insurance.v1beta1.EventUnderwrite"; value: Uint8Array; @@ -101,11 +84,6 @@ export interface EventInsuranceWithdraw { marketTicker: string; withdrawal: Coin; } -export interface ReactiveEventInsuranceWithdraw { - marketId: ComputedRef; - marketTicker: ComputedRef; - withdrawal: ComputedRef; -} export interface EventInsuranceWithdrawProtoMsg { typeUrl: "/injective.insurance.v1beta1.EventInsuranceWithdraw"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/genesis.ts b/libs/injective-vue/src/injective/insurance/v1beta1/genesis.ts index 58526b1d..5b354fa4 100644 --- a/libs/injective-vue/src/injective/insurance/v1beta1/genesis.ts +++ b/libs/injective-vue/src/injective/insurance/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino, InsuranceFund, InsuranceFundAmino, RedemptionSched import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the insurance module's genesis state. */ export interface GenesisState { /** params defines all the parameters of related to insurance. */ @@ -25,13 +24,6 @@ export interface GenesisState { */ nextRedemptionScheduleId: bigint; } -export interface ReactiveGenesisState { - params: ComputedRef; - insuranceFunds: ComputedRef; - redemptionSchedule: ComputedRef; - nextShareDenomId: ComputedRef; - nextRedemptionScheduleId: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.insurance.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/insurance.ts b/libs/injective-vue/src/injective/insurance/v1beta1/insurance.ts index 9cdd2802..d8eafeef 100644 --- a/libs/injective-vue/src/injective/insurance/v1beta1/insurance.ts +++ b/libs/injective-vue/src/injective/insurance/v1beta1/insurance.ts @@ -5,7 +5,6 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface Params { /** * default_redemption_notice_period_duration defines the default minimum @@ -14,9 +13,6 @@ export interface Params { */ defaultRedemptionNoticePeriodDuration: Duration; } -export interface ReactiveParams { - defaultRedemptionNoticePeriodDuration: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.insurance.v1beta1.Params"; value: Uint8Array; @@ -70,19 +66,6 @@ export interface InsuranceFund { */ expiry: bigint; } -export interface ReactiveInsuranceFund { - depositDenom: ComputedRef; - insurancePoolTokenDenom: ComputedRef; - redemptionNoticePeriodDuration: ComputedRef; - balance: ComputedRef; - totalShare: ComputedRef; - marketId: ComputedRef; - marketTicker: ComputedRef; - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleType: ComputedRef; - expiry: ComputedRef; -} export interface InsuranceFundProtoMsg { typeUrl: "/injective.insurance.v1beta1.InsuranceFund"; value: Uint8Array; @@ -140,13 +123,6 @@ export interface RedemptionSchedule { /** the insurance_pool_token amount to redeem */ redemptionAmount: Coin; } -export interface ReactiveRedemptionSchedule { - id: ComputedRef; - marketId: ComputedRef; - redeemer: ComputedRef; - claimableRedemptionTime: ComputedRef; - redemptionAmount: ComputedRef; -} export interface RedemptionScheduleProtoMsg { typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.Query.ts deleted file mode 100644 index e708b801..00000000 --- a/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,288 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse, ReactiveQueryInsuranceParamsRequest, ReactiveQueryInsuranceFundRequest, ReactiveQueryInsuranceFundsRequest, ReactiveQueryEstimatedRedemptionsRequest, ReactiveQueryPendingRedemptionsRequest, ReactiveQueryModuleStateRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Retrieves insurance params */ - insuranceParams(request?: QueryInsuranceParamsRequest): Promise; - /** Retrieves individual insurance fund information from market id */ - insuranceFund(request: QueryInsuranceFundRequest): Promise; - /** Retrieves all insurance funds */ - insuranceFunds(request?: QueryInsuranceFundsRequest): Promise; - /** - * Retrives the value of insurance fund share token at current price (not - * pending redemption) - */ - estimatedRedemptions(request: QueryEstimatedRedemptionsRequest): Promise; - /** Retrieves pending redemptions' share token at current price */ - pendingRedemptions(request: QueryPendingRedemptionsRequest): Promise; - /** Retrieves the entire insurance module's state */ - insuranceModuleState(request?: QueryModuleStateRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Retrieves insurance params */ - insuranceParams = async (request: QueryInsuranceParamsRequest = {}): Promise => { - const data = QueryInsuranceParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Query", "InsuranceParams", data); - return promise.then(data => QueryInsuranceParamsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves individual insurance fund information from market id */ - insuranceFund = async (request: QueryInsuranceFundRequest): Promise => { - const data = QueryInsuranceFundRequest.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Query", "InsuranceFund", data); - return promise.then(data => QueryInsuranceFundResponse.decode(new BinaryReader(data))); - }; - /* Retrieves all insurance funds */ - insuranceFunds = async (request: QueryInsuranceFundsRequest = {}): Promise => { - const data = QueryInsuranceFundsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Query", "InsuranceFunds", data); - return promise.then(data => QueryInsuranceFundsResponse.decode(new BinaryReader(data))); - }; - /* Retrives the value of insurance fund share token at current price (not - pending redemption) */ - estimatedRedemptions = async (request: QueryEstimatedRedemptionsRequest): Promise => { - const data = QueryEstimatedRedemptionsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Query", "EstimatedRedemptions", data); - return promise.then(data => QueryEstimatedRedemptionsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves pending redemptions' share token at current price */ - pendingRedemptions = async (request: QueryPendingRedemptionsRequest): Promise => { - const data = QueryPendingRedemptionsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Query", "PendingRedemptions", data); - return promise.then(data => QueryPendingRedemptionsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire insurance module's state */ - insuranceModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Query", "InsuranceModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - insuranceParams(request?: QueryInsuranceParamsRequest): Promise { - return queryService.insuranceParams(request); - }, - insuranceFund(request: QueryInsuranceFundRequest): Promise { - return queryService.insuranceFund(request); - }, - insuranceFunds(request?: QueryInsuranceFundsRequest): Promise { - return queryService.insuranceFunds(request); - }, - estimatedRedemptions(request: QueryEstimatedRedemptionsRequest): Promise { - return queryService.estimatedRedemptions(request); - }, - pendingRedemptions(request: QueryPendingRedemptionsRequest): Promise { - return queryService.pendingRedemptions(request); - }, - insuranceModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.insuranceModuleState(request); - } - }; -}; -export interface UseInsuranceParamsQuery extends VueQueryParams { - request?: ReactiveQueryInsuranceParamsRequest; -} -export interface UseInsuranceFundQuery extends VueQueryParams { - request: ReactiveQueryInsuranceFundRequest; -} -export interface UseInsuranceFundsQuery extends VueQueryParams { - request?: ReactiveQueryInsuranceFundsRequest; -} -export interface UseEstimatedRedemptionsQuery extends VueQueryParams { - request: ReactiveQueryEstimatedRedemptionsRequest; -} -export interface UsePendingRedemptionsQuery extends VueQueryParams { - request: ReactiveQueryPendingRedemptionsRequest; -} -export interface UseInsuranceModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useInsuranceParams = ({ - request, - options - }: UseInsuranceParamsQuery) => { - const queryKey = ["insuranceParamsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.insuranceParams(params); - }, - ...options - }); - }; - const useInsuranceFund = ({ - request, - options - }: UseInsuranceFundQuery) => { - const queryKey = ["insuranceFundQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.insuranceFund(params); - }, - ...options - }); - }; - const useInsuranceFunds = ({ - request, - options - }: UseInsuranceFundsQuery) => { - const queryKey = ["insuranceFundsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.insuranceFunds(params); - }, - ...options - }); - }; - const useEstimatedRedemptions = ({ - request, - options - }: UseEstimatedRedemptionsQuery) => { - const queryKey = ["estimatedRedemptionsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.estimatedRedemptions(params); - }, - ...options - }); - }; - const usePendingRedemptions = ({ - request, - options - }: UsePendingRedemptionsQuery) => { - const queryKey = ["pendingRedemptionsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pendingRedemptions(params); - }, - ...options - }); - }; - const useInsuranceModuleState = ({ - request, - options - }: UseInsuranceModuleStateQuery) => { - const queryKey = ["insuranceModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.insuranceModuleState(params); - }, - ...options - }); - }; - return { - /** Retrieves insurance params */useInsuranceParams, - /** Retrieves individual insurance fund information from market id */useInsuranceFund, - /** Retrieves all insurance funds */useInsuranceFunds, - /** - * Retrives the value of insurance fund share token at current price (not - * pending redemption) - */ - useEstimatedRedemptions, - /** Retrieves pending redemptions' share token at current price */usePendingRedemptions, - /** Retrieves the entire insurance module's state */useInsuranceModuleState - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..b7b9ee1d --- /dev/null +++ b/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.func.ts @@ -0,0 +1,44 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetInsuranceParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceParamsRequest.encode, + decode: QueryInsuranceParamsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceParams", + clientResolver +}); +export const createGetInsuranceFund = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceFundRequest.encode, + decode: QueryInsuranceFundResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceFund", + clientResolver +}); +export const createGetInsuranceFunds = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceFundsRequest.encode, + decode: QueryInsuranceFundsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceFunds", + clientResolver +}); +export const createGetEstimatedRedemptions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryEstimatedRedemptionsRequest.encode, + decode: QueryEstimatedRedemptionsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "EstimatedRedemptions", + clientResolver +}); +export const createGetPendingRedemptions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPendingRedemptionsRequest.encode, + decode: QueryPendingRedemptionsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "PendingRedemptions", + clientResolver +}); +export const createGetInsuranceModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..bc636668 --- /dev/null +++ b/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts @@ -0,0 +1,27 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetInsuranceParams, createGetInsuranceFund, createGetInsuranceFunds, createGetEstimatedRedemptions, createGetPendingRedemptions, createGetInsuranceModuleState } from "./query.rpc.func.ts"; +export const useGetInsuranceParams = buildUseVueQuery({ + builderQueryFn: createGetInsuranceParams, + queryKeyPrefix: "InsuranceParamsQuery" +}); +export const useGetInsuranceFund = buildUseVueQuery({ + builderQueryFn: createGetInsuranceFund, + queryKeyPrefix: "InsuranceFundQuery" +}); +export const useGetInsuranceFunds = buildUseVueQuery({ + builderQueryFn: createGetInsuranceFunds, + queryKeyPrefix: "InsuranceFundsQuery" +}); +export const useGetEstimatedRedemptions = buildUseVueQuery({ + builderQueryFn: createGetEstimatedRedemptions, + queryKeyPrefix: "EstimatedRedemptionsQuery" +}); +export const useGetPendingRedemptions = buildUseVueQuery({ + builderQueryFn: createGetPendingRedemptions, + queryKeyPrefix: "PendingRedemptionsQuery" +}); +export const useGetInsuranceModuleState = buildUseVueQuery({ + builderQueryFn: createGetInsuranceModuleState, + queryKeyPrefix: "InsuranceModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/query.ts b/libs/injective-vue/src/injective/insurance/v1beta1/query.ts index a475c60c..f8ee7aae 100644 --- a/libs/injective-vue/src/injective/insurance/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/insurance/v1beta1/query.ts @@ -4,13 +4,11 @@ import { GenesisState, GenesisStateAmino } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * QueryInsuranceParamsRequest is the request type for the Query/InsuranceParams * RPC method. */ export interface QueryInsuranceParamsRequest {} -export interface ReactiveQueryInsuranceParamsRequest {} export interface QueryInsuranceParamsRequestProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest"; value: Uint8Array; @@ -31,9 +29,6 @@ export interface QueryInsuranceParamsRequestAminoMsg { export interface QueryInsuranceParamsResponse { params: Params; } -export interface ReactiveQueryInsuranceParamsResponse { - params: ComputedRef; -} export interface QueryInsuranceParamsResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse"; value: Uint8Array; @@ -57,9 +52,6 @@ export interface QueryInsuranceFundRequest { /** Market ID for the market */ marketId: string; } -export interface ReactiveQueryInsuranceFundRequest { - marketId: ComputedRef; -} export interface QueryInsuranceFundRequestProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundRequest"; value: Uint8Array; @@ -83,9 +75,6 @@ export interface QueryInsuranceFundRequestAminoMsg { export interface QueryInsuranceFundResponse { fund?: InsuranceFund; } -export interface ReactiveQueryInsuranceFundResponse { - fund?: ComputedRef; -} export interface QueryInsuranceFundResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundResponse"; value: Uint8Array; @@ -106,7 +95,6 @@ export interface QueryInsuranceFundResponseAminoMsg { * RPC method. */ export interface QueryInsuranceFundsRequest {} -export interface ReactiveQueryInsuranceFundsRequest {} export interface QueryInsuranceFundsRequestProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest"; value: Uint8Array; @@ -127,9 +115,6 @@ export interface QueryInsuranceFundsRequestAminoMsg { export interface QueryInsuranceFundsResponse { funds: InsuranceFund[]; } -export interface ReactiveQueryInsuranceFundsResponse { - funds: ComputedRef; -} export interface QueryInsuranceFundsResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse"; value: Uint8Array; @@ -153,10 +138,6 @@ export interface QueryEstimatedRedemptionsRequest { marketId: string; address: string; } -export interface ReactiveQueryEstimatedRedemptionsRequest { - marketId: ComputedRef; - address: ComputedRef; -} export interface QueryEstimatedRedemptionsRequestProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest"; value: Uint8Array; @@ -180,9 +161,6 @@ export interface QueryEstimatedRedemptionsRequestAminoMsg { export interface QueryEstimatedRedemptionsResponse { amount: Coin[]; } -export interface ReactiveQueryEstimatedRedemptionsResponse { - amount: ComputedRef; -} export interface QueryEstimatedRedemptionsResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse"; value: Uint8Array; @@ -206,10 +184,6 @@ export interface QueryPendingRedemptionsRequest { marketId: string; address: string; } -export interface ReactiveQueryPendingRedemptionsRequest { - marketId: ComputedRef; - address: ComputedRef; -} export interface QueryPendingRedemptionsRequestProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest"; value: Uint8Array; @@ -233,9 +207,6 @@ export interface QueryPendingRedemptionsRequestAminoMsg { export interface QueryPendingRedemptionsResponse { amount: Coin[]; } -export interface ReactiveQueryPendingRedemptionsResponse { - amount: ComputedRef; -} export interface QueryPendingRedemptionsResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse"; value: Uint8Array; @@ -256,7 +227,6 @@ export interface QueryPendingRedemptionsResponseAminoMsg { * Query/InsuranceModuleState RPC method. */ export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryModuleStateRequest"; value: Uint8Array; @@ -277,9 +247,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.QueryModuleStateResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/tx.amino.ts b/libs/injective-vue/src/injective/insurance/v1beta1/tx.amino.ts deleted file mode 100644 index 43bb8eb7..00000000 --- a/libs/injective-vue/src/injective/insurance/v1beta1/tx.amino.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/injective.insurance.v1beta1.MsgCreateInsuranceFund": { - aminoType: "insurance/MsgCreateInsuranceFund", - toAmino: MsgCreateInsuranceFund.toAmino, - fromAmino: MsgCreateInsuranceFund.fromAmino - }, - "/injective.insurance.v1beta1.MsgUnderwrite": { - aminoType: "insurance/MsgUnderwrite", - toAmino: MsgUnderwrite.toAmino, - fromAmino: MsgUnderwrite.fromAmino - }, - "/injective.insurance.v1beta1.MsgRequestRedemption": { - aminoType: "insurance/MsgRequestRedemption", - toAmino: MsgRequestRedemption.toAmino, - fromAmino: MsgRequestRedemption.fromAmino - }, - "/injective.insurance.v1beta1.MsgUpdateParams": { - aminoType: "insurance/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..34466eaa --- /dev/null +++ b/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; +export const createCreateInsuranceFund = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateInsuranceFund.typeUrl, + encoders: toEncoders(MsgCreateInsuranceFund), + converters: toConverters(MsgCreateInsuranceFund) +}); +export const createUnderwrite = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnderwrite.typeUrl, + encoders: toEncoders(MsgUnderwrite), + converters: toConverters(MsgUnderwrite) +}); +export const createRequestRedemption = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestRedemption.typeUrl, + encoders: toEncoders(MsgRequestRedemption), + converters: toConverters(MsgRequestRedemption) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 14292426..00000000 --- a/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateInsuranceFund, MsgCreateInsuranceFundResponse, MsgUnderwrite, MsgUnderwriteResponse, MsgRequestRedemption, MsgRequestRedemptionResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the insurance Msg service. */ -export interface Msg { - /** CreateInsuranceFund defines a method for creating an insurance fund */ - createInsuranceFund(request: MsgCreateInsuranceFund): Promise; - /** - * Underwrite defines a method for depositing tokens to underwrite an - * insurance fund - */ - underwrite(request: MsgUnderwrite): Promise; - /** - * RequestRedemption defines a method for requesting a redemption of the - * sender's insurance fund tokens - */ - requestRedemption(request: MsgRequestRedemption): Promise; - updateParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateInsuranceFund defines a method for creating an insurance fund */ - createInsuranceFund = async (request: MsgCreateInsuranceFund): Promise => { - const data = MsgCreateInsuranceFund.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Msg", "CreateInsuranceFund", data); - return promise.then(data => MsgCreateInsuranceFundResponse.decode(new BinaryReader(data))); - }; - /* Underwrite defines a method for depositing tokens to underwrite an - insurance fund */ - underwrite = async (request: MsgUnderwrite): Promise => { - const data = MsgUnderwrite.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Msg", "Underwrite", data); - return promise.then(data => MsgUnderwriteResponse.decode(new BinaryReader(data))); - }; - /* RequestRedemption defines a method for requesting a redemption of the - sender's insurance fund tokens */ - requestRedemption = async (request: MsgRequestRedemption): Promise => { - const data = MsgRequestRedemption.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Msg", "RequestRedemption", data); - return promise.then(data => MsgRequestRedemptionResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.insurance.v1beta1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..30b28d00 --- /dev/null +++ b/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; +import { createCreateInsuranceFund, createUnderwrite, createRequestRedemption, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateInsuranceFund = buildUseVueMutation({ + builderMutationFn: createCreateInsuranceFund +}); +export const useUnderwrite = buildUseVueMutation({ + builderMutationFn: createUnderwrite +}); +export const useRequestRedemption = buildUseVueMutation({ + builderMutationFn: createRequestRedemption +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/tx.ts b/libs/injective-vue/src/injective/insurance/v1beta1/tx.ts index 6ed2884d..1965e15c 100644 --- a/libs/injective-vue/src/injective/insurance/v1beta1/tx.ts +++ b/libs/injective-vue/src/injective/insurance/v1beta1/tx.ts @@ -4,7 +4,6 @@ import { Params, ParamsAmino } from "./insurance"; import { isSet, DeepPartial } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgCreateInsuranceFund a message to create an insurance fund for a derivative * market. @@ -36,16 +35,6 @@ export interface MsgCreateInsuranceFund { /** Initial deposit of the insurance fund */ initialDeposit: Coin; } -export interface ReactiveMsgCreateInsuranceFund { - sender: ComputedRef; - ticker: ComputedRef; - quoteDenom: ComputedRef; - oracleBase: ComputedRef; - oracleQuote: ComputedRef; - oracleType: ComputedRef; - expiry: ComputedRef; - initialDeposit: ComputedRef; -} export interface MsgCreateInsuranceFundProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFund"; value: Uint8Array; @@ -86,7 +75,6 @@ export interface MsgCreateInsuranceFundAminoMsg { value: MsgCreateInsuranceFundAmino; } export interface MsgCreateInsuranceFundResponse {} -export interface ReactiveMsgCreateInsuranceFundResponse {} export interface MsgCreateInsuranceFundResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse"; value: Uint8Array; @@ -108,11 +96,6 @@ export interface MsgUnderwrite { /** Amount of quote_denom to underwrite the insurance fund. */ deposit: Coin; } -export interface ReactiveMsgUnderwrite { - sender: ComputedRef; - marketId: ComputedRef; - deposit: ComputedRef; -} export interface MsgUnderwriteProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgUnderwrite"; value: Uint8Array; @@ -134,7 +117,6 @@ export interface MsgUnderwriteAminoMsg { value: MsgUnderwriteAmino; } export interface MsgUnderwriteResponse {} -export interface ReactiveMsgUnderwriteResponse {} export interface MsgUnderwriteResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgUnderwriteResponse"; value: Uint8Array; @@ -156,11 +138,6 @@ export interface MsgRequestRedemption { /** Insurance fund share token amount to be redeemed. */ amount: Coin; } -export interface ReactiveMsgRequestRedemption { - sender: ComputedRef; - marketId: ComputedRef; - amount: ComputedRef; -} export interface MsgRequestRedemptionProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemption"; value: Uint8Array; @@ -182,7 +159,6 @@ export interface MsgRequestRedemptionAminoMsg { value: MsgRequestRedemptionAmino; } export interface MsgRequestRedemptionResponse {} -export interface ReactiveMsgRequestRedemptionResponse {} export interface MsgRequestRedemptionResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse"; value: Uint8Array; @@ -202,10 +178,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -225,7 +197,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.insurance.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/genesis.ts b/libs/injective-vue/src/injective/ocr/v1beta1/genesis.ts index 36ebbe01..e9acc831 100644 --- a/libs/injective-vue/src/injective/ocr/v1beta1/genesis.ts +++ b/libs/injective-vue/src/injective/ocr/v1beta1/genesis.ts @@ -3,7 +3,6 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the OCR module's genesis state. */ export interface GenesisState { /** params defines all the parameters of related to OCR. */ @@ -28,17 +27,6 @@ export interface GenesisState { /** pending_payeeships stores the pending payeeships */ pendingPayeeships: PendingPayeeship[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - feedConfigs: ComputedRef; - latestEpochAndRounds: ComputedRef; - feedTransmissions: ComputedRef; - latestAggregatorRoundIds: ComputedRef; - rewardPools: ComputedRef; - feedObservationCounts: ComputedRef; - feedTransmissionCounts: ComputedRef; - pendingPayeeships: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.ocr.v1beta1.GenesisState"; value: Uint8Array; @@ -75,10 +63,6 @@ export interface FeedTransmission { feedId: string; transmission?: Transmission; } -export interface ReactiveFeedTransmission { - feedId: ComputedRef; - transmission?: ComputedRef; -} export interface FeedTransmissionProtoMsg { typeUrl: "/injective.ocr.v1beta1.FeedTransmission"; value: Uint8Array; @@ -95,10 +79,6 @@ export interface FeedEpochAndRound { feedId: string; epochAndRound?: EpochAndRound; } -export interface ReactiveFeedEpochAndRound { - feedId: ComputedRef; - epochAndRound?: ComputedRef; -} export interface FeedEpochAndRoundProtoMsg { typeUrl: "/injective.ocr.v1beta1.FeedEpochAndRound"; value: Uint8Array; @@ -115,10 +95,6 @@ export interface FeedLatestAggregatorRoundIDs { feedId: string; aggregatorRoundId: bigint; } -export interface ReactiveFeedLatestAggregatorRoundIDs { - feedId: ComputedRef; - aggregatorRoundId: ComputedRef; -} export interface FeedLatestAggregatorRoundIDsProtoMsg { typeUrl: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs"; value: Uint8Array; @@ -135,10 +111,6 @@ export interface RewardPool { feedId: string; amount: Coin; } -export interface ReactiveRewardPool { - feedId: ComputedRef; - amount: ComputedRef; -} export interface RewardPoolProtoMsg { typeUrl: "/injective.ocr.v1beta1.RewardPool"; value: Uint8Array; @@ -155,10 +127,6 @@ export interface FeedCounts { feedId: string; counts: Count[]; } -export interface ReactiveFeedCounts { - feedId: ComputedRef; - counts: ComputedRef; -} export interface FeedCountsProtoMsg { typeUrl: "/injective.ocr.v1beta1.FeedCounts"; value: Uint8Array; @@ -175,10 +143,6 @@ export interface Count { address: string; count: bigint; } -export interface ReactiveCount { - address: ComputedRef; - count: ComputedRef; -} export interface CountProtoMsg { typeUrl: "/injective.ocr.v1beta1.Count"; value: Uint8Array; @@ -196,11 +160,6 @@ export interface PendingPayeeship { transmitter: string; proposedPayee: string; } -export interface ReactivePendingPayeeship { - feedId: ComputedRef; - transmitter: ComputedRef; - proposedPayee: ComputedRef; -} export interface PendingPayeeshipProtoMsg { typeUrl: "/injective.ocr.v1beta1.PendingPayeeship"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/ocr.ts b/libs/injective-vue/src/injective/ocr/v1beta1/ocr.ts index 58e4942c..6a93f048 100644 --- a/libs/injective-vue/src/injective/ocr/v1beta1/ocr.ts +++ b/libs/injective-vue/src/injective/ocr/v1beta1/ocr.ts @@ -3,7 +3,6 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface Params { /** Native denom for LINK coin in the bank keeper */ linkDenom: string; @@ -12,11 +11,6 @@ export interface Params { /** The admin for the OCR module */ moduleAdmin: string; } -export interface ReactiveParams { - linkDenom: ComputedRef; - payoutBlockInterval: ComputedRef; - moduleAdmin: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.ocr.v1beta1.Params"; value: Uint8Array; @@ -61,15 +55,6 @@ export interface FeedConfig { /** feed-specific params for the Cosmos module. */ moduleParams?: ModuleParams; } -export interface ReactiveFeedConfig { - signers: ComputedRef; - transmitters: ComputedRef; - f: ComputedRef; - onchainConfig: ComputedRef; - offchainConfigVersion: ComputedRef; - offchainConfig: ComputedRef; - moduleParams?: ComputedRef; -} export interface FeedConfigProtoMsg { typeUrl: "/injective.ocr.v1beta1.FeedConfig"; value: Uint8Array; @@ -117,13 +102,6 @@ export interface FeedConfigInfo { configCount: bigint; latestConfigBlockNumber: bigint; } -export interface ReactiveFeedConfigInfo { - latestConfigDigest: ComputedRef; - f: ComputedRef; - n: ComputedRef; - configCount: ComputedRef; - latestConfigBlockNumber: ComputedRef; -} export interface FeedConfigInfoProtoMsg { typeUrl: "/injective.ocr.v1beta1.FeedConfigInfo"; value: Uint8Array; @@ -168,18 +146,6 @@ export interface ModuleParams { /** feed billing administrator */ billingAdmin: string; } -export interface ReactiveModuleParams { - feedId: ComputedRef; - minAnswer: ComputedRef; - maxAnswer: ComputedRef; - linkPerObservation: ComputedRef; - linkPerTransmission: ComputedRef; - linkDenom: ComputedRef; - uniqueReports: ComputedRef; - description: ComputedRef; - feedAdmin: ComputedRef; - billingAdmin: ComputedRef; -} export interface ModuleParamsProtoMsg { typeUrl: "/injective.ocr.v1beta1.ModuleParams"; value: Uint8Array; @@ -244,15 +210,6 @@ export interface ContractConfig { */ offchainConfig: Uint8Array; } -export interface ReactiveContractConfig { - configCount: ComputedRef; - signers: ComputedRef; - transmitters: ComputedRef; - f: ComputedRef; - onchainConfig: ComputedRef; - offchainConfigVersion: ComputedRef; - offchainConfig: ComputedRef; -} export interface ContractConfigProtoMsg { typeUrl: "/injective.ocr.v1beta1.ContractConfig"; value: Uint8Array; @@ -297,11 +254,6 @@ export interface SetConfigProposal { description: string; config?: FeedConfig; } -export interface ReactiveSetConfigProposal { - title: ComputedRef; - description: ComputedRef; - config?: ComputedRef; -} export interface SetConfigProposalProtoMsg { typeUrl: "/injective.ocr.v1beta1.SetConfigProposal"; value: Uint8Array; @@ -351,19 +303,6 @@ export interface FeedProperties { */ description: string; } -export interface ReactiveFeedProperties { - feedId: ComputedRef; - f: ComputedRef; - onchainConfig: ComputedRef; - offchainConfigVersion: ComputedRef; - offchainConfig: ComputedRef; - minAnswer: ComputedRef; - maxAnswer: ComputedRef; - linkPerObservation: ComputedRef; - linkPerTransmission: ComputedRef; - uniqueReports: ComputedRef; - description: ComputedRef; -} export interface FeedPropertiesProtoMsg { typeUrl: "/injective.ocr.v1beta1.FeedProperties"; value: Uint8Array; @@ -423,14 +362,6 @@ export interface SetBatchConfigProposal { /** feed properties */ feedProperties: FeedProperties[]; } -export interface ReactiveSetBatchConfigProposal { - title: ComputedRef; - description: ComputedRef; - signers: ComputedRef; - transmitters: ComputedRef; - linkDenom: ComputedRef; - feedProperties: ComputedRef; -} export interface SetBatchConfigProposalProtoMsg { typeUrl: "/injective.ocr.v1beta1.SetBatchConfigProposal"; value: Uint8Array; @@ -457,9 +388,6 @@ export interface SetBatchConfigProposalAminoMsg { export interface OracleObservationsCounts { counts: number[]; } -export interface ReactiveOracleObservationsCounts { - counts: ComputedRef; -} export interface OracleObservationsCountsProtoMsg { typeUrl: "/injective.ocr.v1beta1.OracleObservationsCounts"; value: Uint8Array; @@ -475,9 +403,6 @@ export interface OracleObservationsCountsAminoMsg { export interface GasReimbursements { reimbursements: Coin[]; } -export interface ReactiveGasReimbursements { - reimbursements: ComputedRef; -} export interface GasReimbursementsProtoMsg { typeUrl: "/injective.ocr.v1beta1.GasReimbursements"; value: Uint8Array; @@ -494,10 +419,6 @@ export interface Payee { transmitterAddr: string; paymentAddr: string; } -export interface ReactivePayee { - transmitterAddr: ComputedRef; - paymentAddr: ComputedRef; -} export interface PayeeProtoMsg { typeUrl: "/injective.ocr.v1beta1.Payee"; value: Uint8Array; @@ -521,11 +442,6 @@ export interface Transmission { /** when was report received onchain */ transmissionTimestamp: bigint; } -export interface ReactiveTransmission { - answer: ComputedRef; - observationsTimestamp: ComputedRef; - transmissionTimestamp: ComputedRef; -} export interface TransmissionProtoMsg { typeUrl: "/injective.ocr.v1beta1.Transmission"; value: Uint8Array; @@ -549,10 +465,6 @@ export interface EpochAndRound { epoch: bigint; round: bigint; } -export interface ReactiveEpochAndRound { - epoch: ComputedRef; - round: ComputedRef; -} export interface EpochAndRoundProtoMsg { typeUrl: "/injective.ocr.v1beta1.EpochAndRound"; value: Uint8Array; @@ -571,11 +483,6 @@ export interface Report { observers: Uint8Array; observations: string[]; } -export interface ReactiveReport { - observationsTimestamp: ComputedRef; - observers: ComputedRef; - observations: ComputedRef; -} export interface ReportProtoMsg { typeUrl: "/injective.ocr.v1beta1.Report"; value: Uint8Array; @@ -598,13 +505,6 @@ export interface ReportToSign { /** Opaque report */ report: Uint8Array; } -export interface ReactiveReportToSign { - configDigest: ComputedRef; - epoch: ComputedRef; - round: ComputedRef; - extraHash: ComputedRef; - report: ComputedRef; -} export interface ReportToSignProtoMsg { typeUrl: "/injective.ocr.v1beta1.ReportToSign"; value: Uint8Array; @@ -626,11 +526,6 @@ export interface EventOraclePaid { payeeAddr: string; amount: Coin; } -export interface ReactiveEventOraclePaid { - transmitterAddr: ComputedRef; - payeeAddr: ComputedRef; - amount: ComputedRef; -} export interface EventOraclePaidProtoMsg { typeUrl: "/injective.ocr.v1beta1.EventOraclePaid"; value: Uint8Array; @@ -649,11 +544,6 @@ export interface EventAnswerUpdated { roundId: string; updatedAt: Date; } -export interface ReactiveEventAnswerUpdated { - current: ComputedRef; - roundId: ComputedRef; - updatedAt: ComputedRef; -} export interface EventAnswerUpdatedProtoMsg { typeUrl: "/injective.ocr.v1beta1.EventAnswerUpdated"; value: Uint8Array; @@ -673,11 +563,6 @@ export interface EventNewRound { startedBy: string; startedAt: Date; } -export interface ReactiveEventNewRound { - roundId: ComputedRef; - startedBy: ComputedRef; - startedAt: ComputedRef; -} export interface EventNewRoundProtoMsg { typeUrl: "/injective.ocr.v1beta1.EventNewRound"; value: Uint8Array; @@ -696,10 +581,6 @@ export interface EventTransmitted { configDigest: Uint8Array; epoch: bigint; } -export interface ReactiveEventTransmitted { - configDigest: ComputedRef; - epoch: ComputedRef; -} export interface EventTransmittedProtoMsg { typeUrl: "/injective.ocr.v1beta1.EventTransmitted"; value: Uint8Array; @@ -723,17 +604,6 @@ export interface EventNewTransmission { configDigest: Uint8Array; epochAndRound?: EpochAndRound; } -export interface ReactiveEventNewTransmission { - feedId: ComputedRef; - aggregatorRoundId: ComputedRef; - answer: ComputedRef; - transmitter: ComputedRef; - observationsTimestamp: ComputedRef; - observations: ComputedRef; - observers: ComputedRef; - configDigest: ComputedRef; - epochAndRound?: ComputedRef; -} export interface EventNewTransmissionProtoMsg { typeUrl: "/injective.ocr.v1beta1.EventNewTransmission"; value: Uint8Array; @@ -764,12 +634,6 @@ export interface EventConfigSet { config?: FeedConfig; configInfo?: FeedConfigInfo; } -export interface ReactiveEventConfigSet { - configDigest: ComputedRef; - previousConfigBlockNumber: ComputedRef; - config?: ComputedRef; - configInfo?: ComputedRef; -} export interface EventConfigSetProtoMsg { typeUrl: "/injective.ocr.v1beta1.EventConfigSet"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.Query.ts deleted file mode 100644 index d302507c..00000000 --- a/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,327 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse, ReactiveQueryParamsRequest, ReactiveQueryFeedConfigRequest, ReactiveQueryFeedConfigInfoRequest, ReactiveQueryLatestRoundRequest, ReactiveQueryLatestTransmissionDetailsRequest, ReactiveQueryOwedAmountRequest, ReactiveQueryModuleStateRequest } from "./query"; -/** Query defines the gRPC querier service for OCR module. */ -export interface Query { - params(request?: QueryParamsRequest): Promise; - /** Retrieves the OCR FeedConfig for a given FeedId */ - feedConfig(request: QueryFeedConfigRequest): Promise; - /** Retrieves the OCR FeedConfigInfo for a given FeedId */ - feedConfigInfo(request: QueryFeedConfigInfoRequest): Promise; - /** Retrieves latest round ID and data, including median answer for that round */ - latestRound(request: QueryLatestRoundRequest): Promise; - /** - * LatestTransmissionDetails returns details about the latest trasmission - * recorded on chain for the given feed ID. - */ - latestTransmissionDetails(request: QueryLatestTransmissionDetailsRequest): Promise; - /** Retrieves transmitter's owed amount */ - owedAmount(request: QueryOwedAmountRequest): Promise; - /** Retrieves the entire OCR module's state */ - ocrModuleState(request?: QueryModuleStateRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params */ - params = async (request: QueryParamsRequest = {}): Promise => { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the OCR FeedConfig for a given FeedId */ - feedConfig = async (request: QueryFeedConfigRequest): Promise => { - const data = QueryFeedConfigRequest.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Query", "FeedConfig", data); - return promise.then(data => QueryFeedConfigResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the OCR FeedConfigInfo for a given FeedId */ - feedConfigInfo = async (request: QueryFeedConfigInfoRequest): Promise => { - const data = QueryFeedConfigInfoRequest.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Query", "FeedConfigInfo", data); - return promise.then(data => QueryFeedConfigInfoResponse.decode(new BinaryReader(data))); - }; - /* Retrieves latest round ID and data, including median answer for that round */ - latestRound = async (request: QueryLatestRoundRequest): Promise => { - const data = QueryLatestRoundRequest.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Query", "LatestRound", data); - return promise.then(data => QueryLatestRoundResponse.decode(new BinaryReader(data))); - }; - /* LatestTransmissionDetails returns details about the latest trasmission - recorded on chain for the given feed ID. */ - latestTransmissionDetails = async (request: QueryLatestTransmissionDetailsRequest): Promise => { - const data = QueryLatestTransmissionDetailsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Query", "LatestTransmissionDetails", data); - return promise.then(data => QueryLatestTransmissionDetailsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves transmitter's owed amount */ - owedAmount = async (request: QueryOwedAmountRequest): Promise => { - const data = QueryOwedAmountRequest.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Query", "OwedAmount", data); - return promise.then(data => QueryOwedAmountResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire OCR module's state */ - ocrModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Query", "OcrModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - feedConfig(request: QueryFeedConfigRequest): Promise { - return queryService.feedConfig(request); - }, - feedConfigInfo(request: QueryFeedConfigInfoRequest): Promise { - return queryService.feedConfigInfo(request); - }, - latestRound(request: QueryLatestRoundRequest): Promise { - return queryService.latestRound(request); - }, - latestTransmissionDetails(request: QueryLatestTransmissionDetailsRequest): Promise { - return queryService.latestTransmissionDetails(request); - }, - owedAmount(request: QueryOwedAmountRequest): Promise { - return queryService.owedAmount(request); - }, - ocrModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.ocrModuleState(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseFeedConfigQuery extends VueQueryParams { - request: ReactiveQueryFeedConfigRequest; -} -export interface UseFeedConfigInfoQuery extends VueQueryParams { - request: ReactiveQueryFeedConfigInfoRequest; -} -export interface UseLatestRoundQuery extends VueQueryParams { - request: ReactiveQueryLatestRoundRequest; -} -export interface UseLatestTransmissionDetailsQuery extends VueQueryParams { - request: ReactiveQueryLatestTransmissionDetailsRequest; -} -export interface UseOwedAmountQuery extends VueQueryParams { - request: ReactiveQueryOwedAmountRequest; -} -export interface UseOcrModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useFeedConfig = ({ - request, - options - }: UseFeedConfigQuery) => { - const queryKey = ["feedConfigQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.feedConfig(params); - }, - ...options - }); - }; - const useFeedConfigInfo = ({ - request, - options - }: UseFeedConfigInfoQuery) => { - const queryKey = ["feedConfigInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.feedConfigInfo(params); - }, - ...options - }); - }; - const useLatestRound = ({ - request, - options - }: UseLatestRoundQuery) => { - const queryKey = ["latestRoundQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.latestRound(params); - }, - ...options - }); - }; - const useLatestTransmissionDetails = ({ - request, - options - }: UseLatestTransmissionDetailsQuery) => { - const queryKey = ["latestTransmissionDetailsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.latestTransmissionDetails(params); - }, - ...options - }); - }; - const useOwedAmount = ({ - request, - options - }: UseOwedAmountQuery) => { - const queryKey = ["owedAmountQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.owedAmount(params); - }, - ...options - }); - }; - const useOcrModuleState = ({ - request, - options - }: UseOcrModuleStateQuery) => { - const queryKey = ["ocrModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.ocrModuleState(params); - }, - ...options - }); - }; - return { - useParams, - /** Retrieves the OCR FeedConfig for a given FeedId */useFeedConfig, - /** Retrieves the OCR FeedConfigInfo for a given FeedId */useFeedConfigInfo, - /** Retrieves latest round ID and data, including median answer for that round */useLatestRound, - /** - * LatestTransmissionDetails returns details about the latest trasmission - * recorded on chain for the given feed ID. - */ - useLatestTransmissionDetails, - /** Retrieves transmitter's owed amount */useOwedAmount, - /** Retrieves the entire OCR module's state */useOcrModuleState - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..028e63a7 --- /dev/null +++ b/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.func.ts @@ -0,0 +1,51 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetFeedConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeedConfigRequest.encode, + decode: QueryFeedConfigResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "FeedConfig", + clientResolver +}); +export const createGetFeedConfigInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeedConfigInfoRequest.encode, + decode: QueryFeedConfigInfoResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "FeedConfigInfo", + clientResolver +}); +export const createGetLatestRound = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLatestRoundRequest.encode, + decode: QueryLatestRoundResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "LatestRound", + clientResolver +}); +export const createGetLatestTransmissionDetails = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLatestTransmissionDetailsRequest.encode, + decode: QueryLatestTransmissionDetailsResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "LatestTransmissionDetails", + clientResolver +}); +export const createGetOwedAmount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOwedAmountRequest.encode, + decode: QueryOwedAmountResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "OwedAmount", + clientResolver +}); +export const createGetOcrModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "OcrModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..da233454 --- /dev/null +++ b/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts @@ -0,0 +1,31 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetParams, createGetFeedConfig, createGetFeedConfigInfo, createGetLatestRound, createGetLatestTransmissionDetails, createGetOwedAmount, createGetOcrModuleState } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetFeedConfig = buildUseVueQuery({ + builderQueryFn: createGetFeedConfig, + queryKeyPrefix: "FeedConfigQuery" +}); +export const useGetFeedConfigInfo = buildUseVueQuery({ + builderQueryFn: createGetFeedConfigInfo, + queryKeyPrefix: "FeedConfigInfoQuery" +}); +export const useGetLatestRound = buildUseVueQuery({ + builderQueryFn: createGetLatestRound, + queryKeyPrefix: "LatestRoundQuery" +}); +export const useGetLatestTransmissionDetails = buildUseVueQuery({ + builderQueryFn: createGetLatestTransmissionDetails, + queryKeyPrefix: "LatestTransmissionDetailsQuery" +}); +export const useGetOwedAmount = buildUseVueQuery({ + builderQueryFn: createGetOwedAmount, + queryKeyPrefix: "OwedAmountQuery" +}); +export const useGetOcrModuleState = buildUseVueQuery({ + builderQueryFn: createGetOcrModuleState, + queryKeyPrefix: "OcrModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/query.ts b/libs/injective-vue/src/injective/ocr/v1beta1/query.ts index b3def3b9..d4dbcdb8 100644 --- a/libs/injective-vue/src/injective/ocr/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/ocr/v1beta1/query.ts @@ -4,9 +4,7 @@ import { GenesisState, GenesisStateAmino } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -19,9 +17,6 @@ export interface QueryParamsRequestAminoMsg { export interface QueryParamsResponse { params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -36,9 +31,6 @@ export interface QueryParamsResponseAminoMsg { export interface QueryFeedConfigRequest { feedId: string; } -export interface ReactiveQueryFeedConfigRequest { - feedId: ComputedRef; -} export interface QueryFeedConfigRequestProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigRequest"; value: Uint8Array; @@ -54,10 +46,6 @@ export interface QueryFeedConfigResponse { feedConfigInfo?: FeedConfigInfo; feedConfig?: FeedConfig; } -export interface ReactiveQueryFeedConfigResponse { - feedConfigInfo?: ComputedRef; - feedConfig?: ComputedRef; -} export interface QueryFeedConfigResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigResponse"; value: Uint8Array; @@ -73,9 +61,6 @@ export interface QueryFeedConfigResponseAminoMsg { export interface QueryFeedConfigInfoRequest { feedId: string; } -export interface ReactiveQueryFeedConfigInfoRequest { - feedId: ComputedRef; -} export interface QueryFeedConfigInfoRequestProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest"; value: Uint8Array; @@ -91,10 +76,6 @@ export interface QueryFeedConfigInfoResponse { feedConfigInfo?: FeedConfigInfo; epochAndRound?: EpochAndRound; } -export interface ReactiveQueryFeedConfigInfoResponse { - feedConfigInfo?: ComputedRef; - epochAndRound?: ComputedRef; -} export interface QueryFeedConfigInfoResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse"; value: Uint8Array; @@ -110,9 +91,6 @@ export interface QueryFeedConfigInfoResponseAminoMsg { export interface QueryLatestRoundRequest { feedId: string; } -export interface ReactiveQueryLatestRoundRequest { - feedId: ComputedRef; -} export interface QueryLatestRoundRequestProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundRequest"; value: Uint8Array; @@ -128,10 +106,6 @@ export interface QueryLatestRoundResponse { latestRoundId: bigint; data?: Transmission; } -export interface ReactiveQueryLatestRoundResponse { - latestRoundId: ComputedRef; - data?: ComputedRef; -} export interface QueryLatestRoundResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundResponse"; value: Uint8Array; @@ -147,9 +121,6 @@ export interface QueryLatestRoundResponseAminoMsg { export interface QueryLatestTransmissionDetailsRequest { feedId: string; } -export interface ReactiveQueryLatestTransmissionDetailsRequest { - feedId: ComputedRef; -} export interface QueryLatestTransmissionDetailsRequestProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest"; value: Uint8Array; @@ -166,11 +137,6 @@ export interface QueryLatestTransmissionDetailsResponse { epochAndRound?: EpochAndRound; data?: Transmission; } -export interface ReactiveQueryLatestTransmissionDetailsResponse { - configDigest: ComputedRef; - epochAndRound?: ComputedRef; - data?: ComputedRef; -} export interface QueryLatestTransmissionDetailsResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse"; value: Uint8Array; @@ -187,9 +153,6 @@ export interface QueryLatestTransmissionDetailsResponseAminoMsg { export interface QueryOwedAmountRequest { transmitter: string; } -export interface ReactiveQueryOwedAmountRequest { - transmitter: ComputedRef; -} export interface QueryOwedAmountRequestProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountRequest"; value: Uint8Array; @@ -204,9 +167,6 @@ export interface QueryOwedAmountRequestAminoMsg { export interface QueryOwedAmountResponse { amount: Coin; } -export interface ReactiveQueryOwedAmountResponse { - amount: ComputedRef; -} export interface QueryOwedAmountResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountResponse"; value: Uint8Array; @@ -219,7 +179,6 @@ export interface QueryOwedAmountResponseAminoMsg { value: QueryOwedAmountResponseAmino; } export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryModuleStateRequest"; value: Uint8Array; @@ -232,9 +191,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.QueryModuleStateResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/tx.amino.ts b/libs/injective-vue/src/injective/ocr/v1beta1/tx.amino.ts deleted file mode 100644 index bf7c6f0c..00000000 --- a/libs/injective-vue/src/injective/ocr/v1beta1/tx.amino.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/injective.ocr.v1beta1.MsgCreateFeed": { - aminoType: "ocr/MsgCreateFeed", - toAmino: MsgCreateFeed.toAmino, - fromAmino: MsgCreateFeed.fromAmino - }, - "/injective.ocr.v1beta1.MsgUpdateFeed": { - aminoType: "ocr/MsgUpdateFeed", - toAmino: MsgUpdateFeed.toAmino, - fromAmino: MsgUpdateFeed.fromAmino - }, - "/injective.ocr.v1beta1.MsgTransmit": { - aminoType: "ocr/MsgTransmit", - toAmino: MsgTransmit.toAmino, - fromAmino: MsgTransmit.fromAmino - }, - "/injective.ocr.v1beta1.MsgFundFeedRewardPool": { - aminoType: "ocr/MsgFundFeedRewardPool", - toAmino: MsgFundFeedRewardPool.toAmino, - fromAmino: MsgFundFeedRewardPool.fromAmino - }, - "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool": { - aminoType: "ocr/MsgWithdrawFeedRewardPool", - toAmino: MsgWithdrawFeedRewardPool.toAmino, - fromAmino: MsgWithdrawFeedRewardPool.fromAmino - }, - "/injective.ocr.v1beta1.MsgSetPayees": { - aminoType: "ocr/MsgSetPayees", - toAmino: MsgSetPayees.toAmino, - fromAmino: MsgSetPayees.fromAmino - }, - "/injective.ocr.v1beta1.MsgTransferPayeeship": { - aminoType: "ocr/MsgTransferPayeeship", - toAmino: MsgTransferPayeeship.toAmino, - fromAmino: MsgTransferPayeeship.fromAmino - }, - "/injective.ocr.v1beta1.MsgAcceptPayeeship": { - aminoType: "ocr/MsgAcceptPayeeship", - toAmino: MsgAcceptPayeeship.toAmino, - fromAmino: MsgAcceptPayeeship.fromAmino - }, - "/injective.ocr.v1beta1.MsgUpdateParams": { - aminoType: "ocr/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..32fa6520 --- /dev/null +++ b/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.func.ts @@ -0,0 +1,57 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; +export const createCreateFeed = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateFeed.typeUrl, + encoders: toEncoders(MsgCreateFeed), + converters: toConverters(MsgCreateFeed) +}); +export const createUpdateFeed = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateFeed.typeUrl, + encoders: toEncoders(MsgUpdateFeed), + converters: toConverters(MsgUpdateFeed) +}); +export const createTransmit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransmit.typeUrl, + encoders: toEncoders(MsgTransmit), + converters: toConverters(MsgTransmit) +}); +export const createFundFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgFundFeedRewardPool.typeUrl, + encoders: toEncoders(MsgFundFeedRewardPool), + converters: toConverters(MsgFundFeedRewardPool) +}); +export const createWithdrawFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawFeedRewardPool.typeUrl, + encoders: toEncoders(MsgWithdrawFeedRewardPool), + converters: toConverters(MsgWithdrawFeedRewardPool) +}); +export const createSetPayees = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetPayees.typeUrl, + encoders: toEncoders(MsgSetPayees), + converters: toConverters(MsgSetPayees) +}); +export const createTransferPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransferPayeeship.typeUrl, + encoders: toEncoders(MsgTransferPayeeship), + converters: toConverters(MsgTransferPayeeship) +}); +export const createAcceptPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAcceptPayeeship.typeUrl, + encoders: toEncoders(MsgAcceptPayeeship), + converters: toConverters(MsgAcceptPayeeship) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 715d97b3..00000000 --- a/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateFeed, MsgCreateFeedResponse, MsgUpdateFeed, MsgUpdateFeedResponse, MsgTransmit, MsgTransmitResponse, MsgFundFeedRewardPool, MsgFundFeedRewardPoolResponse, MsgWithdrawFeedRewardPool, MsgWithdrawFeedRewardPoolResponse, MsgSetPayees, MsgSetPayeesResponse, MsgTransferPayeeship, MsgTransferPayeeshipResponse, MsgAcceptPayeeship, MsgAcceptPayeeshipResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the OCR Msg service. */ -export interface Msg { - /** CreateFeed defines a method for creating feed by module admin */ - createFeed(request: MsgCreateFeed): Promise; - /** - * CreateFeed defines a method for creating feed by feed admin or feed billing - * admin - */ - updateFeed(request: MsgUpdateFeed): Promise; - /** Transmit defines a method for transmitting the feed info by transmitter */ - transmit(request: MsgTransmit): Promise; - /** FundFeedRewardPool defines a method to put funds into feed reward pool */ - fundFeedRewardPool(request: MsgFundFeedRewardPool): Promise; - /** - * WithdrawFeedRewardPool defines a method to witdhraw feed reward by feed - * admin or billing admin - */ - withdrawFeedRewardPool(request: MsgWithdrawFeedRewardPool): Promise; - /** SetPayees defines a method to set payees for transmitters (batch action) */ - setPayees(request: MsgSetPayees): Promise; - /** - * TransferPayeeship defines a method for a payee to transfer reward receive - * ownership - */ - transferPayeeship(request: MsgTransferPayeeship): Promise; - /** - * AcceptPayeeship defines a method for a new payee to accept reward receive - * ownership - */ - acceptPayeeship(request: MsgAcceptPayeeship): Promise; - updateParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateFeed defines a method for creating feed by module admin */ - createFeed = async (request: MsgCreateFeed): Promise => { - const data = MsgCreateFeed.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "CreateFeed", data); - return promise.then(data => MsgCreateFeedResponse.decode(new BinaryReader(data))); - }; - /* CreateFeed defines a method for creating feed by feed admin or feed billing - admin */ - updateFeed = async (request: MsgUpdateFeed): Promise => { - const data = MsgUpdateFeed.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "UpdateFeed", data); - return promise.then(data => MsgUpdateFeedResponse.decode(new BinaryReader(data))); - }; - /* Transmit defines a method for transmitting the feed info by transmitter */ - transmit = async (request: MsgTransmit): Promise => { - const data = MsgTransmit.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "Transmit", data); - return promise.then(data => MsgTransmitResponse.decode(new BinaryReader(data))); - }; - /* FundFeedRewardPool defines a method to put funds into feed reward pool */ - fundFeedRewardPool = async (request: MsgFundFeedRewardPool): Promise => { - const data = MsgFundFeedRewardPool.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "FundFeedRewardPool", data); - return promise.then(data => MsgFundFeedRewardPoolResponse.decode(new BinaryReader(data))); - }; - /* WithdrawFeedRewardPool defines a method to witdhraw feed reward by feed - admin or billing admin */ - withdrawFeedRewardPool = async (request: MsgWithdrawFeedRewardPool): Promise => { - const data = MsgWithdrawFeedRewardPool.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "WithdrawFeedRewardPool", data); - return promise.then(data => MsgWithdrawFeedRewardPoolResponse.decode(new BinaryReader(data))); - }; - /* SetPayees defines a method to set payees for transmitters (batch action) */ - setPayees = async (request: MsgSetPayees): Promise => { - const data = MsgSetPayees.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "SetPayees", data); - return promise.then(data => MsgSetPayeesResponse.decode(new BinaryReader(data))); - }; - /* TransferPayeeship defines a method for a payee to transfer reward receive - ownership */ - transferPayeeship = async (request: MsgTransferPayeeship): Promise => { - const data = MsgTransferPayeeship.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "TransferPayeeship", data); - return promise.then(data => MsgTransferPayeeshipResponse.decode(new BinaryReader(data))); - }; - /* AcceptPayeeship defines a method for a new payee to accept reward receive - ownership */ - acceptPayeeship = async (request: MsgAcceptPayeeship): Promise => { - const data = MsgAcceptPayeeship.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "AcceptPayeeship", data); - return promise.then(data => MsgAcceptPayeeshipResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.ocr.v1beta1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..02da9160 --- /dev/null +++ b/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,30 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; +import { createCreateFeed, createUpdateFeed, createTransmit, createFundFeedRewardPool, createWithdrawFeedRewardPool, createSetPayees, createTransferPayeeship, createAcceptPayeeship, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateFeed = buildUseVueMutation({ + builderMutationFn: createCreateFeed +}); +export const useUpdateFeed = buildUseVueMutation({ + builderMutationFn: createUpdateFeed +}); +export const useTransmit = buildUseVueMutation({ + builderMutationFn: createTransmit +}); +export const useFundFeedRewardPool = buildUseVueMutation({ + builderMutationFn: createFundFeedRewardPool +}); +export const useWithdrawFeedRewardPool = buildUseVueMutation({ + builderMutationFn: createWithdrawFeedRewardPool +}); +export const useSetPayees = buildUseVueMutation({ + builderMutationFn: createSetPayees +}); +export const useTransferPayeeship = buildUseVueMutation({ + builderMutationFn: createTransferPayeeship +}); +export const useAcceptPayeeship = buildUseVueMutation({ + builderMutationFn: createAcceptPayeeship +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/tx.ts b/libs/injective-vue/src/injective/ocr/v1beta1/tx.ts index 8bd3e8aa..ac4107f6 100644 --- a/libs/injective-vue/src/injective/ocr/v1beta1/tx.ts +++ b/libs/injective-vue/src/injective/ocr/v1beta1/tx.ts @@ -3,15 +3,10 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface MsgCreateFeed { sender: string; config?: FeedConfig; } -export interface ReactiveMsgCreateFeed { - sender: ComputedRef; - config?: ComputedRef; -} export interface MsgCreateFeedProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgCreateFeed"; value: Uint8Array; @@ -25,7 +20,6 @@ export interface MsgCreateFeedAminoMsg { value: MsgCreateFeedAmino; } export interface MsgCreateFeedResponse {} -export interface ReactiveMsgCreateFeedResponse {} export interface MsgCreateFeedResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgCreateFeedResponse"; value: Uint8Array; @@ -57,17 +51,6 @@ export interface MsgUpdateFeed { /** feed billing administrator */ billingAdmin: string; } -export interface ReactiveMsgUpdateFeed { - sender: ComputedRef; - feedId: ComputedRef; - signers: ComputedRef; - transmitters: ComputedRef; - linkPerObservation?: ComputedRef; - linkPerTransmission?: ComputedRef; - linkDenom: ComputedRef; - feedAdmin: ComputedRef; - billingAdmin: ComputedRef; -} export interface MsgUpdateFeedProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeed"; value: Uint8Array; @@ -99,7 +82,6 @@ export interface MsgUpdateFeedAminoMsg { value: MsgUpdateFeedAmino; } export interface MsgUpdateFeedResponse {} -export interface ReactiveMsgUpdateFeedResponse {} export interface MsgUpdateFeedResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeedResponse"; value: Uint8Array; @@ -120,16 +102,6 @@ export interface MsgTransmit { report?: Report; signatures: Uint8Array[]; } -export interface ReactiveMsgTransmit { - transmitter: ComputedRef; - configDigest: ComputedRef; - feedId: ComputedRef; - epoch: ComputedRef; - round: ComputedRef; - extraHash: ComputedRef; - report?: ComputedRef; - signatures: ComputedRef; -} export interface MsgTransmitProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgTransmit"; value: Uint8Array; @@ -150,7 +122,6 @@ export interface MsgTransmitAminoMsg { value: MsgTransmitAmino; } export interface MsgTransmitResponse {} -export interface ReactiveMsgTransmitResponse {} export interface MsgTransmitResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgTransmitResponse"; value: Uint8Array; @@ -165,11 +136,6 @@ export interface MsgFundFeedRewardPool { feedId: string; amount: Coin; } -export interface ReactiveMsgFundFeedRewardPool { - sender: ComputedRef; - feedId: ComputedRef; - amount: ComputedRef; -} export interface MsgFundFeedRewardPoolProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPool"; value: Uint8Array; @@ -184,7 +150,6 @@ export interface MsgFundFeedRewardPoolAminoMsg { value: MsgFundFeedRewardPoolAmino; } export interface MsgFundFeedRewardPoolResponse {} -export interface ReactiveMsgFundFeedRewardPoolResponse {} export interface MsgFundFeedRewardPoolResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse"; value: Uint8Array; @@ -199,11 +164,6 @@ export interface MsgWithdrawFeedRewardPool { feedId: string; amount: Coin; } -export interface ReactiveMsgWithdrawFeedRewardPool { - sender: ComputedRef; - feedId: ComputedRef; - amount: ComputedRef; -} export interface MsgWithdrawFeedRewardPoolProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool"; value: Uint8Array; @@ -218,7 +178,6 @@ export interface MsgWithdrawFeedRewardPoolAminoMsg { value: MsgWithdrawFeedRewardPoolAmino; } export interface MsgWithdrawFeedRewardPoolResponse {} -export interface ReactiveMsgWithdrawFeedRewardPoolResponse {} export interface MsgWithdrawFeedRewardPoolResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse"; value: Uint8Array; @@ -236,12 +195,6 @@ export interface MsgSetPayees { /** addresses of payees corresponding to list of transmitters */ payees: string[]; } -export interface ReactiveMsgSetPayees { - sender: ComputedRef; - feedId: ComputedRef; - transmitters: ComputedRef; - payees: ComputedRef; -} export interface MsgSetPayeesProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgSetPayees"; value: Uint8Array; @@ -259,7 +212,6 @@ export interface MsgSetPayeesAminoMsg { value: MsgSetPayeesAmino; } export interface MsgSetPayeesResponse {} -export interface ReactiveMsgSetPayeesResponse {} export interface MsgSetPayeesResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgSetPayeesResponse"; value: Uint8Array; @@ -277,12 +229,6 @@ export interface MsgTransferPayeeship { /** new payee address */ proposed: string; } -export interface ReactiveMsgTransferPayeeship { - sender: ComputedRef; - transmitter: ComputedRef; - feedId: ComputedRef; - proposed: ComputedRef; -} export interface MsgTransferPayeeshipProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeship"; value: Uint8Array; @@ -300,7 +246,6 @@ export interface MsgTransferPayeeshipAminoMsg { value: MsgTransferPayeeshipAmino; } export interface MsgTransferPayeeshipResponse {} -export interface ReactiveMsgTransferPayeeshipResponse {} export interface MsgTransferPayeeshipResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse"; value: Uint8Array; @@ -317,11 +262,6 @@ export interface MsgAcceptPayeeship { transmitter: string; feedId: string; } -export interface ReactiveMsgAcceptPayeeship { - payee: ComputedRef; - transmitter: ComputedRef; - feedId: ComputedRef; -} export interface MsgAcceptPayeeshipProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeship"; value: Uint8Array; @@ -338,7 +278,6 @@ export interface MsgAcceptPayeeshipAminoMsg { value: MsgAcceptPayeeshipAmino; } export interface MsgAcceptPayeeshipResponse {} -export interface ReactiveMsgAcceptPayeeshipResponse {} export interface MsgAcceptPayeeshipResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse"; value: Uint8Array; @@ -358,10 +297,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -381,7 +316,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.ocr.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/events.ts b/libs/injective-vue/src/injective/oracle/v1beta1/events.ts index 641d4998..e78a07bd 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/events.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/events.ts @@ -2,17 +2,11 @@ import { StorkPriceState, StorkPriceStateAmino, PythPriceState, PythPriceStateAm import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface SetChainlinkPriceEvent { feedId: string; answer: string; timestamp: bigint; } -export interface ReactiveSetChainlinkPriceEvent { - feedId: ComputedRef; - answer: ComputedRef; - timestamp: ComputedRef; -} export interface SetChainlinkPriceEventProtoMsg { typeUrl: "/injective.oracle.v1beta1.SetChainlinkPriceEvent"; value: Uint8Array; @@ -34,13 +28,6 @@ export interface SetBandPriceEvent { resolveTime: bigint; requestId: bigint; } -export interface ReactiveSetBandPriceEvent { - relayer: ComputedRef; - symbol: ComputedRef; - price: ComputedRef; - resolveTime: ComputedRef; - requestId: ComputedRef; -} export interface SetBandPriceEventProtoMsg { typeUrl: "/injective.oracle.v1beta1.SetBandPriceEvent"; value: Uint8Array; @@ -65,14 +52,6 @@ export interface SetBandIBCPriceEvent { requestId: bigint; clientId: bigint; } -export interface ReactiveSetBandIBCPriceEvent { - relayer: ComputedRef; - symbols: ComputedRef; - prices: ComputedRef; - resolveTime: ComputedRef; - requestId: ComputedRef; - clientId: ComputedRef; -} export interface SetBandIBCPriceEventProtoMsg { typeUrl: "/injective.oracle.v1beta1.SetBandIBCPriceEvent"; value: Uint8Array; @@ -93,10 +72,6 @@ export interface EventBandIBCAckSuccess { ackResult: string; clientId: bigint; } -export interface ReactiveEventBandIBCAckSuccess { - ackResult: ComputedRef; - clientId: ComputedRef; -} export interface EventBandIBCAckSuccessProtoMsg { typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckSuccess"; value: Uint8Array; @@ -113,10 +88,6 @@ export interface EventBandIBCAckError { ackError: string; clientId: bigint; } -export interface ReactiveEventBandIBCAckError { - ackError: ComputedRef; - clientId: ComputedRef; -} export interface EventBandIBCAckErrorProtoMsg { typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckError"; value: Uint8Array; @@ -132,9 +103,6 @@ export interface EventBandIBCAckErrorAminoMsg { export interface EventBandIBCResponseTimeout { clientId: bigint; } -export interface ReactiveEventBandIBCResponseTimeout { - clientId: ComputedRef; -} export interface EventBandIBCResponseTimeoutProtoMsg { typeUrl: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout"; value: Uint8Array; @@ -153,12 +121,6 @@ export interface SetPriceFeedPriceEvent { /** price defines the price of the oracle base and quote */ price: string; } -export interface ReactiveSetPriceFeedPriceEvent { - relayer: ComputedRef; - base: ComputedRef; - quote: ComputedRef; - price: ComputedRef; -} export interface SetPriceFeedPriceEventProtoMsg { typeUrl: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent"; value: Uint8Array; @@ -180,12 +142,6 @@ export interface SetProviderPriceEvent { symbol: string; price: string; } -export interface ReactiveSetProviderPriceEvent { - provider: ComputedRef; - relayer: ComputedRef; - symbol: ComputedRef; - price: ComputedRef; -} export interface SetProviderPriceEventProtoMsg { typeUrl: "/injective.oracle.v1beta1.SetProviderPriceEvent"; value: Uint8Array; @@ -205,11 +161,6 @@ export interface SetCoinbasePriceEvent { price: string; timestamp: bigint; } -export interface ReactiveSetCoinbasePriceEvent { - symbol: ComputedRef; - price: ComputedRef; - timestamp: ComputedRef; -} export interface SetCoinbasePriceEventProtoMsg { typeUrl: "/injective.oracle.v1beta1.SetCoinbasePriceEvent"; value: Uint8Array; @@ -226,9 +177,6 @@ export interface SetCoinbasePriceEventAminoMsg { export interface EventSetStorkPrices { prices: StorkPriceState[]; } -export interface ReactiveEventSetStorkPrices { - prices: ComputedRef; -} export interface EventSetStorkPricesProtoMsg { typeUrl: "/injective.oracle.v1beta1.EventSetStorkPrices"; value: Uint8Array; @@ -243,9 +191,6 @@ export interface EventSetStorkPricesAminoMsg { export interface EventSetPythPrices { prices: PythPriceState[]; } -export interface ReactiveEventSetPythPrices { - prices: ComputedRef; -} export interface EventSetPythPricesProtoMsg { typeUrl: "/injective.oracle.v1beta1.EventSetPythPrices"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/genesis.ts b/libs/injective-vue/src/injective/oracle/v1beta1/genesis.ts index 0aeb414f..05edb38e 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/genesis.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino, BandPriceState, BandPriceStateAmino, PriceFeedStat import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the oracle module's genesis state. */ export interface GenesisState { /** params defines all the parameters of related to oracle. */ @@ -24,25 +23,6 @@ export interface GenesisState { storkPriceStates: StorkPriceState[]; storkPublishers: string[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - bandRelayers: ComputedRef; - bandPriceStates: ComputedRef; - priceFeedPriceStates: ComputedRef; - coinbasePriceStates: ComputedRef; - bandIbcPriceStates: ComputedRef; - bandIbcOracleRequests: ComputedRef; - bandIbcParams: ComputedRef; - bandIbcLatestClientId: ComputedRef; - calldataRecords: ComputedRef; - bandIbcLatestRequestId: ComputedRef; - chainlinkPriceStates: ComputedRef; - historicalPriceRecords: ComputedRef; - providerStates: ComputedRef; - pythPriceStates: ComputedRef; - storkPriceStates: ComputedRef; - storkPublishers: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.GenesisState"; value: Uint8Array; @@ -76,10 +56,6 @@ export interface CalldataRecord { clientId: bigint; calldata: Uint8Array; } -export interface ReactiveCalldataRecord { - clientId: ComputedRef; - calldata: ComputedRef; -} export interface CalldataRecordProtoMsg { typeUrl: "/injective.oracle.v1beta1.CalldataRecord"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/oracle.ts b/libs/injective-vue/src/injective/oracle/v1beta1/oracle.ts index d81323d2..36616d68 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/oracle.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/oracle.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export enum OracleType { Unspecified = 0, Band = 1, @@ -103,9 +102,6 @@ export function oracleTypeToJSON(object: OracleType): string { export interface Params { pythContract: string; } -export interface ReactiveParams { - pythContract: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.oracle.v1beta1.Params"; value: Uint8Array; @@ -121,10 +117,6 @@ export interface OracleInfo { symbol: string; oracleType: OracleType; } -export interface ReactiveOracleInfo { - symbol: ComputedRef; - oracleType: ComputedRef; -} export interface OracleInfoProtoMsg { typeUrl: "/injective.oracle.v1beta1.OracleInfo"; value: Uint8Array; @@ -143,12 +135,6 @@ export interface ChainlinkPriceState { timestamp: bigint; priceState: PriceState; } -export interface ReactiveChainlinkPriceState { - feedId: ComputedRef; - answer: ComputedRef; - timestamp: ComputedRef; - priceState: ComputedRef; -} export interface ChainlinkPriceStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.ChainlinkPriceState"; value: Uint8Array; @@ -170,13 +156,6 @@ export interface BandPriceState { requestID: bigint; priceState: PriceState; } -export interface ReactiveBandPriceState { - symbol: ComputedRef; - rate: ComputedRef; - resolveTime: ComputedRef; - requestID: ComputedRef; - priceState: ComputedRef; -} export interface BandPriceStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.BandPriceState"; value: Uint8Array; @@ -198,12 +177,6 @@ export interface PriceFeedState { priceState?: PriceState; relayers: string[]; } -export interface ReactivePriceFeedState { - base: ComputedRef; - quote: ComputedRef; - priceState?: ComputedRef; - relayers: ComputedRef; -} export interface PriceFeedStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.PriceFeedState"; value: Uint8Array; @@ -222,10 +195,6 @@ export interface ProviderInfo { provider: string; relayers: string[]; } -export interface ReactiveProviderInfo { - provider: ComputedRef; - relayers: ComputedRef; -} export interface ProviderInfoProtoMsg { typeUrl: "/injective.oracle.v1beta1.ProviderInfo"; value: Uint8Array; @@ -242,10 +211,6 @@ export interface ProviderState { providerInfo?: ProviderInfo; providerPriceStates: ProviderPriceState[]; } -export interface ReactiveProviderState { - providerInfo?: ComputedRef; - providerPriceStates: ComputedRef; -} export interface ProviderStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.ProviderState"; value: Uint8Array; @@ -262,10 +227,6 @@ export interface ProviderPriceState { symbol: string; state?: PriceState; } -export interface ReactiveProviderPriceState { - symbol: ComputedRef; - state?: ComputedRef; -} export interface ProviderPriceStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.ProviderPriceState"; value: Uint8Array; @@ -282,10 +243,6 @@ export interface PriceFeedInfo { base: string; quote: string; } -export interface ReactivePriceFeedInfo { - base: ComputedRef; - quote: ComputedRef; -} export interface PriceFeedInfoProtoMsg { typeUrl: "/injective.oracle.v1beta1.PriceFeedInfo"; value: Uint8Array; @@ -301,9 +258,6 @@ export interface PriceFeedInfoAminoMsg { export interface PriceFeedPrice { price: string; } -export interface ReactivePriceFeedPrice { - price: ComputedRef; -} export interface PriceFeedPriceProtoMsg { typeUrl: "/injective.oracle.v1beta1.PriceFeedPrice"; value: Uint8Array; @@ -327,13 +281,6 @@ export interface CoinbasePriceState { /** the price state */ priceState: PriceState; } -export interface ReactiveCoinbasePriceState { - kind: ComputedRef; - timestamp: ComputedRef; - key: ComputedRef; - value: ComputedRef; - priceState: ComputedRef; -} export interface CoinbasePriceStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.CoinbasePriceState"; value: Uint8Array; @@ -364,12 +311,6 @@ export interface StorkPriceState { /** the price state */ priceState: PriceState; } -export interface ReactiveStorkPriceState { - timestamp: ComputedRef; - symbol: ComputedRef; - value: ComputedRef; - priceState: ComputedRef; -} export interface StorkPriceStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.StorkPriceState"; value: Uint8Array; @@ -393,11 +334,6 @@ export interface PriceState { cumulativePrice: string; timestamp: bigint; } -export interface ReactivePriceState { - price: ComputedRef; - cumulativePrice: ComputedRef; - timestamp: ComputedRef; -} export interface PriceStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.PriceState"; value: Uint8Array; @@ -419,14 +355,6 @@ export interface PythPriceState { publishTime: bigint; priceState: PriceState; } -export interface ReactivePythPriceState { - priceId: ComputedRef; - emaPrice: ComputedRef; - emaConf: ComputedRef; - conf: ComputedRef; - publishTime: ComputedRef; - priceState: ComputedRef; -} export interface PythPriceStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.PythPriceState"; value: Uint8Array; @@ -479,17 +407,6 @@ export interface BandOracleRequest { */ minSourceCount: bigint; } -export interface ReactiveBandOracleRequest { - requestId: ComputedRef; - oracleScriptId: ComputedRef; - symbols: ComputedRef; - askCount: ComputedRef; - minCount: ComputedRef; - feeLimit: ComputedRef; - prepareGas: ComputedRef; - executeGas: ComputedRef; - minSourceCount: ComputedRef; -} export interface BandOracleRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.BandOracleRequest"; value: Uint8Array; @@ -548,14 +465,6 @@ export interface BandIBCParams { /** legacy oracle scheme ids */ legacyOracleIds: bigint[]; } -export interface ReactiveBandIBCParams { - bandIbcEnabled: ComputedRef; - ibcRequestInterval: ComputedRef; - ibcSourceChannel: ComputedRef; - ibcVersion: ComputedRef; - ibcPortId: ComputedRef; - legacyOracleIds: ComputedRef; -} export interface BandIBCParamsProtoMsg { typeUrl: "/injective.oracle.v1beta1.BandIBCParams"; value: Uint8Array; @@ -583,11 +492,6 @@ export interface SymbolPriceTimestamp { symbolId: string; timestamp: bigint; } -export interface ReactiveSymbolPriceTimestamp { - oracle: ComputedRef; - symbolId: ComputedRef; - timestamp: ComputedRef; -} export interface SymbolPriceTimestampProtoMsg { typeUrl: "/injective.oracle.v1beta1.SymbolPriceTimestamp"; value: Uint8Array; @@ -604,9 +508,6 @@ export interface SymbolPriceTimestampAminoMsg { export interface LastPriceTimestamps { lastPriceTimestamps: SymbolPriceTimestamp[]; } -export interface ReactiveLastPriceTimestamps { - lastPriceTimestamps: ComputedRef; -} export interface LastPriceTimestampsProtoMsg { typeUrl: "/injective.oracle.v1beta1.LastPriceTimestamps"; value: Uint8Array; @@ -623,11 +524,6 @@ export interface PriceRecords { symbolId: string; latestPriceRecords: PriceRecord[]; } -export interface ReactivePriceRecords { - oracle: ComputedRef; - symbolId: ComputedRef; - latestPriceRecords: ComputedRef; -} export interface PriceRecordsProtoMsg { typeUrl: "/injective.oracle.v1beta1.PriceRecords"; value: Uint8Array; @@ -645,10 +541,6 @@ export interface PriceRecord { timestamp: bigint; price: string; } -export interface ReactivePriceRecord { - timestamp: ComputedRef; - price: ComputedRef; -} export interface PriceRecordProtoMsg { typeUrl: "/injective.oracle.v1beta1.PriceRecord"; value: Uint8Array; @@ -696,17 +588,6 @@ export interface MetadataStatistics { /** MedianPrice refers to the median individual raw price considered */ medianPrice: string; } -export interface ReactiveMetadataStatistics { - groupCount: ComputedRef; - recordsSampleSize: ComputedRef; - mean: ComputedRef; - twap: ComputedRef; - firstTimestamp: ComputedRef; - lastTimestamp: ComputedRef; - minPrice: ComputedRef; - maxPrice: ComputedRef; - medianPrice: ComputedRef; -} export interface MetadataStatisticsProtoMsg { typeUrl: "/injective.oracle.v1beta1.MetadataStatistics"; value: Uint8Array; @@ -761,16 +642,6 @@ export interface PriceAttestation { emaExpo: number; publishTime: bigint; } -export interface ReactivePriceAttestation { - priceId: ComputedRef; - price: ComputedRef; - conf: ComputedRef; - expo: ComputedRef; - emaPrice: ComputedRef; - emaConf: ComputedRef; - emaExpo: ComputedRef; - publishTime: ComputedRef; -} export interface PriceAttestationProtoMsg { typeUrl: "/injective.oracle.v1beta1.PriceAttestation"; value: Uint8Array; @@ -794,10 +665,6 @@ export interface AssetPair { assetId: string; signedPrices: SignedPriceOfAssetPair[]; } -export interface ReactiveAssetPair { - assetId: ComputedRef; - signedPrices: ComputedRef; -} export interface AssetPairProtoMsg { typeUrl: "/injective.oracle.v1beta1.AssetPair"; value: Uint8Array; @@ -816,12 +683,6 @@ export interface SignedPriceOfAssetPair { price: string; signature: Uint8Array; } -export interface ReactiveSignedPriceOfAssetPair { - publisherKey: ComputedRef; - timestamp: ComputedRef; - price: ComputedRef; - signature: ComputedRef; -} export interface SignedPriceOfAssetPairProtoMsg { typeUrl: "/injective.oracle.v1beta1.SignedPriceOfAssetPair"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/proposal.ts b/libs/injective-vue/src/injective/oracle/v1beta1/proposal.ts index f34859e6..453fdef3 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/proposal.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/proposal.ts @@ -2,17 +2,11 @@ import { BandOracleRequest, BandOracleRequestAmino, BandIBCParams, BandIBCParams import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface GrantBandOraclePrivilegeProposal { title: string; description: string; relayers: string[]; } -export interface ReactiveGrantBandOraclePrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - relayers: ComputedRef; -} export interface GrantBandOraclePrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.GrantBandOraclePrivilegeProposal"; value: Uint8Array; @@ -31,11 +25,6 @@ export interface RevokeBandOraclePrivilegeProposal { description: string; relayers: string[]; } -export interface ReactiveRevokeBandOraclePrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - relayers: ComputedRef; -} export interface RevokeBandOraclePrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.RevokeBandOraclePrivilegeProposal"; value: Uint8Array; @@ -56,13 +45,6 @@ export interface GrantPriceFeederPrivilegeProposal { quote: string; relayers: string[]; } -export interface ReactiveGrantPriceFeederPrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - base: ComputedRef; - quote: ComputedRef; - relayers: ComputedRef; -} export interface GrantPriceFeederPrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.GrantPriceFeederPrivilegeProposal"; value: Uint8Array; @@ -84,12 +66,6 @@ export interface GrantProviderPrivilegeProposal { provider: string; relayers: string[]; } -export interface ReactiveGrantProviderPrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - provider: ComputedRef; - relayers: ComputedRef; -} export interface GrantProviderPrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.GrantProviderPrivilegeProposal"; value: Uint8Array; @@ -110,12 +86,6 @@ export interface RevokeProviderPrivilegeProposal { provider: string; relayers: string[]; } -export interface ReactiveRevokeProviderPrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - provider: ComputedRef; - relayers: ComputedRef; -} export interface RevokeProviderPrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.RevokeProviderPrivilegeProposal"; value: Uint8Array; @@ -137,13 +107,6 @@ export interface RevokePriceFeederPrivilegeProposal { quote: string; relayers: string[]; } -export interface ReactiveRevokePriceFeederPrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - base: ComputedRef; - quote: ComputedRef; - relayers: ComputedRef; -} export interface RevokePriceFeederPrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.RevokePriceFeederPrivilegeProposal"; value: Uint8Array; @@ -164,11 +127,6 @@ export interface AuthorizeBandOracleRequestProposal { description: string; request: BandOracleRequest; } -export interface ReactiveAuthorizeBandOracleRequestProposal { - title: ComputedRef; - description: ComputedRef; - request: ComputedRef; -} export interface AuthorizeBandOracleRequestProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.AuthorizeBandOracleRequestProposal"; value: Uint8Array; @@ -188,12 +146,6 @@ export interface UpdateBandOracleRequestProposal { deleteRequestIds: bigint[]; updateOracleRequest?: BandOracleRequest; } -export interface ReactiveUpdateBandOracleRequestProposal { - title: ComputedRef; - description: ComputedRef; - deleteRequestIds: ComputedRef; - updateOracleRequest?: ComputedRef; -} export interface UpdateBandOracleRequestProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.UpdateBandOracleRequestProposal"; value: Uint8Array; @@ -213,11 +165,6 @@ export interface EnableBandIBCProposal { description: string; bandIbcParams: BandIBCParams; } -export interface ReactiveEnableBandIBCProposal { - title: ComputedRef; - description: ComputedRef; - bandIbcParams: ComputedRef; -} export interface EnableBandIBCProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.EnableBandIBCProposal"; value: Uint8Array; @@ -236,11 +183,6 @@ export interface GrantStorkPublisherPrivilegeProposal { description: string; storkPublishers: string[]; } -export interface ReactiveGrantStorkPublisherPrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - storkPublishers: ComputedRef; -} export interface GrantStorkPublisherPrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.GrantStorkPublisherPrivilegeProposal"; value: Uint8Array; @@ -259,11 +201,6 @@ export interface RevokeStorkPublisherPrivilegeProposal { description: string; storkPublishers: string[]; } -export interface ReactiveRevokeStorkPublisherPrivilegeProposal { - title: ComputedRef; - description: ComputedRef; - storkPublishers: ComputedRef; -} export interface RevokeStorkPublisherPrivilegeProposalProtoMsg { typeUrl: "/injective.oracle.v1beta1.RevokeStorkPublisherPrivilegeProposal"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 1e42fc3e..00000000 --- a/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,716 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse, ReactiveQueryParamsRequest, ReactiveQueryBandRelayersRequest, ReactiveQueryBandPriceStatesRequest, ReactiveQueryBandIBCPriceStatesRequest, ReactiveQueryPriceFeedPriceStatesRequest, ReactiveQueryCoinbasePriceStatesRequest, ReactiveQueryPythPriceStatesRequest, ReactiveQueryStorkPriceStatesRequest, ReactiveQueryStorkPublishersRequest, ReactiveQueryProviderPriceStateRequest, ReactiveQueryModuleStateRequest, ReactiveQueryHistoricalPriceRecordsRequest, ReactiveQueryOracleVolatilityRequest, ReactiveQueryOracleProvidersInfoRequest, ReactiveQueryOracleProviderPricesRequest, ReactiveQueryOraclePriceRequest, ReactiveQueryPythPriceRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Retrieves oracle params */ - params(request?: QueryParamsRequest): Promise; - /** Retrieves the band relayers */ - bandRelayers(request?: QueryBandRelayersRequest): Promise; - /** Retrieves the state for all band price feeds */ - bandPriceStates(request?: QueryBandPriceStatesRequest): Promise; - /** Retrieves the state for all band ibc price feeds */ - bandIBCPriceStates(request?: QueryBandIBCPriceStatesRequest): Promise; - /** Retrieves the state for all price feeds */ - priceFeedPriceStates(request?: QueryPriceFeedPriceStatesRequest): Promise; - /** Retrieves the state for all coinbase price feeds */ - coinbasePriceStates(request?: QueryCoinbasePriceStatesRequest): Promise; - /** Retrieves the state for all pyth price feeds */ - pythPriceStates(request?: QueryPythPriceStatesRequest): Promise; - /** Retrieves the state for all stork price feeds */ - storkPriceStates(request?: QueryStorkPriceStatesRequest): Promise; - /** Retrieves all stork publishers */ - storkPublishers(request?: QueryStorkPublishersRequest): Promise; - /** Retrieves the state for all provider price feeds */ - providerPriceState(request: QueryProviderPriceStateRequest): Promise; - /** Retrieves the entire oracle module's state */ - oracleModuleState(request?: QueryModuleStateRequest): Promise; - /** Retrieves historical price records for a given OracleType and Symbol */ - historicalPriceRecords(request: QueryHistoricalPriceRecordsRequest): Promise; - /** Retrieves mixed volatility value for the specified pair of base/quote */ - oracleVolatility(request: QueryOracleVolatilityRequest): Promise; - oracleProvidersInfo(request?: QueryOracleProvidersInfoRequest): Promise; - oracleProviderPrices(request: QueryOracleProviderPricesRequest): Promise; - oraclePrice(request: QueryOraclePriceRequest): Promise; - pythPrice(request: QueryPythPriceRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Retrieves oracle params */ - params = async (request: QueryParamsRequest = {}): Promise => { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the band relayers */ - bandRelayers = async (request: QueryBandRelayersRequest = {}): Promise => { - const data = QueryBandRelayersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "BandRelayers", data); - return promise.then(data => QueryBandRelayersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the state for all band price feeds */ - bandPriceStates = async (request: QueryBandPriceStatesRequest = {}): Promise => { - const data = QueryBandPriceStatesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "BandPriceStates", data); - return promise.then(data => QueryBandPriceStatesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the state for all band ibc price feeds */ - bandIBCPriceStates = async (request: QueryBandIBCPriceStatesRequest = {}): Promise => { - const data = QueryBandIBCPriceStatesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "BandIBCPriceStates", data); - return promise.then(data => QueryBandIBCPriceStatesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the state for all price feeds */ - priceFeedPriceStates = async (request: QueryPriceFeedPriceStatesRequest = {}): Promise => { - const data = QueryPriceFeedPriceStatesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "PriceFeedPriceStates", data); - return promise.then(data => QueryPriceFeedPriceStatesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the state for all coinbase price feeds */ - coinbasePriceStates = async (request: QueryCoinbasePriceStatesRequest = {}): Promise => { - const data = QueryCoinbasePriceStatesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "CoinbasePriceStates", data); - return promise.then(data => QueryCoinbasePriceStatesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the state for all pyth price feeds */ - pythPriceStates = async (request: QueryPythPriceStatesRequest = {}): Promise => { - const data = QueryPythPriceStatesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "PythPriceStates", data); - return promise.then(data => QueryPythPriceStatesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the state for all stork price feeds */ - storkPriceStates = async (request: QueryStorkPriceStatesRequest = {}): Promise => { - const data = QueryStorkPriceStatesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "StorkPriceStates", data); - return promise.then(data => QueryStorkPriceStatesResponse.decode(new BinaryReader(data))); - }; - /* Retrieves all stork publishers */ - storkPublishers = async (request: QueryStorkPublishersRequest = {}): Promise => { - const data = QueryStorkPublishersRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "StorkPublishers", data); - return promise.then(data => QueryStorkPublishersResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the state for all provider price feeds */ - providerPriceState = async (request: QueryProviderPriceStateRequest): Promise => { - const data = QueryProviderPriceStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "ProviderPriceState", data); - return promise.then(data => QueryProviderPriceStateResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire oracle module's state */ - oracleModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "OracleModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; - /* Retrieves historical price records for a given OracleType and Symbol */ - historicalPriceRecords = async (request: QueryHistoricalPriceRecordsRequest): Promise => { - const data = QueryHistoricalPriceRecordsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "HistoricalPriceRecords", data); - return promise.then(data => QueryHistoricalPriceRecordsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves mixed volatility value for the specified pair of base/quote */ - oracleVolatility = async (request: QueryOracleVolatilityRequest): Promise => { - const data = QueryOracleVolatilityRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "OracleVolatility", data); - return promise.then(data => QueryOracleVolatilityResponse.decode(new BinaryReader(data))); - }; - /* OracleProvidersInfo */ - oracleProvidersInfo = async (request: QueryOracleProvidersInfoRequest = {}): Promise => { - const data = QueryOracleProvidersInfoRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "OracleProvidersInfo", data); - return promise.then(data => QueryOracleProvidersInfoResponse.decode(new BinaryReader(data))); - }; - /* OracleProviderPrices */ - oracleProviderPrices = async (request: QueryOracleProviderPricesRequest): Promise => { - const data = QueryOracleProviderPricesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "OracleProviderPrices", data); - return promise.then(data => QueryOracleProviderPricesResponse.decode(new BinaryReader(data))); - }; - /* OraclePrice */ - oraclePrice = async (request: QueryOraclePriceRequest): Promise => { - const data = QueryOraclePriceRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "OraclePrice", data); - return promise.then(data => QueryOraclePriceResponse.decode(new BinaryReader(data))); - }; - /* PythPrice */ - pythPrice = async (request: QueryPythPriceRequest): Promise => { - const data = QueryPythPriceRequest.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Query", "PythPrice", data); - return promise.then(data => QueryPythPriceResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - bandRelayers(request?: QueryBandRelayersRequest): Promise { - return queryService.bandRelayers(request); - }, - bandPriceStates(request?: QueryBandPriceStatesRequest): Promise { - return queryService.bandPriceStates(request); - }, - bandIBCPriceStates(request?: QueryBandIBCPriceStatesRequest): Promise { - return queryService.bandIBCPriceStates(request); - }, - priceFeedPriceStates(request?: QueryPriceFeedPriceStatesRequest): Promise { - return queryService.priceFeedPriceStates(request); - }, - coinbasePriceStates(request?: QueryCoinbasePriceStatesRequest): Promise { - return queryService.coinbasePriceStates(request); - }, - pythPriceStates(request?: QueryPythPriceStatesRequest): Promise { - return queryService.pythPriceStates(request); - }, - storkPriceStates(request?: QueryStorkPriceStatesRequest): Promise { - return queryService.storkPriceStates(request); - }, - storkPublishers(request?: QueryStorkPublishersRequest): Promise { - return queryService.storkPublishers(request); - }, - providerPriceState(request: QueryProviderPriceStateRequest): Promise { - return queryService.providerPriceState(request); - }, - oracleModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.oracleModuleState(request); - }, - historicalPriceRecords(request: QueryHistoricalPriceRecordsRequest): Promise { - return queryService.historicalPriceRecords(request); - }, - oracleVolatility(request: QueryOracleVolatilityRequest): Promise { - return queryService.oracleVolatility(request); - }, - oracleProvidersInfo(request?: QueryOracleProvidersInfoRequest): Promise { - return queryService.oracleProvidersInfo(request); - }, - oracleProviderPrices(request: QueryOracleProviderPricesRequest): Promise { - return queryService.oracleProviderPrices(request); - }, - oraclePrice(request: QueryOraclePriceRequest): Promise { - return queryService.oraclePrice(request); - }, - pythPrice(request: QueryPythPriceRequest): Promise { - return queryService.pythPrice(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseBandRelayersQuery extends VueQueryParams { - request?: ReactiveQueryBandRelayersRequest; -} -export interface UseBandPriceStatesQuery extends VueQueryParams { - request?: ReactiveQueryBandPriceStatesRequest; -} -export interface UseBandIBCPriceStatesQuery extends VueQueryParams { - request?: ReactiveQueryBandIBCPriceStatesRequest; -} -export interface UsePriceFeedPriceStatesQuery extends VueQueryParams { - request?: ReactiveQueryPriceFeedPriceStatesRequest; -} -export interface UseCoinbasePriceStatesQuery extends VueQueryParams { - request?: ReactiveQueryCoinbasePriceStatesRequest; -} -export interface UsePythPriceStatesQuery extends VueQueryParams { - request?: ReactiveQueryPythPriceStatesRequest; -} -export interface UseStorkPriceStatesQuery extends VueQueryParams { - request?: ReactiveQueryStorkPriceStatesRequest; -} -export interface UseStorkPublishersQuery extends VueQueryParams { - request?: ReactiveQueryStorkPublishersRequest; -} -export interface UseProviderPriceStateQuery extends VueQueryParams { - request: ReactiveQueryProviderPriceStateRequest; -} -export interface UseOracleModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export interface UseHistoricalPriceRecordsQuery extends VueQueryParams { - request: ReactiveQueryHistoricalPriceRecordsRequest; -} -export interface UseOracleVolatilityQuery extends VueQueryParams { - request: ReactiveQueryOracleVolatilityRequest; -} -export interface UseOracleProvidersInfoQuery extends VueQueryParams { - request?: ReactiveQueryOracleProvidersInfoRequest; -} -export interface UseOracleProviderPricesQuery extends VueQueryParams { - request: ReactiveQueryOracleProviderPricesRequest; -} -export interface UseOraclePriceQuery extends VueQueryParams { - request: ReactiveQueryOraclePriceRequest; -} -export interface UsePythPriceQuery extends VueQueryParams { - request: ReactiveQueryPythPriceRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useBandRelayers = ({ - request, - options - }: UseBandRelayersQuery) => { - const queryKey = ["bandRelayersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.bandRelayers(params); - }, - ...options - }); - }; - const useBandPriceStates = ({ - request, - options - }: UseBandPriceStatesQuery) => { - const queryKey = ["bandPriceStatesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.bandPriceStates(params); - }, - ...options - }); - }; - const useBandIBCPriceStates = ({ - request, - options - }: UseBandIBCPriceStatesQuery) => { - const queryKey = ["bandIBCPriceStatesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.bandIBCPriceStates(params); - }, - ...options - }); - }; - const usePriceFeedPriceStates = ({ - request, - options - }: UsePriceFeedPriceStatesQuery) => { - const queryKey = ["priceFeedPriceStatesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.priceFeedPriceStates(params); - }, - ...options - }); - }; - const useCoinbasePriceStates = ({ - request, - options - }: UseCoinbasePriceStatesQuery) => { - const queryKey = ["coinbasePriceStatesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.coinbasePriceStates(params); - }, - ...options - }); - }; - const usePythPriceStates = ({ - request, - options - }: UsePythPriceStatesQuery) => { - const queryKey = ["pythPriceStatesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pythPriceStates(params); - }, - ...options - }); - }; - const useStorkPriceStates = ({ - request, - options - }: UseStorkPriceStatesQuery) => { - const queryKey = ["storkPriceStatesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.storkPriceStates(params); - }, - ...options - }); - }; - const useStorkPublishers = ({ - request, - options - }: UseStorkPublishersQuery) => { - const queryKey = ["storkPublishersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.storkPublishers(params); - }, - ...options - }); - }; - const useProviderPriceState = ({ - request, - options - }: UseProviderPriceStateQuery) => { - const queryKey = ["providerPriceStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.providerPriceState(params); - }, - ...options - }); - }; - const useOracleModuleState = ({ - request, - options - }: UseOracleModuleStateQuery) => { - const queryKey = ["oracleModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.oracleModuleState(params); - }, - ...options - }); - }; - const useHistoricalPriceRecords = ({ - request, - options - }: UseHistoricalPriceRecordsQuery) => { - const queryKey = ["historicalPriceRecordsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.historicalPriceRecords(params); - }, - ...options - }); - }; - const useOracleVolatility = ({ - request, - options - }: UseOracleVolatilityQuery) => { - const queryKey = ["oracleVolatilityQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.oracleVolatility(params); - }, - ...options - }); - }; - const useOracleProvidersInfo = ({ - request, - options - }: UseOracleProvidersInfoQuery) => { - const queryKey = ["oracleProvidersInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.oracleProvidersInfo(params); - }, - ...options - }); - }; - const useOracleProviderPrices = ({ - request, - options - }: UseOracleProviderPricesQuery) => { - const queryKey = ["oracleProviderPricesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.oracleProviderPrices(params); - }, - ...options - }); - }; - const useOraclePrice = ({ - request, - options - }: UseOraclePriceQuery) => { - const queryKey = ["oraclePriceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.oraclePrice(params); - }, - ...options - }); - }; - const usePythPrice = ({ - request, - options - }: UsePythPriceQuery) => { - const queryKey = ["pythPriceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pythPrice(params); - }, - ...options - }); - }; - return { - /** Retrieves oracle params */useParams, - /** Retrieves the band relayers */useBandRelayers, - /** Retrieves the state for all band price feeds */useBandPriceStates, - /** Retrieves the state for all band ibc price feeds */useBandIBCPriceStates, - /** Retrieves the state for all price feeds */usePriceFeedPriceStates, - /** Retrieves the state for all coinbase price feeds */useCoinbasePriceStates, - /** Retrieves the state for all pyth price feeds */usePythPriceStates, - /** Retrieves the state for all stork price feeds */useStorkPriceStates, - /** Retrieves all stork publishers */useStorkPublishers, - /** Retrieves the state for all provider price feeds */useProviderPriceState, - /** Retrieves the entire oracle module's state */useOracleModuleState, - /** Retrieves historical price records for a given OracleType and Symbol */useHistoricalPriceRecords, - /** Retrieves mixed volatility value for the specified pair of base/quote */useOracleVolatility, - useOracleProvidersInfo, - useOracleProviderPrices, - useOraclePrice, - usePythPrice - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..16f39b30 --- /dev/null +++ b/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.func.ts @@ -0,0 +1,121 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetBandRelayers = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandRelayersRequest.encode, + decode: QueryBandRelayersResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandRelayers", + clientResolver +}); +export const createGetBandPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandPriceStatesRequest.encode, + decode: QueryBandPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandPriceStates", + clientResolver +}); +export const createGetBandIBCPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandIBCPriceStatesRequest.encode, + decode: QueryBandIBCPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandIBCPriceStates", + clientResolver +}); +export const createGetPriceFeedPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPriceFeedPriceStatesRequest.encode, + decode: QueryPriceFeedPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PriceFeedPriceStates", + clientResolver +}); +export const createGetCoinbasePriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCoinbasePriceStatesRequest.encode, + decode: QueryCoinbasePriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "CoinbasePriceStates", + clientResolver +}); +export const createGetPythPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPythPriceStatesRequest.encode, + decode: QueryPythPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PythPriceStates", + clientResolver +}); +export const createGetStorkPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryStorkPriceStatesRequest.encode, + decode: QueryStorkPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "StorkPriceStates", + clientResolver +}); +export const createGetStorkPublishers = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryStorkPublishersRequest.encode, + decode: QueryStorkPublishersResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "StorkPublishers", + clientResolver +}); +export const createGetProviderPriceState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProviderPriceStateRequest.encode, + decode: QueryProviderPriceStateResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "ProviderPriceState", + clientResolver +}); +export const createGetOracleModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleModuleState", + clientResolver +}); +export const createGetHistoricalPriceRecords = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalPriceRecordsRequest.encode, + decode: QueryHistoricalPriceRecordsResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "HistoricalPriceRecords", + clientResolver +}); +export const createGetOracleVolatility = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleVolatilityRequest.encode, + decode: QueryOracleVolatilityResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleVolatility", + clientResolver +}); +export const createGetOracleProvidersInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleProvidersInfoRequest.encode, + decode: QueryOracleProvidersInfoResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleProvidersInfo", + clientResolver +}); +export const createGetOracleProviderPrices = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleProviderPricesRequest.encode, + decode: QueryOracleProviderPricesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleProviderPrices", + clientResolver +}); +export const createGetOraclePrice = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOraclePriceRequest.encode, + decode: QueryOraclePriceResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OraclePrice", + clientResolver +}); +export const createGetPythPrice = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPythPriceRequest.encode, + decode: QueryPythPriceResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PythPrice", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..c0bb9c8d --- /dev/null +++ b/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts @@ -0,0 +1,71 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; +import { createGetParams, createGetBandRelayers, createGetBandPriceStates, createGetBandIBCPriceStates, createGetPriceFeedPriceStates, createGetCoinbasePriceStates, createGetPythPriceStates, createGetStorkPriceStates, createGetStorkPublishers, createGetProviderPriceState, createGetOracleModuleState, createGetHistoricalPriceRecords, createGetOracleVolatility, createGetOracleProvidersInfo, createGetOracleProviderPrices, createGetOraclePrice, createGetPythPrice } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetBandRelayers = buildUseVueQuery({ + builderQueryFn: createGetBandRelayers, + queryKeyPrefix: "BandRelayersQuery" +}); +export const useGetBandPriceStates = buildUseVueQuery({ + builderQueryFn: createGetBandPriceStates, + queryKeyPrefix: "BandPriceStatesQuery" +}); +export const useGetBandIBCPriceStates = buildUseVueQuery({ + builderQueryFn: createGetBandIBCPriceStates, + queryKeyPrefix: "BandIBCPriceStatesQuery" +}); +export const useGetPriceFeedPriceStates = buildUseVueQuery({ + builderQueryFn: createGetPriceFeedPriceStates, + queryKeyPrefix: "PriceFeedPriceStatesQuery" +}); +export const useGetCoinbasePriceStates = buildUseVueQuery({ + builderQueryFn: createGetCoinbasePriceStates, + queryKeyPrefix: "CoinbasePriceStatesQuery" +}); +export const useGetPythPriceStates = buildUseVueQuery({ + builderQueryFn: createGetPythPriceStates, + queryKeyPrefix: "PythPriceStatesQuery" +}); +export const useGetStorkPriceStates = buildUseVueQuery({ + builderQueryFn: createGetStorkPriceStates, + queryKeyPrefix: "StorkPriceStatesQuery" +}); +export const useGetStorkPublishers = buildUseVueQuery({ + builderQueryFn: createGetStorkPublishers, + queryKeyPrefix: "StorkPublishersQuery" +}); +export const useGetProviderPriceState = buildUseVueQuery({ + builderQueryFn: createGetProviderPriceState, + queryKeyPrefix: "ProviderPriceStateQuery" +}); +export const useGetOracleModuleState = buildUseVueQuery({ + builderQueryFn: createGetOracleModuleState, + queryKeyPrefix: "OracleModuleStateQuery" +}); +export const useGetHistoricalPriceRecords = buildUseVueQuery({ + builderQueryFn: createGetHistoricalPriceRecords, + queryKeyPrefix: "HistoricalPriceRecordsQuery" +}); +export const useGetOracleVolatility = buildUseVueQuery({ + builderQueryFn: createGetOracleVolatility, + queryKeyPrefix: "OracleVolatilityQuery" +}); +export const useGetOracleProvidersInfo = buildUseVueQuery({ + builderQueryFn: createGetOracleProvidersInfo, + queryKeyPrefix: "OracleProvidersInfoQuery" +}); +export const useGetOracleProviderPrices = buildUseVueQuery({ + builderQueryFn: createGetOracleProviderPrices, + queryKeyPrefix: "OracleProviderPricesQuery" +}); +export const useGetOraclePrice = buildUseVueQuery({ + builderQueryFn: createGetOraclePrice, + queryKeyPrefix: "OraclePriceQuery" +}); +export const useGetPythPrice = buildUseVueQuery({ + builderQueryFn: createGetPythPrice, + queryKeyPrefix: "PythPriceQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/query.ts b/libs/injective-vue/src/injective/oracle/v1beta1/query.ts index e87a29c3..e44832a4 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/query.ts @@ -3,13 +3,9 @@ import { GenesisState, GenesisStateAmino } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface QueryPythPriceRequest { priceId: string; } -export interface ReactiveQueryPythPriceRequest { - priceId: ComputedRef; -} export interface QueryPythPriceRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryPythPriceRequest"; value: Uint8Array; @@ -24,9 +20,6 @@ export interface QueryPythPriceRequestAminoMsg { export interface QueryPythPriceResponse { priceState?: PythPriceState; } -export interface ReactiveQueryPythPriceResponse { - priceState?: ComputedRef; -} export interface QueryPythPriceResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryPythPriceResponse"; value: Uint8Array; @@ -43,7 +36,6 @@ export interface QueryPythPriceResponseAminoMsg { * method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -64,9 +56,6 @@ export interface QueryParamsRequestAminoMsg { export interface QueryParamsResponse { params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -87,7 +76,6 @@ export interface QueryParamsResponseAminoMsg { * method. */ export interface QueryBandRelayersRequest {} -export interface ReactiveQueryBandRelayersRequest {} export interface QueryBandRelayersRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersRequest"; value: Uint8Array; @@ -108,9 +96,6 @@ export interface QueryBandRelayersRequestAminoMsg { export interface QueryBandRelayersResponse { relayers: string[]; } -export interface ReactiveQueryBandRelayersResponse { - relayers: ComputedRef; -} export interface QueryBandRelayersResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersResponse"; value: Uint8Array; @@ -131,7 +116,6 @@ export interface QueryBandRelayersResponseAminoMsg { * RPC method. */ export interface QueryBandPriceStatesRequest {} -export interface ReactiveQueryBandPriceStatesRequest {} export interface QueryBandPriceStatesRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest"; value: Uint8Array; @@ -152,9 +136,6 @@ export interface QueryBandPriceStatesRequestAminoMsg { export interface QueryBandPriceStatesResponse { priceStates: BandPriceState[]; } -export interface ReactiveQueryBandPriceStatesResponse { - priceStates: ComputedRef; -} export interface QueryBandPriceStatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse"; value: Uint8Array; @@ -175,7 +156,6 @@ export interface QueryBandPriceStatesResponseAminoMsg { * Query/BandIBCPriceStates RPC method. */ export interface QueryBandIBCPriceStatesRequest {} -export interface ReactiveQueryBandIBCPriceStatesRequest {} export interface QueryBandIBCPriceStatesRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest"; value: Uint8Array; @@ -196,9 +176,6 @@ export interface QueryBandIBCPriceStatesRequestAminoMsg { export interface QueryBandIBCPriceStatesResponse { priceStates: BandPriceState[]; } -export interface ReactiveQueryBandIBCPriceStatesResponse { - priceStates: ComputedRef; -} export interface QueryBandIBCPriceStatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse"; value: Uint8Array; @@ -219,7 +196,6 @@ export interface QueryBandIBCPriceStatesResponseAminoMsg { * Query/PriceFeedPriceStates RPC method. */ export interface QueryPriceFeedPriceStatesRequest {} -export interface ReactiveQueryPriceFeedPriceStatesRequest {} export interface QueryPriceFeedPriceStatesRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest"; value: Uint8Array; @@ -240,9 +216,6 @@ export interface QueryPriceFeedPriceStatesRequestAminoMsg { export interface QueryPriceFeedPriceStatesResponse { priceStates: PriceFeedState[]; } -export interface ReactiveQueryPriceFeedPriceStatesResponse { - priceStates: ComputedRef; -} export interface QueryPriceFeedPriceStatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse"; value: Uint8Array; @@ -263,7 +236,6 @@ export interface QueryPriceFeedPriceStatesResponseAminoMsg { * Query/CoinbasePriceStates RPC method. */ export interface QueryCoinbasePriceStatesRequest {} -export interface ReactiveQueryCoinbasePriceStatesRequest {} export interface QueryCoinbasePriceStatesRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest"; value: Uint8Array; @@ -284,9 +256,6 @@ export interface QueryCoinbasePriceStatesRequestAminoMsg { export interface QueryCoinbasePriceStatesResponse { priceStates: CoinbasePriceState[]; } -export interface ReactiveQueryCoinbasePriceStatesResponse { - priceStates: ComputedRef; -} export interface QueryCoinbasePriceStatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse"; value: Uint8Array; @@ -307,7 +276,6 @@ export interface QueryCoinbasePriceStatesResponseAminoMsg { * Query/CoinbasePriceStates RPC method. */ export interface QueryPythPriceStatesRequest {} -export interface ReactiveQueryPythPriceStatesRequest {} export interface QueryPythPriceStatesRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest"; value: Uint8Array; @@ -328,9 +296,6 @@ export interface QueryPythPriceStatesRequestAminoMsg { export interface QueryPythPriceStatesResponse { priceStates: PythPriceState[]; } -export interface ReactiveQueryPythPriceStatesResponse { - priceStates: ComputedRef; -} export interface QueryPythPriceStatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse"; value: Uint8Array; @@ -351,7 +316,6 @@ export interface QueryPythPriceStatesResponseAminoMsg { * Query/StorkPriceStates RPC method. */ export interface QueryStorkPriceStatesRequest {} -export interface ReactiveQueryStorkPriceStatesRequest {} export interface QueryStorkPriceStatesRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest"; value: Uint8Array; @@ -372,9 +336,6 @@ export interface QueryStorkPriceStatesRequestAminoMsg { export interface QueryStorkPriceStatesResponse { priceStates: StorkPriceState[]; } -export interface ReactiveQueryStorkPriceStatesResponse { - priceStates: ComputedRef; -} export interface QueryStorkPriceStatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse"; value: Uint8Array; @@ -395,7 +356,6 @@ export interface QueryStorkPriceStatesResponseAminoMsg { * Query/StorkPublishers RPC method. */ export interface QueryStorkPublishersRequest {} -export interface ReactiveQueryStorkPublishersRequest {} export interface QueryStorkPublishersRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersRequest"; value: Uint8Array; @@ -416,9 +376,6 @@ export interface QueryStorkPublishersRequestAminoMsg { export interface QueryStorkPublishersResponse { publishers: string[]; } -export interface ReactiveQueryStorkPublishersResponse { - publishers: ComputedRef; -} export interface QueryStorkPublishersResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersResponse"; value: Uint8Array; @@ -442,10 +399,6 @@ export interface QueryProviderPriceStateRequest { provider: string; symbol: string; } -export interface ReactiveQueryProviderPriceStateRequest { - provider: ComputedRef; - symbol: ComputedRef; -} export interface QueryProviderPriceStateRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest"; value: Uint8Array; @@ -469,9 +422,6 @@ export interface QueryProviderPriceStateRequestAminoMsg { export interface QueryProviderPriceStateResponse { priceState?: PriceState; } -export interface ReactiveQueryProviderPriceStateResponse { - priceState?: ComputedRef; -} export interface QueryProviderPriceStateResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse"; value: Uint8Array; @@ -492,7 +442,6 @@ export interface QueryProviderPriceStateResponseAminoMsg { * RPC method. */ export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryModuleStateRequest"; value: Uint8Array; @@ -513,9 +462,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryModuleStateResponse"; value: Uint8Array; @@ -535,10 +481,6 @@ export interface QueryHistoricalPriceRecordsRequest { oracle: OracleType; symbolId: string; } -export interface ReactiveQueryHistoricalPriceRecordsRequest { - oracle: ComputedRef; - symbolId: ComputedRef; -} export interface QueryHistoricalPriceRecordsRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest"; value: Uint8Array; @@ -554,9 +496,6 @@ export interface QueryHistoricalPriceRecordsRequestAminoMsg { export interface QueryHistoricalPriceRecordsResponse { priceRecords: PriceRecords[]; } -export interface ReactiveQueryHistoricalPriceRecordsResponse { - priceRecords: ComputedRef; -} export interface QueryHistoricalPriceRecordsResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse"; value: Uint8Array; @@ -586,11 +525,6 @@ export interface OracleHistoryOptions { */ includeMetadata: boolean; } -export interface ReactiveOracleHistoryOptions { - maxAge: ComputedRef; - includeRawHistory: ComputedRef; - includeMetadata: ComputedRef; -} export interface OracleHistoryOptionsProtoMsg { typeUrl: "/injective.oracle.v1beta1.OracleHistoryOptions"; value: Uint8Array; @@ -626,11 +560,6 @@ export interface QueryOracleVolatilityRequest { quoteInfo?: OracleInfo; oracleHistoryOptions?: OracleHistoryOptions; } -export interface ReactiveQueryOracleVolatilityRequest { - baseInfo?: ComputedRef; - quoteInfo?: ComputedRef; - oracleHistoryOptions?: ComputedRef; -} export interface QueryOracleVolatilityRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest"; value: Uint8Array; @@ -657,11 +586,6 @@ export interface QueryOracleVolatilityResponse { historyMetadata?: MetadataStatistics; rawHistory: PriceRecord[]; } -export interface ReactiveQueryOracleVolatilityResponse { - volatility: ComputedRef; - historyMetadata?: ComputedRef; - rawHistory: ComputedRef; -} export interface QueryOracleVolatilityResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse"; value: Uint8Array; @@ -680,7 +604,6 @@ export interface QueryOracleVolatilityResponseAminoMsg { value: QueryOracleVolatilityResponseAmino; } export interface QueryOracleProvidersInfoRequest {} -export interface ReactiveQueryOracleProvidersInfoRequest {} export interface QueryOracleProvidersInfoRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest"; value: Uint8Array; @@ -693,9 +616,6 @@ export interface QueryOracleProvidersInfoRequestAminoMsg { export interface QueryOracleProvidersInfoResponse { providers: ProviderInfo[]; } -export interface ReactiveQueryOracleProvidersInfoResponse { - providers: ComputedRef; -} export interface QueryOracleProvidersInfoResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse"; value: Uint8Array; @@ -710,9 +630,6 @@ export interface QueryOracleProvidersInfoResponseAminoMsg { export interface QueryOracleProviderPricesRequest { provider: string; } -export interface ReactiveQueryOracleProviderPricesRequest { - provider: ComputedRef; -} export interface QueryOracleProviderPricesRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest"; value: Uint8Array; @@ -727,9 +644,6 @@ export interface QueryOracleProviderPricesRequestAminoMsg { export interface QueryOracleProviderPricesResponse { providerState: ProviderState[]; } -export interface ReactiveQueryOracleProviderPricesResponse { - providerState: ComputedRef; -} export interface QueryOracleProviderPricesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse"; value: Uint8Array; @@ -750,10 +664,6 @@ export interface ScalingOptions { baseDecimals: number; quoteDecimals: number; } -export interface ReactiveScalingOptions { - baseDecimals: ComputedRef; - quoteDecimals: ComputedRef; -} export interface ScalingOptionsProtoMsg { typeUrl: "/injective.oracle.v1beta1.ScalingOptions"; value: Uint8Array; @@ -781,12 +691,6 @@ export interface QueryOraclePriceRequest { quote: string; scalingOptions?: ScalingOptions; } -export interface ReactiveQueryOraclePriceRequest { - oracleType: ComputedRef; - base: ComputedRef; - quote: ComputedRef; - scalingOptions?: ComputedRef; -} export interface QueryOraclePriceRequestProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceRequest"; value: Uint8Array; @@ -814,15 +718,6 @@ export interface PricePairState { baseTimestamp: bigint; quoteTimestamp: bigint; } -export interface ReactivePricePairState { - pairPrice: ComputedRef; - basePrice: ComputedRef; - quotePrice: ComputedRef; - baseCumulativePrice: ComputedRef; - quoteCumulativePrice: ComputedRef; - baseTimestamp: ComputedRef; - quoteTimestamp: ComputedRef; -} export interface PricePairStateProtoMsg { typeUrl: "/injective.oracle.v1beta1.PricePairState"; value: Uint8Array; @@ -847,9 +742,6 @@ export interface PricePairStateAminoMsg { export interface QueryOraclePriceResponse { pricePairState?: PricePairState; } -export interface ReactiveQueryOraclePriceResponse { - pricePairState?: ComputedRef; -} export interface QueryOraclePriceResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/tx.amino.ts b/libs/injective-vue/src/injective/oracle/v1beta1/tx.amino.ts deleted file mode 100644 index ca1eb212..00000000 --- a/libs/injective-vue/src/injective/oracle/v1beta1/tx.amino.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/injective.oracle.v1beta1.MsgRelayProviderPrices": { - aminoType: "oracle/MsgRelayProviderPrices", - toAmino: MsgRelayProviderPrices.toAmino, - fromAmino: MsgRelayProviderPrices.fromAmino - }, - "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice": { - aminoType: "oracle/MsgRelayPriceFeedPrice", - toAmino: MsgRelayPriceFeedPrice.toAmino, - fromAmino: MsgRelayPriceFeedPrice.fromAmino - }, - "/injective.oracle.v1beta1.MsgRelayBandRates": { - aminoType: "oracle/MsgRelayBandRates", - toAmino: MsgRelayBandRates.toAmino, - fromAmino: MsgRelayBandRates.fromAmino - }, - "/injective.oracle.v1beta1.MsgRequestBandIBCRates": { - aminoType: "oracle/MsgRequestBandIBCRates", - toAmino: MsgRequestBandIBCRates.toAmino, - fromAmino: MsgRequestBandIBCRates.fromAmino - }, - "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages": { - aminoType: "oracle/MsgRelayCoinbaseMessages", - toAmino: MsgRelayCoinbaseMessages.toAmino, - fromAmino: MsgRelayCoinbaseMessages.fromAmino - }, - "/injective.oracle.v1beta1.MsgRelayStorkPrices": { - aminoType: "/injective.oracle.v1beta1.MsgRelayStorkPrices", - toAmino: MsgRelayStorkPrices.toAmino, - fromAmino: MsgRelayStorkPrices.fromAmino - }, - "/injective.oracle.v1beta1.MsgRelayPythPrices": { - aminoType: "oracle/MsgRelayPythPrices", - toAmino: MsgRelayPythPrices.toAmino, - fromAmino: MsgRelayPythPrices.fromAmino - }, - "/injective.oracle.v1beta1.MsgUpdateParams": { - aminoType: "oracle/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..6179a27f --- /dev/null +++ b/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.func.ts @@ -0,0 +1,51 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; +export const createRelayProviderPrices = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayProviderPrices.typeUrl, + encoders: toEncoders(MsgRelayProviderPrices), + converters: toConverters(MsgRelayProviderPrices) +}); +export const createRelayPriceFeedPrice = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayPriceFeedPrice.typeUrl, + encoders: toEncoders(MsgRelayPriceFeedPrice), + converters: toConverters(MsgRelayPriceFeedPrice) +}); +export const createRelayBandRates = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayBandRates.typeUrl, + encoders: toEncoders(MsgRelayBandRates), + converters: toConverters(MsgRelayBandRates) +}); +export const createRequestBandIBCRates = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestBandIBCRates.typeUrl, + encoders: toEncoders(MsgRequestBandIBCRates), + converters: toConverters(MsgRequestBandIBCRates) +}); +export const createRelayCoinbaseMessages = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayCoinbaseMessages.typeUrl, + encoders: toEncoders(MsgRelayCoinbaseMessages), + converters: toConverters(MsgRelayCoinbaseMessages) +}); +export const createRelayStorkMessage = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayStorkPrices.typeUrl, + encoders: toEncoders(MsgRelayStorkPrices), + converters: toConverters(MsgRelayStorkPrices) +}); +export const createRelayPythPrices = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayPythPrices.typeUrl, + encoders: toEncoders(MsgRelayPythPrices), + converters: toConverters(MsgRelayPythPrices) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 3e5dc129..00000000 --- a/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgRelayProviderPrices, MsgRelayProviderPricesResponse, MsgRelayPriceFeedPrice, MsgRelayPriceFeedPriceResponse, MsgRelayBandRates, MsgRelayBandRatesResponse, MsgRequestBandIBCRates, MsgRequestBandIBCRatesResponse, MsgRelayCoinbaseMessages, MsgRelayCoinbaseMessagesResponse, MsgRelayStorkPrices, MsgRelayStorkPricesResponse, MsgRelayPythPrices, MsgRelayPythPricesResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the oracle Msg service. */ -export interface Msg { - /** - * RelayProviderPrice defines a method for relaying a price for a - * provider-based oracle - */ - relayProviderPrices(request: MsgRelayProviderPrices): Promise; - /** - * RelayPriceFeedPrice defines a method for relaying a price for a price - * feeder-based oracle - */ - relayPriceFeedPrice(request: MsgRelayPriceFeedPrice): Promise; - /** RelayBandRates defines a method for relaying rates from Band */ - relayBandRates(request: MsgRelayBandRates): Promise; - /** RequestBandIBCRates defines a method for fetching rates from Band ibc */ - requestBandIBCRates(request: MsgRequestBandIBCRates): Promise; - /** - * RelayCoinbaseMessages defines a method for relaying price messages from - * Coinbase API - */ - relayCoinbaseMessages(request: MsgRelayCoinbaseMessages): Promise; - /** - * RelayStorkMessage defines a method for relaying price message from - * Stork API - */ - relayStorkMessage(request: MsgRelayStorkPrices): Promise; - /** RelayPythPrices defines a method for relaying rates from the Pyth contract */ - relayPythPrices(request: MsgRelayPythPrices): Promise; - /** UpdateParams enables updating oracle module's params via governance */ - updateParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* RelayProviderPrice defines a method for relaying a price for a - provider-based oracle */ - relayProviderPrices = async (request: MsgRelayProviderPrices): Promise => { - const data = MsgRelayProviderPrices.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "RelayProviderPrices", data); - return promise.then(data => MsgRelayProviderPricesResponse.decode(new BinaryReader(data))); - }; - /* RelayPriceFeedPrice defines a method for relaying a price for a price - feeder-based oracle */ - relayPriceFeedPrice = async (request: MsgRelayPriceFeedPrice): Promise => { - const data = MsgRelayPriceFeedPrice.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "RelayPriceFeedPrice", data); - return promise.then(data => MsgRelayPriceFeedPriceResponse.decode(new BinaryReader(data))); - }; - /* RelayBandRates defines a method for relaying rates from Band */ - relayBandRates = async (request: MsgRelayBandRates): Promise => { - const data = MsgRelayBandRates.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "RelayBandRates", data); - return promise.then(data => MsgRelayBandRatesResponse.decode(new BinaryReader(data))); - }; - /* RequestBandIBCRates defines a method for fetching rates from Band ibc */ - requestBandIBCRates = async (request: MsgRequestBandIBCRates): Promise => { - const data = MsgRequestBandIBCRates.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "RequestBandIBCRates", data); - return promise.then(data => MsgRequestBandIBCRatesResponse.decode(new BinaryReader(data))); - }; - /* RelayCoinbaseMessages defines a method for relaying price messages from - Coinbase API */ - relayCoinbaseMessages = async (request: MsgRelayCoinbaseMessages): Promise => { - const data = MsgRelayCoinbaseMessages.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "RelayCoinbaseMessages", data); - return promise.then(data => MsgRelayCoinbaseMessagesResponse.decode(new BinaryReader(data))); - }; - /* RelayStorkMessage defines a method for relaying price message from - Stork API */ - relayStorkMessage = async (request: MsgRelayStorkPrices): Promise => { - const data = MsgRelayStorkPrices.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "RelayStorkMessage", data); - return promise.then(data => MsgRelayStorkPricesResponse.decode(new BinaryReader(data))); - }; - /* RelayPythPrices defines a method for relaying rates from the Pyth contract */ - relayPythPrices = async (request: MsgRelayPythPrices): Promise => { - const data = MsgRelayPythPrices.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "RelayPythPrices", data); - return promise.then(data => MsgRelayPythPricesResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams enables updating oracle module's params via governance */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.oracle.v1beta1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..948bdcb3 --- /dev/null +++ b/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,27 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; +import { createRelayProviderPrices, createRelayPriceFeedPrice, createRelayBandRates, createRequestBandIBCRates, createRelayCoinbaseMessages, createRelayStorkMessage, createRelayPythPrices, createUpdateParams } from "./tx.rpc.func.ts"; +export const useRelayProviderPrices = buildUseVueMutation({ + builderMutationFn: createRelayProviderPrices +}); +export const useRelayPriceFeedPrice = buildUseVueMutation({ + builderMutationFn: createRelayPriceFeedPrice +}); +export const useRelayBandRates = buildUseVueMutation({ + builderMutationFn: createRelayBandRates +}); +export const useRequestBandIBCRates = buildUseVueMutation({ + builderMutationFn: createRequestBandIBCRates +}); +export const useRelayCoinbaseMessages = buildUseVueMutation({ + builderMutationFn: createRelayCoinbaseMessages +}); +export const useRelayStorkMessage = buildUseVueMutation({ + builderMutationFn: createRelayStorkMessage +}); +export const useRelayPythPrices = buildUseVueMutation({ + builderMutationFn: createRelayPythPrices +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/tx.ts b/libs/injective-vue/src/injective/oracle/v1beta1/tx.ts index 119e657a..d87e3df4 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/tx.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/tx.ts @@ -2,7 +2,6 @@ import { AssetPair, AssetPairAmino, PriceAttestation, PriceAttestationAmino, Par import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgRelayProviderPrice defines a SDK message for setting a price through the * provider oracle. @@ -13,12 +12,6 @@ export interface MsgRelayProviderPrices { symbols: string[]; prices: string[]; } -export interface ReactiveMsgRelayProviderPrices { - sender: ComputedRef; - provider: ComputedRef; - symbols: ComputedRef; - prices: ComputedRef; -} export interface MsgRelayProviderPricesProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPrices"; value: Uint8Array; @@ -38,7 +31,6 @@ export interface MsgRelayProviderPricesAminoMsg { value: MsgRelayProviderPricesAmino; } export interface MsgRelayProviderPricesResponse {} -export interface ReactiveMsgRelayProviderPricesResponse {} export interface MsgRelayProviderPricesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse"; value: Uint8Array; @@ -59,12 +51,6 @@ export interface MsgRelayPriceFeedPrice { /** price defines the price of the oracle base and quote */ price: string[]; } -export interface ReactiveMsgRelayPriceFeedPrice { - sender: ComputedRef; - base: ComputedRef; - quote: ComputedRef; - price: ComputedRef; -} export interface MsgRelayPriceFeedPriceProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice"; value: Uint8Array; @@ -85,7 +71,6 @@ export interface MsgRelayPriceFeedPriceAminoMsg { value: MsgRelayPriceFeedPriceAmino; } export interface MsgRelayPriceFeedPriceResponse {} -export interface ReactiveMsgRelayPriceFeedPriceResponse {} export interface MsgRelayPriceFeedPriceResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse"; value: Uint8Array; @@ -102,13 +87,6 @@ export interface MsgRelayBandRates { resolveTimes: bigint[]; requestIDs: bigint[]; } -export interface ReactiveMsgRelayBandRates { - relayer: ComputedRef; - symbols: ComputedRef; - rates: ComputedRef; - resolveTimes: ComputedRef; - requestIDs: ComputedRef; -} export interface MsgRelayBandRatesProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRates"; value: Uint8Array; @@ -125,7 +103,6 @@ export interface MsgRelayBandRatesAminoMsg { value: MsgRelayBandRatesAmino; } export interface MsgRelayBandRatesResponse {} -export interface ReactiveMsgRelayBandRatesResponse {} export interface MsgRelayBandRatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse"; value: Uint8Array; @@ -144,11 +121,6 @@ export interface MsgRelayCoinbaseMessages { messages: Uint8Array[]; signatures: Uint8Array[]; } -export interface ReactiveMsgRelayCoinbaseMessages { - sender: ComputedRef; - messages: ComputedRef; - signatures: ComputedRef; -} export interface MsgRelayCoinbaseMessagesProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages"; value: Uint8Array; @@ -167,7 +139,6 @@ export interface MsgRelayCoinbaseMessagesAminoMsg { value: MsgRelayCoinbaseMessagesAmino; } export interface MsgRelayCoinbaseMessagesResponse {} -export interface ReactiveMsgRelayCoinbaseMessagesResponse {} export interface MsgRelayCoinbaseMessagesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse"; value: Uint8Array; @@ -185,10 +156,6 @@ export interface MsgRelayStorkPrices { sender: string; assetPairs: AssetPair[]; } -export interface ReactiveMsgRelayStorkPrices { - sender: ComputedRef; - assetPairs: ComputedRef; -} export interface MsgRelayStorkPricesProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPrices"; value: Uint8Array; @@ -206,7 +173,6 @@ export interface MsgRelayStorkPricesAminoMsg { value: MsgRelayStorkPricesAmino; } export interface MsgRelayStorkPricesResponse {} -export interface ReactiveMsgRelayStorkPricesResponse {} export interface MsgRelayStorkPricesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse"; value: Uint8Array; @@ -224,10 +190,6 @@ export interface MsgRequestBandIBCRates { sender: string; requestId: bigint; } -export interface ReactiveMsgRequestBandIBCRates { - sender: ComputedRef; - requestId: ComputedRef; -} export interface MsgRequestBandIBCRatesProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRates"; value: Uint8Array; @@ -246,7 +208,6 @@ export interface MsgRequestBandIBCRatesAminoMsg { } /** MsgRequestDataResponse defines the Msg/RequestBandIBCRates response type. */ export interface MsgRequestBandIBCRatesResponse {} -export interface ReactiveMsgRequestBandIBCRatesResponse {} export interface MsgRequestBandIBCRatesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse"; value: Uint8Array; @@ -262,10 +223,6 @@ export interface MsgRelayPythPrices { sender: string; priceAttestations: PriceAttestation[]; } -export interface ReactiveMsgRelayPythPrices { - sender: ComputedRef; - priceAttestations: ComputedRef; -} export interface MsgRelayPythPricesProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPrices"; value: Uint8Array; @@ -281,7 +238,6 @@ export interface MsgRelayPythPricesAminoMsg { } /** MsgRelayPythPricesResponse defines the Msg/RelayPythPrices response type. */ export interface MsgRelayPythPricesResponse {} -export interface ReactiveMsgRelayPythPricesResponse {} export interface MsgRelayPythPricesResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse"; value: Uint8Array; @@ -302,10 +258,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -325,7 +277,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.oracle.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/attestation.ts b/libs/injective-vue/src/injective/peggy/v1/attestation.ts index 604cdd98..914c0396 100644 --- a/libs/injective-vue/src/injective/peggy/v1/attestation.ts +++ b/libs/injective-vue/src/injective/peggy/v1/attestation.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * ClaimType is the cosmos type of an event from the counterpart chain that can * be handled @@ -79,12 +78,6 @@ export interface Attestation { height: bigint; claim?: Any; } -export interface ReactiveAttestation { - observed: ComputedRef; - votes: ComputedRef; - height: ComputedRef; - claim?: ComputedRef; -} export interface AttestationProtoMsg { typeUrl: "/injective.peggy.v1.Attestation"; value: Uint8Array; @@ -128,10 +121,6 @@ export interface ERC20Token { contract: string; amount: string; } -export interface ReactiveERC20Token { - contract: ComputedRef; - amount: ComputedRef; -} export interface ERC20TokenProtoMsg { typeUrl: "/injective.peggy.v1.ERC20Token"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/batch.ts b/libs/injective-vue/src/injective/peggy/v1/batch.ts index ee800a9c..c4bc396f 100644 --- a/libs/injective-vue/src/injective/peggy/v1/batch.ts +++ b/libs/injective-vue/src/injective/peggy/v1/batch.ts @@ -2,7 +2,6 @@ import { ERC20Token, ERC20TokenAmino } from "./attestation"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** OutgoingTxBatch represents a batch of transactions going from Peggy to ETH */ export interface OutgoingTxBatch { batchNonce: bigint; @@ -11,13 +10,6 @@ export interface OutgoingTxBatch { tokenContract: string; block: bigint; } -export interface ReactiveOutgoingTxBatch { - batchNonce: ComputedRef; - batchTimeout: ComputedRef; - transactions: ComputedRef; - tokenContract: ComputedRef; - block: ComputedRef; -} export interface OutgoingTxBatchProtoMsg { typeUrl: "/injective.peggy.v1.OutgoingTxBatch"; value: Uint8Array; @@ -42,13 +34,6 @@ export interface OutgoingTransferTx { erc20Token?: ERC20Token; erc20Fee?: ERC20Token; } -export interface ReactiveOutgoingTransferTx { - id: ComputedRef; - sender: ComputedRef; - destAddress: ComputedRef; - erc20Token?: ComputedRef; - erc20Fee?: ComputedRef; -} export interface OutgoingTransferTxProtoMsg { typeUrl: "/injective.peggy.v1.OutgoingTransferTx"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/events.ts b/libs/injective-vue/src/injective/peggy/v1/events.ts index 730598a7..bb0b7095 100644 --- a/libs/injective-vue/src/injective/peggy/v1/events.ts +++ b/libs/injective-vue/src/injective/peggy/v1/events.ts @@ -3,7 +3,6 @@ import { BridgeValidator, BridgeValidatorAmino } from "./types"; import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface EventAttestationObserved { attestationType: ClaimType; bridgeContract: string; @@ -11,13 +10,6 @@ export interface EventAttestationObserved { attestationId: Uint8Array; nonce: bigint; } -export interface ReactiveEventAttestationObserved { - attestationType: ComputedRef; - bridgeContract: ComputedRef; - bridgeChainId: ComputedRef; - attestationId: ComputedRef; - nonce: ComputedRef; -} export interface EventAttestationObservedProtoMsg { typeUrl: "/injective.peggy.v1.EventAttestationObserved"; value: Uint8Array; @@ -37,10 +29,6 @@ export interface EventBridgeWithdrawCanceled { bridgeContract: string; bridgeChainId: bigint; } -export interface ReactiveEventBridgeWithdrawCanceled { - bridgeContract: ComputedRef; - bridgeChainId: ComputedRef; -} export interface EventBridgeWithdrawCanceledProtoMsg { typeUrl: "/injective.peggy.v1.EventBridgeWithdrawCanceled"; value: Uint8Array; @@ -60,13 +48,6 @@ export interface EventOutgoingBatch { batchTimeout: bigint; batchTxIds: bigint[]; } -export interface ReactiveEventOutgoingBatch { - denom: ComputedRef; - orchestratorAddress: ComputedRef; - batchNonce: ComputedRef; - batchTimeout: ComputedRef; - batchTxIds: ComputedRef; -} export interface EventOutgoingBatchProtoMsg { typeUrl: "/injective.peggy.v1.EventOutgoingBatch"; value: Uint8Array; @@ -88,12 +69,6 @@ export interface EventOutgoingBatchCanceled { batchId: bigint; nonce: bigint; } -export interface ReactiveEventOutgoingBatchCanceled { - bridgeContract: ComputedRef; - bridgeChainId: ComputedRef; - batchId: ComputedRef; - nonce: ComputedRef; -} export interface EventOutgoingBatchCanceledProtoMsg { typeUrl: "/injective.peggy.v1.EventOutgoingBatchCanceled"; value: Uint8Array; @@ -115,13 +90,6 @@ export interface EventValsetUpdateRequest { rewardAmount: string; rewardToken: string; } -export interface ReactiveEventValsetUpdateRequest { - valsetNonce: ComputedRef; - valsetHeight: ComputedRef; - valsetMembers: ComputedRef; - rewardAmount: ComputedRef; - rewardToken: ComputedRef; -} export interface EventValsetUpdateRequestProtoMsg { typeUrl: "/injective.peggy.v1.EventValsetUpdateRequest"; value: Uint8Array; @@ -142,11 +110,6 @@ export interface EventSetOrchestratorAddresses { orchestratorAddress: string; operatorEthAddress: string; } -export interface ReactiveEventSetOrchestratorAddresses { - validatorAddress: ComputedRef; - orchestratorAddress: ComputedRef; - operatorEthAddress: ComputedRef; -} export interface EventSetOrchestratorAddressesProtoMsg { typeUrl: "/injective.peggy.v1.EventSetOrchestratorAddresses"; value: Uint8Array; @@ -164,10 +127,6 @@ export interface EventValsetConfirm { valsetNonce: bigint; orchestratorAddress: string; } -export interface ReactiveEventValsetConfirm { - valsetNonce: ComputedRef; - orchestratorAddress: ComputedRef; -} export interface EventValsetConfirmProtoMsg { typeUrl: "/injective.peggy.v1.EventValsetConfirm"; value: Uint8Array; @@ -187,13 +146,6 @@ export interface EventSendToEth { amount: string; bridgeFee: string; } -export interface ReactiveEventSendToEth { - outgoingTxId: ComputedRef; - sender: ComputedRef; - receiver: ComputedRef; - amount: ComputedRef; - bridgeFee: ComputedRef; -} export interface EventSendToEthProtoMsg { typeUrl: "/injective.peggy.v1.EventSendToEth"; value: Uint8Array; @@ -213,10 +165,6 @@ export interface EventConfirmBatch { batchNonce: bigint; orchestratorAddress: string; } -export interface ReactiveEventConfirmBatch { - batchNonce: ComputedRef; - orchestratorAddress: ComputedRef; -} export interface EventConfirmBatchProtoMsg { typeUrl: "/injective.peggy.v1.EventConfirmBatch"; value: Uint8Array; @@ -234,11 +182,6 @@ export interface EventAttestationVote { attestationId: Uint8Array; voter: string; } -export interface ReactiveEventAttestationVote { - eventNonce: ComputedRef; - attestationId: ComputedRef; - voter: ComputedRef; -} export interface EventAttestationVoteProtoMsg { typeUrl: "/injective.peggy.v1.EventAttestationVote"; value: Uint8Array; @@ -263,17 +206,6 @@ export interface EventDepositClaim { orchestratorAddress: string; data: string; } -export interface ReactiveEventDepositClaim { - eventNonce: ComputedRef; - eventHeight: ComputedRef; - attestationId: ComputedRef; - ethereumSender: ComputedRef; - cosmosReceiver: ComputedRef; - tokenContract: ComputedRef; - amount: ComputedRef; - orchestratorAddress: ComputedRef; - data: ComputedRef; -} export interface EventDepositClaimProtoMsg { typeUrl: "/injective.peggy.v1.EventDepositClaim"; value: Uint8Array; @@ -301,14 +233,6 @@ export interface EventWithdrawClaim { tokenContract: string; orchestratorAddress: string; } -export interface ReactiveEventWithdrawClaim { - eventNonce: ComputedRef; - eventHeight: ComputedRef; - attestationId: ComputedRef; - batchNonce: ComputedRef; - tokenContract: ComputedRef; - orchestratorAddress: ComputedRef; -} export interface EventWithdrawClaimProtoMsg { typeUrl: "/injective.peggy.v1.EventWithdrawClaim"; value: Uint8Array; @@ -336,17 +260,6 @@ export interface EventERC20DeployedClaim { decimals: bigint; orchestratorAddress: string; } -export interface ReactiveEventERC20DeployedClaim { - eventNonce: ComputedRef; - eventHeight: ComputedRef; - attestationId: ComputedRef; - cosmosDenom: ComputedRef; - tokenContract: ComputedRef; - name: ComputedRef; - symbol: ComputedRef; - decimals: ComputedRef; - orchestratorAddress: ComputedRef; -} export interface EventERC20DeployedClaimProtoMsg { typeUrl: "/injective.peggy.v1.EventERC20DeployedClaim"; value: Uint8Array; @@ -376,16 +289,6 @@ export interface EventValsetUpdateClaim { rewardToken: string; orchestratorAddress: string; } -export interface ReactiveEventValsetUpdateClaim { - eventNonce: ComputedRef; - eventHeight: ComputedRef; - attestationId: ComputedRef; - valsetNonce: ComputedRef; - valsetMembers: ComputedRef; - rewardAmount: ComputedRef; - rewardToken: ComputedRef; - orchestratorAddress: ComputedRef; -} export interface EventValsetUpdateClaimProtoMsg { typeUrl: "/injective.peggy.v1.EventValsetUpdateClaim"; value: Uint8Array; @@ -407,9 +310,6 @@ export interface EventValsetUpdateClaimAminoMsg { export interface EventCancelSendToEth { outgoingTxId: bigint; } -export interface ReactiveEventCancelSendToEth { - outgoingTxId: ComputedRef; -} export interface EventCancelSendToEthProtoMsg { typeUrl: "/injective.peggy.v1.EventCancelSendToEth"; value: Uint8Array; @@ -425,10 +325,6 @@ export interface EventSubmitBadSignatureEvidence { badEthSignature: string; badEthSignatureSubject: string; } -export interface ReactiveEventSubmitBadSignatureEvidence { - badEthSignature: ComputedRef; - badEthSignatureSubject: ComputedRef; -} export interface EventSubmitBadSignatureEvidenceProtoMsg { typeUrl: "/injective.peggy.v1.EventSubmitBadSignatureEvidence"; value: Uint8Array; @@ -448,13 +344,6 @@ export interface EventValidatorSlash { operatorAddress: string; moniker: string; } -export interface ReactiveEventValidatorSlash { - power: ComputedRef; - reason: ComputedRef; - consensusAddress: ComputedRef; - operatorAddress: ComputedRef; - moniker: ComputedRef; -} export interface EventValidatorSlashProtoMsg { typeUrl: "/injective.peggy.v1.EventValidatorSlash"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/genesis.ts b/libs/injective-vue/src/injective/peggy/v1/genesis.ts index a72595a7..221b49ab 100644 --- a/libs/injective-vue/src/injective/peggy/v1/genesis.ts +++ b/libs/injective-vue/src/injective/peggy/v1/genesis.ts @@ -6,7 +6,6 @@ import { Attestation, AttestationAmino } from "./attestation"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState struct */ export interface GenesisState { params?: Params; @@ -25,23 +24,6 @@ export interface GenesisState { lastObservedValset: Valset; ethereumBlacklist: string[]; } -export interface ReactiveGenesisState { - params?: ComputedRef; - lastObservedNonce: ComputedRef; - valsets: ComputedRef; - valsetConfirms: ComputedRef; - batches: ComputedRef; - batchConfirms: ComputedRef; - attestations: ComputedRef; - orchestratorAddresses: ComputedRef; - erc20ToDenoms: ComputedRef; - unbatchedTransfers: ComputedRef; - lastObservedEthereumHeight: ComputedRef; - lastOutgoingBatchId: ComputedRef; - lastOutgoingPoolId: ComputedRef; - lastObservedValset: ComputedRef; - ethereumBlacklist: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.peggy.v1.GenesisState"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/msgs.amino.ts b/libs/injective-vue/src/injective/peggy/v1/msgs.amino.ts deleted file mode 100644 index 6c83a31b..00000000 --- a/libs/injective-vue/src/injective/peggy/v1/msgs.amino.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; -export const AminoConverter = { - "/injective.peggy.v1.MsgValsetConfirm": { - aminoType: "peggy/MsgValsetConfirm", - toAmino: MsgValsetConfirm.toAmino, - fromAmino: MsgValsetConfirm.fromAmino - }, - "/injective.peggy.v1.MsgSendToEth": { - aminoType: "peggy/MsgSendToEth", - toAmino: MsgSendToEth.toAmino, - fromAmino: MsgSendToEth.fromAmino - }, - "/injective.peggy.v1.MsgRequestBatch": { - aminoType: "peggy/MsgRequestBatch", - toAmino: MsgRequestBatch.toAmino, - fromAmino: MsgRequestBatch.fromAmino - }, - "/injective.peggy.v1.MsgConfirmBatch": { - aminoType: "peggy/MsgConfirmBatch", - toAmino: MsgConfirmBatch.toAmino, - fromAmino: MsgConfirmBatch.fromAmino - }, - "/injective.peggy.v1.MsgDepositClaim": { - aminoType: "peggy/MsgDepositClaim", - toAmino: MsgDepositClaim.toAmino, - fromAmino: MsgDepositClaim.fromAmino - }, - "/injective.peggy.v1.MsgWithdrawClaim": { - aminoType: "peggy/MsgWithdrawClaim", - toAmino: MsgWithdrawClaim.toAmino, - fromAmino: MsgWithdrawClaim.fromAmino - }, - "/injective.peggy.v1.MsgValsetUpdatedClaim": { - aminoType: "peggy/MsgValsetUpdatedClaim", - toAmino: MsgValsetUpdatedClaim.toAmino, - fromAmino: MsgValsetUpdatedClaim.fromAmino - }, - "/injective.peggy.v1.MsgERC20DeployedClaim": { - aminoType: "peggy/MsgERC20DeployedClaim", - toAmino: MsgERC20DeployedClaim.toAmino, - fromAmino: MsgERC20DeployedClaim.fromAmino - }, - "/injective.peggy.v1.MsgSetOrchestratorAddresses": { - aminoType: "peggy/MsgSetOrchestratorAddresses", - toAmino: MsgSetOrchestratorAddresses.toAmino, - fromAmino: MsgSetOrchestratorAddresses.fromAmino - }, - "/injective.peggy.v1.MsgCancelSendToEth": { - aminoType: "peggy/MsgCancelSendToEth", - toAmino: MsgCancelSendToEth.toAmino, - fromAmino: MsgCancelSendToEth.fromAmino - }, - "/injective.peggy.v1.MsgSubmitBadSignatureEvidence": { - aminoType: "peggy/MsgSubmitBadSignatureEvidence", - toAmino: MsgSubmitBadSignatureEvidence.toAmino, - fromAmino: MsgSubmitBadSignatureEvidence.fromAmino - }, - "/injective.peggy.v1.MsgUpdateParams": { - aminoType: "peggy/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/injective.peggy.v1.MsgBlacklistEthereumAddresses": { - aminoType: "peggy/MsgBlacklistEthereumAddresses", - toAmino: MsgBlacklistEthereumAddresses.toAmino, - fromAmino: MsgBlacklistEthereumAddresses.fromAmino - }, - "/injective.peggy.v1.MsgRevokeEthereumBlacklist": { - aminoType: "peggy/MsgRevokeEthereumBlacklist", - toAmino: MsgRevokeEthereumBlacklist.toAmino, - fromAmino: MsgRevokeEthereumBlacklist.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.func.ts b/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.func.ts new file mode 100644 index 00000000..24882c49 --- /dev/null +++ b/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.func.ts @@ -0,0 +1,87 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; +export const createValsetConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgValsetConfirm.typeUrl, + encoders: toEncoders(MsgValsetConfirm), + converters: toConverters(MsgValsetConfirm) +}); +export const createSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSendToEth.typeUrl, + encoders: toEncoders(MsgSendToEth), + converters: toConverters(MsgSendToEth) +}); +export const createRequestBatch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestBatch.typeUrl, + encoders: toEncoders(MsgRequestBatch), + converters: toConverters(MsgRequestBatch) +}); +export const createConfirmBatch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConfirmBatch.typeUrl, + encoders: toEncoders(MsgConfirmBatch), + converters: toConverters(MsgConfirmBatch) +}); +export const createDepositClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDepositClaim.typeUrl, + encoders: toEncoders(MsgDepositClaim), + converters: toConverters(MsgDepositClaim) +}); +export const createWithdrawClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawClaim.typeUrl, + encoders: toEncoders(MsgWithdrawClaim), + converters: toConverters(MsgWithdrawClaim) +}); +export const createValsetUpdateClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgValsetUpdatedClaim.typeUrl, + encoders: toEncoders(MsgValsetUpdatedClaim), + converters: toConverters(MsgValsetUpdatedClaim) +}); +export const createERC20DeployedClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgERC20DeployedClaim.typeUrl, + encoders: toEncoders(MsgERC20DeployedClaim), + converters: toConverters(MsgERC20DeployedClaim) +}); +export const createSetOrchestratorAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetOrchestratorAddresses.typeUrl, + encoders: toEncoders(MsgSetOrchestratorAddresses), + converters: toConverters(MsgSetOrchestratorAddresses) +}); +export const createCancelSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelSendToEth.typeUrl, + encoders: toEncoders(MsgCancelSendToEth), + converters: toConverters(MsgCancelSendToEth) +}); +export const createSubmitBadSignatureEvidence = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitBadSignatureEvidence.typeUrl, + encoders: toEncoders(MsgSubmitBadSignatureEvidence), + converters: toConverters(MsgSubmitBadSignatureEvidence) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createBlacklistEthereumAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBlacklistEthereumAddresses.typeUrl, + encoders: toEncoders(MsgBlacklistEthereumAddresses), + converters: toConverters(MsgBlacklistEthereumAddresses) +}); +export const createRevokeEthereumBlacklist = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeEthereumBlacklist.typeUrl, + encoders: toEncoders(MsgRevokeEthereumBlacklist), + converters: toConverters(MsgRevokeEthereumBlacklist) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.msg.ts b/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.msg.ts deleted file mode 100644 index a43b94b6..00000000 --- a/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.msg.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgValsetConfirm, MsgValsetConfirmResponse, MsgSendToEth, MsgSendToEthResponse, MsgRequestBatch, MsgRequestBatchResponse, MsgConfirmBatch, MsgConfirmBatchResponse, MsgDepositClaim, MsgDepositClaimResponse, MsgWithdrawClaim, MsgWithdrawClaimResponse, MsgValsetUpdatedClaim, MsgValsetUpdatedClaimResponse, MsgERC20DeployedClaim, MsgERC20DeployedClaimResponse, MsgSetOrchestratorAddresses, MsgSetOrchestratorAddressesResponse, MsgCancelSendToEth, MsgCancelSendToEthResponse, MsgSubmitBadSignatureEvidence, MsgSubmitBadSignatureEvidenceResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgBlacklistEthereumAddresses, MsgBlacklistEthereumAddressesResponse, MsgRevokeEthereumBlacklist, MsgRevokeEthereumBlacklistResponse } from "./msgs"; -export interface Msg { - valsetConfirm(request: MsgValsetConfirm): Promise; - sendToEth(request: MsgSendToEth): Promise; - requestBatch(request: MsgRequestBatch): Promise; - confirmBatch(request: MsgConfirmBatch): Promise; - depositClaim(request: MsgDepositClaim): Promise; - withdrawClaim(request: MsgWithdrawClaim): Promise; - valsetUpdateClaim(request: MsgValsetUpdatedClaim): Promise; - eRC20DeployedClaim(request: MsgERC20DeployedClaim): Promise; - setOrchestratorAddresses(request: MsgSetOrchestratorAddresses): Promise; - cancelSendToEth(request: MsgCancelSendToEth): Promise; - submitBadSignatureEvidence(request: MsgSubmitBadSignatureEvidence): Promise; - updateParams(request: MsgUpdateParams): Promise; - /** BlacklistEthereumAddresses adds Ethereum addresses to the peggy blacklist. */ - blacklistEthereumAddresses(request: MsgBlacklistEthereumAddresses): Promise; - /** - * RevokeEthereumBlacklist removes Ethereum addresses from the peggy - * blacklist. - */ - revokeEthereumBlacklist(request: MsgRevokeEthereumBlacklist): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* ValsetConfirm */ - valsetConfirm = async (request: MsgValsetConfirm): Promise => { - const data = MsgValsetConfirm.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "ValsetConfirm", data); - return promise.then(data => MsgValsetConfirmResponse.decode(new BinaryReader(data))); - }; - /* SendToEth */ - sendToEth = async (request: MsgSendToEth): Promise => { - const data = MsgSendToEth.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "SendToEth", data); - return promise.then(data => MsgSendToEthResponse.decode(new BinaryReader(data))); - }; - /* RequestBatch */ - requestBatch = async (request: MsgRequestBatch): Promise => { - const data = MsgRequestBatch.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "RequestBatch", data); - return promise.then(data => MsgRequestBatchResponse.decode(new BinaryReader(data))); - }; - /* ConfirmBatch */ - confirmBatch = async (request: MsgConfirmBatch): Promise => { - const data = MsgConfirmBatch.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "ConfirmBatch", data); - return promise.then(data => MsgConfirmBatchResponse.decode(new BinaryReader(data))); - }; - /* DepositClaim */ - depositClaim = async (request: MsgDepositClaim): Promise => { - const data = MsgDepositClaim.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "DepositClaim", data); - return promise.then(data => MsgDepositClaimResponse.decode(new BinaryReader(data))); - }; - /* WithdrawClaim */ - withdrawClaim = async (request: MsgWithdrawClaim): Promise => { - const data = MsgWithdrawClaim.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "WithdrawClaim", data); - return promise.then(data => MsgWithdrawClaimResponse.decode(new BinaryReader(data))); - }; - /* ValsetUpdateClaim */ - valsetUpdateClaim = async (request: MsgValsetUpdatedClaim): Promise => { - const data = MsgValsetUpdatedClaim.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "ValsetUpdateClaim", data); - return promise.then(data => MsgValsetUpdatedClaimResponse.decode(new BinaryReader(data))); - }; - /* ERC20DeployedClaim */ - eRC20DeployedClaim = async (request: MsgERC20DeployedClaim): Promise => { - const data = MsgERC20DeployedClaim.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "ERC20DeployedClaim", data); - return promise.then(data => MsgERC20DeployedClaimResponse.decode(new BinaryReader(data))); - }; - /* SetOrchestratorAddresses */ - setOrchestratorAddresses = async (request: MsgSetOrchestratorAddresses): Promise => { - const data = MsgSetOrchestratorAddresses.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "SetOrchestratorAddresses", data); - return promise.then(data => MsgSetOrchestratorAddressesResponse.decode(new BinaryReader(data))); - }; - /* CancelSendToEth */ - cancelSendToEth = async (request: MsgCancelSendToEth): Promise => { - const data = MsgCancelSendToEth.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "CancelSendToEth", data); - return promise.then(data => MsgCancelSendToEthResponse.decode(new BinaryReader(data))); - }; - /* SubmitBadSignatureEvidence */ - submitBadSignatureEvidence = async (request: MsgSubmitBadSignatureEvidence): Promise => { - const data = MsgSubmitBadSignatureEvidence.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "SubmitBadSignatureEvidence", data); - return promise.then(data => MsgSubmitBadSignatureEvidenceResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; - /* BlacklistEthereumAddresses adds Ethereum addresses to the peggy blacklist. */ - blacklistEthereumAddresses = async (request: MsgBlacklistEthereumAddresses): Promise => { - const data = MsgBlacklistEthereumAddresses.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "BlacklistEthereumAddresses", data); - return promise.then(data => MsgBlacklistEthereumAddressesResponse.decode(new BinaryReader(data))); - }; - /* RevokeEthereumBlacklist removes Ethereum addresses from the peggy - blacklist. */ - revokeEthereumBlacklist = async (request: MsgRevokeEthereumBlacklist): Promise => { - const data = MsgRevokeEthereumBlacklist.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Msg", "RevokeEthereumBlacklist", data); - return promise.then(data => MsgRevokeEthereumBlacklistResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts b/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts new file mode 100644 index 00000000..a3e035a4 --- /dev/null +++ b/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts @@ -0,0 +1,45 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; +import { createValsetConfirm, createSendToEth, createRequestBatch, createConfirmBatch, createDepositClaim, createWithdrawClaim, createValsetUpdateClaim, createERC20DeployedClaim, createSetOrchestratorAddresses, createCancelSendToEth, createSubmitBadSignatureEvidence, createUpdateParams, createBlacklistEthereumAddresses, createRevokeEthereumBlacklist } from "./msgs.rpc.func.ts"; +export const useValsetConfirm = buildUseVueMutation({ + builderMutationFn: createValsetConfirm +}); +export const useSendToEth = buildUseVueMutation({ + builderMutationFn: createSendToEth +}); +export const useRequestBatch = buildUseVueMutation({ + builderMutationFn: createRequestBatch +}); +export const useConfirmBatch = buildUseVueMutation({ + builderMutationFn: createConfirmBatch +}); +export const useDepositClaim = buildUseVueMutation({ + builderMutationFn: createDepositClaim +}); +export const useWithdrawClaim = buildUseVueMutation({ + builderMutationFn: createWithdrawClaim +}); +export const useValsetUpdateClaim = buildUseVueMutation({ + builderMutationFn: createValsetUpdateClaim +}); +export const useERC20DeployedClaim = buildUseVueMutation({ + builderMutationFn: createERC20DeployedClaim +}); +export const useSetOrchestratorAddresses = buildUseVueMutation({ + builderMutationFn: createSetOrchestratorAddresses +}); +export const useCancelSendToEth = buildUseVueMutation({ + builderMutationFn: createCancelSendToEth +}); +export const useSubmitBadSignatureEvidence = buildUseVueMutation({ + builderMutationFn: createSubmitBadSignatureEvidence +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useBlacklistEthereumAddresses = buildUseVueMutation({ + builderMutationFn: createBlacklistEthereumAddresses +}); +export const useRevokeEthereumBlacklist = buildUseVueMutation({ + builderMutationFn: createRevokeEthereumBlacklist +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/peggy/v1/msgs.ts b/libs/injective-vue/src/injective/peggy/v1/msgs.ts index d99ee7e9..32e90531 100644 --- a/libs/injective-vue/src/injective/peggy/v1/msgs.ts +++ b/libs/injective-vue/src/injective/peggy/v1/msgs.ts @@ -5,7 +5,6 @@ import { Params, ParamsAmino } from "./params"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgSetOrchestratorAddresses * this message allows validators to delegate their voting responsibilities @@ -26,11 +25,6 @@ export interface MsgSetOrchestratorAddresses { orchestrator: string; ethAddress: string; } -export interface ReactiveMsgSetOrchestratorAddresses { - sender: ComputedRef; - orchestrator: ComputedRef; - ethAddress: ComputedRef; -} export interface MsgSetOrchestratorAddressesProtoMsg { typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddresses"; value: Uint8Array; @@ -60,7 +54,6 @@ export interface MsgSetOrchestratorAddressesAminoMsg { value: MsgSetOrchestratorAddressesAmino; } export interface MsgSetOrchestratorAddressesResponse {} -export interface ReactiveMsgSetOrchestratorAddressesResponse {} export interface MsgSetOrchestratorAddressesResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse"; value: Uint8Array; @@ -93,12 +86,6 @@ export interface MsgValsetConfirm { ethAddress: string; signature: string; } -export interface ReactiveMsgValsetConfirm { - nonce: ComputedRef; - orchestrator: ComputedRef; - ethAddress: ComputedRef; - signature: ComputedRef; -} export interface MsgValsetConfirmProtoMsg { typeUrl: "/injective.peggy.v1.MsgValsetConfirm"; value: Uint8Array; @@ -131,7 +118,6 @@ export interface MsgValsetConfirmAminoMsg { value: MsgValsetConfirmAmino; } export interface MsgValsetConfirmResponse {} -export interface ReactiveMsgValsetConfirmResponse {} export interface MsgValsetConfirmResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgValsetConfirmResponse"; value: Uint8Array; @@ -161,12 +147,6 @@ export interface MsgSendToEth { amount: Coin; bridgeFee: Coin; } -export interface ReactiveMsgSendToEth { - sender: ComputedRef; - ethDest: ComputedRef; - amount: ComputedRef; - bridgeFee: ComputedRef; -} export interface MsgSendToEthProtoMsg { typeUrl: "/injective.peggy.v1.MsgSendToEth"; value: Uint8Array; @@ -196,7 +176,6 @@ export interface MsgSendToEthAminoMsg { value: MsgSendToEthAmino; } export interface MsgSendToEthResponse {} -export interface ReactiveMsgSendToEthResponse {} export interface MsgSendToEthResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgSendToEthResponse"; value: Uint8Array; @@ -221,10 +200,6 @@ export interface MsgRequestBatch { orchestrator: string; denom: string; } -export interface ReactiveMsgRequestBatch { - orchestrator: ComputedRef; - denom: ComputedRef; -} export interface MsgRequestBatchProtoMsg { typeUrl: "/injective.peggy.v1.MsgRequestBatch"; value: Uint8Array; @@ -249,7 +224,6 @@ export interface MsgRequestBatchAminoMsg { value: MsgRequestBatchAmino; } export interface MsgRequestBatchResponse {} -export interface ReactiveMsgRequestBatchResponse {} export interface MsgRequestBatchResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgRequestBatchResponse"; value: Uint8Array; @@ -276,13 +250,6 @@ export interface MsgConfirmBatch { orchestrator: string; signature: string; } -export interface ReactiveMsgConfirmBatch { - nonce: ComputedRef; - tokenContract: ComputedRef; - ethSigner: ComputedRef; - orchestrator: ComputedRef; - signature: ComputedRef; -} export interface MsgConfirmBatchProtoMsg { typeUrl: "/injective.peggy.v1.MsgConfirmBatch"; value: Uint8Array; @@ -309,7 +276,6 @@ export interface MsgConfirmBatchAminoMsg { value: MsgConfirmBatchAmino; } export interface MsgConfirmBatchResponse {} -export interface ReactiveMsgConfirmBatchResponse {} export interface MsgConfirmBatchResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgConfirmBatchResponse"; value: Uint8Array; @@ -336,16 +302,6 @@ export interface MsgDepositClaim { orchestrator: string; data: string; } -export interface ReactiveMsgDepositClaim { - eventNonce: ComputedRef; - blockHeight: ComputedRef; - tokenContract: ComputedRef; - amount: ComputedRef; - ethereumSender: ComputedRef; - cosmosReceiver: ComputedRef; - orchestrator: ComputedRef; - data: ComputedRef; -} export interface MsgDepositClaimProtoMsg { typeUrl: "/injective.peggy.v1.MsgDepositClaim"; value: Uint8Array; @@ -372,7 +328,6 @@ export interface MsgDepositClaimAminoMsg { value: MsgDepositClaimAmino; } export interface MsgDepositClaimResponse {} -export interface ReactiveMsgDepositClaimResponse {} export interface MsgDepositClaimResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgDepositClaimResponse"; value: Uint8Array; @@ -393,13 +348,6 @@ export interface MsgWithdrawClaim { tokenContract: string; orchestrator: string; } -export interface ReactiveMsgWithdrawClaim { - eventNonce: ComputedRef; - blockHeight: ComputedRef; - batchNonce: ComputedRef; - tokenContract: ComputedRef; - orchestrator: ComputedRef; -} export interface MsgWithdrawClaimProtoMsg { typeUrl: "/injective.peggy.v1.MsgWithdrawClaim"; value: Uint8Array; @@ -420,7 +368,6 @@ export interface MsgWithdrawClaimAminoMsg { value: MsgWithdrawClaimAmino; } export interface MsgWithdrawClaimResponse {} -export interface ReactiveMsgWithdrawClaimResponse {} export interface MsgWithdrawClaimResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgWithdrawClaimResponse"; value: Uint8Array; @@ -445,16 +392,6 @@ export interface MsgERC20DeployedClaim { decimals: bigint; orchestrator: string; } -export interface ReactiveMsgERC20DeployedClaim { - eventNonce: ComputedRef; - blockHeight: ComputedRef; - cosmosDenom: ComputedRef; - tokenContract: ComputedRef; - name: ComputedRef; - symbol: ComputedRef; - decimals: ComputedRef; - orchestrator: ComputedRef; -} export interface MsgERC20DeployedClaimProtoMsg { typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaim"; value: Uint8Array; @@ -479,7 +416,6 @@ export interface MsgERC20DeployedClaimAminoMsg { value: MsgERC20DeployedClaimAmino; } export interface MsgERC20DeployedClaimResponse {} -export interface ReactiveMsgERC20DeployedClaimResponse {} export interface MsgERC20DeployedClaimResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaimResponse"; value: Uint8Array; @@ -498,10 +434,6 @@ export interface MsgCancelSendToEth { transactionId: bigint; sender: string; } -export interface ReactiveMsgCancelSendToEth { - transactionId: ComputedRef; - sender: ComputedRef; -} export interface MsgCancelSendToEthProtoMsg { typeUrl: "/injective.peggy.v1.MsgCancelSendToEth"; value: Uint8Array; @@ -520,7 +452,6 @@ export interface MsgCancelSendToEthAminoMsg { value: MsgCancelSendToEthAmino; } export interface MsgCancelSendToEthResponse {} -export interface ReactiveMsgCancelSendToEthResponse {} export interface MsgCancelSendToEthResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgCancelSendToEthResponse"; value: Uint8Array; @@ -540,11 +471,6 @@ export interface MsgSubmitBadSignatureEvidence { signature: string; sender: string; } -export interface ReactiveMsgSubmitBadSignatureEvidence { - subject?: ComputedRef; - signature: ComputedRef; - sender: ComputedRef; -} export interface MsgSubmitBadSignatureEvidenceProtoMsg { typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidence"; value: Uint8Array; @@ -564,7 +490,6 @@ export interface MsgSubmitBadSignatureEvidenceAminoMsg { value: MsgSubmitBadSignatureEvidenceAmino; } export interface MsgSubmitBadSignatureEvidenceResponse {} -export interface ReactiveMsgSubmitBadSignatureEvidenceResponse {} export interface MsgSubmitBadSignatureEvidenceResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse"; value: Uint8Array; @@ -587,15 +512,6 @@ export interface MsgValsetUpdatedClaim { rewardToken: string; orchestrator: string; } -export interface ReactiveMsgValsetUpdatedClaim { - eventNonce: ComputedRef; - valsetNonce: ComputedRef; - blockHeight: ComputedRef; - members: ComputedRef; - rewardAmount: ComputedRef; - rewardToken: ComputedRef; - orchestrator: ComputedRef; -} export interface MsgValsetUpdatedClaimProtoMsg { typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaim"; value: Uint8Array; @@ -618,7 +534,6 @@ export interface MsgValsetUpdatedClaimAminoMsg { value: MsgValsetUpdatedClaimAmino; } export interface MsgValsetUpdatedClaimResponse {} -export interface ReactiveMsgValsetUpdatedClaimResponse {} export interface MsgValsetUpdatedClaimResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse"; value: Uint8Array; @@ -638,10 +553,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.peggy.v1.MsgUpdateParams"; value: Uint8Array; @@ -661,7 +572,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -681,10 +591,6 @@ export interface MsgBlacklistEthereumAddresses { /** Ethereum addresses to include in the blacklist */ blacklistAddresses: string[]; } -export interface ReactiveMsgBlacklistEthereumAddresses { - signer: ComputedRef; - blacklistAddresses: ComputedRef; -} export interface MsgBlacklistEthereumAddressesProtoMsg { typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddresses"; value: Uint8Array; @@ -708,7 +614,6 @@ export interface MsgBlacklistEthereumAddressesAminoMsg { * MsgBlacklistEthereumAddresses response type. */ export interface MsgBlacklistEthereumAddressesResponse {} -export interface ReactiveMsgBlacklistEthereumAddressesResponse {} export interface MsgBlacklistEthereumAddressesResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse"; value: Uint8Array; @@ -732,10 +637,6 @@ export interface MsgRevokeEthereumBlacklist { /** Ethereum addresses to include in the blacklist */ blacklistAddresses: string[]; } -export interface ReactiveMsgRevokeEthereumBlacklist { - signer: ComputedRef; - blacklistAddresses: ComputedRef; -} export interface MsgRevokeEthereumBlacklistProtoMsg { typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklist"; value: Uint8Array; @@ -759,7 +660,6 @@ export interface MsgRevokeEthereumBlacklistAminoMsg { * response type. */ export interface MsgRevokeEthereumBlacklistResponse {} -export interface ReactiveMsgRevokeEthereumBlacklistResponse {} export interface MsgRevokeEthereumBlacklistResponseProtoMsg { typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/params.ts b/libs/injective-vue/src/injective/peggy/v1/params.ts index 92b53a51..a4b4ddf1 100644 --- a/libs/injective-vue/src/injective/peggy/v1/params.ts +++ b/libs/injective-vue/src/injective/peggy/v1/params.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface Params { peggyId: string; contractSourceHash: string; @@ -27,30 +26,6 @@ export interface Params { valsetReward: Coin; admins: string[]; } -export interface ReactiveParams { - peggyId: ComputedRef; - contractSourceHash: ComputedRef; - bridgeEthereumAddress: ComputedRef; - bridgeChainId: ComputedRef; - signedValsetsWindow: ComputedRef; - signedBatchesWindow: ComputedRef; - signedClaimsWindow: ComputedRef; - targetBatchTimeout: ComputedRef; - averageBlockTime: ComputedRef; - averageEthereumBlockTime: ComputedRef; - slashFractionValset: ComputedRef; - slashFractionBatch: ComputedRef; - slashFractionClaim: ComputedRef; - slashFractionConflictingClaim: ComputedRef; - unbondSlashingValsetsWindow: ComputedRef; - slashFractionBadEthSignature: ComputedRef; - cosmosCoinDenom: ComputedRef; - cosmosCoinErc20Contract: ComputedRef; - claimSlashingEnabled: ComputedRef; - bridgeContractStartHeight: ComputedRef; - valsetReward: ComputedRef; - admins: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.peggy.v1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/pool.ts b/libs/injective-vue/src/injective/peggy/v1/pool.ts index 96d82c38..3b46adc4 100644 --- a/libs/injective-vue/src/injective/peggy/v1/pool.ts +++ b/libs/injective-vue/src/injective/peggy/v1/pool.ts @@ -1,14 +1,10 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** IDSet represents a set of IDs */ export interface IDSet { ids: bigint[]; } -export interface ReactiveIDSet { - ids: ComputedRef; -} export interface IDSetProtoMsg { typeUrl: "/injective.peggy.v1.IDSet"; value: Uint8Array; @@ -25,10 +21,6 @@ export interface BatchFees { token: string; totalFees: string; } -export interface ReactiveBatchFees { - token: ComputedRef; - totalFees: ComputedRef; -} export interface BatchFeesProtoMsg { typeUrl: "/injective.peggy.v1.BatchFees"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/proposal.ts b/libs/injective-vue/src/injective/peggy/v1/proposal.ts index a2f66734..cf60d937 100644 --- a/libs/injective-vue/src/injective/peggy/v1/proposal.ts +++ b/libs/injective-vue/src/injective/peggy/v1/proposal.ts @@ -1,17 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface BlacklistEthereumAddressesProposal { title: string; description: string; blacklistAddresses: string[]; } -export interface ReactiveBlacklistEthereumAddressesProposal { - title: ComputedRef; - description: ComputedRef; - blacklistAddresses: ComputedRef; -} export interface BlacklistEthereumAddressesProposalProtoMsg { typeUrl: "/injective.peggy.v1.BlacklistEthereumAddressesProposal"; value: Uint8Array; @@ -30,11 +24,6 @@ export interface RevokeEthereumBlacklistProposal { description: string; blacklistAddresses: string[]; } -export interface ReactiveRevokeEthereumBlacklistProposal { - title: ComputedRef; - description: ComputedRef; - blacklistAddresses: ComputedRef; -} export interface RevokeEthereumBlacklistProposalProtoMsg { typeUrl: "/injective.peggy.v1.RevokeEthereumBlacklistProposal"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/query.rpc.Query.ts b/libs/injective-vue/src/injective/peggy/v1/query.rpc.Query.ts deleted file mode 100644 index 8ccbef1d..00000000 --- a/libs/injective-vue/src/injective/peggy/v1/query.rpc.Query.ts +++ /dev/null @@ -1,864 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse, ReactiveQueryParamsRequest, ReactiveQueryCurrentValsetRequest, ReactiveQueryValsetRequestRequest, ReactiveQueryValsetConfirmRequest, ReactiveQueryValsetConfirmsByNonceRequest, ReactiveQueryLastValsetRequestsRequest, ReactiveQueryLastPendingValsetRequestByAddrRequest, ReactiveQueryLastEventByAddrRequest, ReactiveQueryBatchFeeRequest, ReactiveQueryOutgoingTxBatchesRequest, ReactiveQueryLastPendingBatchRequestByAddrRequest, ReactiveQueryBatchRequestByNonceRequest, ReactiveQueryBatchConfirmsRequest, ReactiveQueryERC20ToDenomRequest, ReactiveQueryDenomToERC20Request, ReactiveQueryModuleStateRequest } from "./query"; -/** Query defines the gRPC querier service */ -export interface Query { - /** Deployments queries deployments */ - params(request?: QueryParamsRequest): Promise; - /** valset */ - currentValset(request?: QueryCurrentValsetRequest): Promise; - valsetRequest(request: QueryValsetRequestRequest): Promise; - valsetConfirm(request: QueryValsetConfirmRequest): Promise; - valsetConfirmsByNonce(request: QueryValsetConfirmsByNonceRequest): Promise; - lastValsetRequests(request?: QueryLastValsetRequestsRequest): Promise; - lastPendingValsetRequestByAddr(request: QueryLastPendingValsetRequestByAddrRequest): Promise; - /** claim */ - lastEventByAddr(request: QueryLastEventByAddrRequest): Promise; - /** batch */ - getPendingSendToEth(request: QueryPendingSendToEth): Promise; - batchFees(request?: QueryBatchFeeRequest): Promise; - outgoingTxBatches(request?: QueryOutgoingTxBatchesRequest): Promise; - lastPendingBatchRequestByAddr(request: QueryLastPendingBatchRequestByAddrRequest): Promise; - batchRequestByNonce(request: QueryBatchRequestByNonceRequest): Promise; - batchConfirms(request: QueryBatchConfirmsRequest): Promise; - eRC20ToDenom(request: QueryERC20ToDenomRequest): Promise; - denomToERC20(request: QueryDenomToERC20Request): Promise; - getDelegateKeyByValidator(request: QueryDelegateKeysByValidatorAddress): Promise; - getDelegateKeyByEth(request: QueryDelegateKeysByEthAddress): Promise; - getDelegateKeyByOrchestrator(request: QueryDelegateKeysByOrchestratorAddress): Promise; - /** Retrieves the entire peggy module's state */ - peggyModuleState(request?: QueryModuleStateRequest): Promise; - missingPeggoNonces(request?: MissingNoncesRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Deployments queries deployments */ - params = async (request: QueryParamsRequest = {}): Promise => { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); - }; - /* valset */ - currentValset = async (request: QueryCurrentValsetRequest = {}): Promise => { - const data = QueryCurrentValsetRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "CurrentValset", data); - return promise.then(data => QueryCurrentValsetResponse.decode(new BinaryReader(data))); - }; - /* ValsetRequest */ - valsetRequest = async (request: QueryValsetRequestRequest): Promise => { - const data = QueryValsetRequestRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "ValsetRequest", data); - return promise.then(data => QueryValsetRequestResponse.decode(new BinaryReader(data))); - }; - /* ValsetConfirm */ - valsetConfirm = async (request: QueryValsetConfirmRequest): Promise => { - const data = QueryValsetConfirmRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "ValsetConfirm", data); - return promise.then(data => QueryValsetConfirmResponse.decode(new BinaryReader(data))); - }; - /* ValsetConfirmsByNonce */ - valsetConfirmsByNonce = async (request: QueryValsetConfirmsByNonceRequest): Promise => { - const data = QueryValsetConfirmsByNonceRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "ValsetConfirmsByNonce", data); - return promise.then(data => QueryValsetConfirmsByNonceResponse.decode(new BinaryReader(data))); - }; - /* LastValsetRequests */ - lastValsetRequests = async (request: QueryLastValsetRequestsRequest = {}): Promise => { - const data = QueryLastValsetRequestsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "LastValsetRequests", data); - return promise.then(data => QueryLastValsetRequestsResponse.decode(new BinaryReader(data))); - }; - /* LastPendingValsetRequestByAddr */ - lastPendingValsetRequestByAddr = async (request: QueryLastPendingValsetRequestByAddrRequest): Promise => { - const data = QueryLastPendingValsetRequestByAddrRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "LastPendingValsetRequestByAddr", data); - return promise.then(data => QueryLastPendingValsetRequestByAddrResponse.decode(new BinaryReader(data))); - }; - /* claim */ - lastEventByAddr = async (request: QueryLastEventByAddrRequest): Promise => { - const data = QueryLastEventByAddrRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "LastEventByAddr", data); - return promise.then(data => QueryLastEventByAddrResponse.decode(new BinaryReader(data))); - }; - /* batch */ - getPendingSendToEth = async (request: QueryPendingSendToEth): Promise => { - const data = QueryPendingSendToEth.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "GetPendingSendToEth", data); - return promise.then(data => QueryPendingSendToEthResponse.decode(new BinaryReader(data))); - }; - /* BatchFees */ - batchFees = async (request: QueryBatchFeeRequest = {}): Promise => { - const data = QueryBatchFeeRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "BatchFees", data); - return promise.then(data => QueryBatchFeeResponse.decode(new BinaryReader(data))); - }; - /* OutgoingTxBatches */ - outgoingTxBatches = async (request: QueryOutgoingTxBatchesRequest = {}): Promise => { - const data = QueryOutgoingTxBatchesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "OutgoingTxBatches", data); - return promise.then(data => QueryOutgoingTxBatchesResponse.decode(new BinaryReader(data))); - }; - /* LastPendingBatchRequestByAddr */ - lastPendingBatchRequestByAddr = async (request: QueryLastPendingBatchRequestByAddrRequest): Promise => { - const data = QueryLastPendingBatchRequestByAddrRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "LastPendingBatchRequestByAddr", data); - return promise.then(data => QueryLastPendingBatchRequestByAddrResponse.decode(new BinaryReader(data))); - }; - /* BatchRequestByNonce */ - batchRequestByNonce = async (request: QueryBatchRequestByNonceRequest): Promise => { - const data = QueryBatchRequestByNonceRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "BatchRequestByNonce", data); - return promise.then(data => QueryBatchRequestByNonceResponse.decode(new BinaryReader(data))); - }; - /* BatchConfirms */ - batchConfirms = async (request: QueryBatchConfirmsRequest): Promise => { - const data = QueryBatchConfirmsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "BatchConfirms", data); - return promise.then(data => QueryBatchConfirmsResponse.decode(new BinaryReader(data))); - }; - /* ERC20ToDenom */ - eRC20ToDenom = async (request: QueryERC20ToDenomRequest): Promise => { - const data = QueryERC20ToDenomRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "ERC20ToDenom", data); - return promise.then(data => QueryERC20ToDenomResponse.decode(new BinaryReader(data))); - }; - /* DenomToERC20 */ - denomToERC20 = async (request: QueryDenomToERC20Request): Promise => { - const data = QueryDenomToERC20Request.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "DenomToERC20", data); - return promise.then(data => QueryDenomToERC20Response.decode(new BinaryReader(data))); - }; - /* GetDelegateKeyByValidator */ - getDelegateKeyByValidator = async (request: QueryDelegateKeysByValidatorAddress): Promise => { - const data = QueryDelegateKeysByValidatorAddress.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "GetDelegateKeyByValidator", data); - return promise.then(data => QueryDelegateKeysByValidatorAddressResponse.decode(new BinaryReader(data))); - }; - /* GetDelegateKeyByEth */ - getDelegateKeyByEth = async (request: QueryDelegateKeysByEthAddress): Promise => { - const data = QueryDelegateKeysByEthAddress.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "GetDelegateKeyByEth", data); - return promise.then(data => QueryDelegateKeysByEthAddressResponse.decode(new BinaryReader(data))); - }; - /* GetDelegateKeyByOrchestrator */ - getDelegateKeyByOrchestrator = async (request: QueryDelegateKeysByOrchestratorAddress): Promise => { - const data = QueryDelegateKeysByOrchestratorAddress.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "GetDelegateKeyByOrchestrator", data); - return promise.then(data => QueryDelegateKeysByOrchestratorAddressResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire peggy module's state */ - peggyModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "PeggyModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; - /* MissingPeggoNonces */ - missingPeggoNonces = async (request: MissingNoncesRequest = {}): Promise => { - const data = MissingNoncesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.peggy.v1.Query", "MissingPeggoNonces", data); - return promise.then(data => MissingNoncesResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - currentValset(request?: QueryCurrentValsetRequest): Promise { - return queryService.currentValset(request); - }, - valsetRequest(request: QueryValsetRequestRequest): Promise { - return queryService.valsetRequest(request); - }, - valsetConfirm(request: QueryValsetConfirmRequest): Promise { - return queryService.valsetConfirm(request); - }, - valsetConfirmsByNonce(request: QueryValsetConfirmsByNonceRequest): Promise { - return queryService.valsetConfirmsByNonce(request); - }, - lastValsetRequests(request?: QueryLastValsetRequestsRequest): Promise { - return queryService.lastValsetRequests(request); - }, - lastPendingValsetRequestByAddr(request: QueryLastPendingValsetRequestByAddrRequest): Promise { - return queryService.lastPendingValsetRequestByAddr(request); - }, - lastEventByAddr(request: QueryLastEventByAddrRequest): Promise { - return queryService.lastEventByAddr(request); - }, - getPendingSendToEth(request: QueryPendingSendToEth): Promise { - return queryService.getPendingSendToEth(request); - }, - batchFees(request?: QueryBatchFeeRequest): Promise { - return queryService.batchFees(request); - }, - outgoingTxBatches(request?: QueryOutgoingTxBatchesRequest): Promise { - return queryService.outgoingTxBatches(request); - }, - lastPendingBatchRequestByAddr(request: QueryLastPendingBatchRequestByAddrRequest): Promise { - return queryService.lastPendingBatchRequestByAddr(request); - }, - batchRequestByNonce(request: QueryBatchRequestByNonceRequest): Promise { - return queryService.batchRequestByNonce(request); - }, - batchConfirms(request: QueryBatchConfirmsRequest): Promise { - return queryService.batchConfirms(request); - }, - eRC20ToDenom(request: QueryERC20ToDenomRequest): Promise { - return queryService.eRC20ToDenom(request); - }, - denomToERC20(request: QueryDenomToERC20Request): Promise { - return queryService.denomToERC20(request); - }, - getDelegateKeyByValidator(request: QueryDelegateKeysByValidatorAddress): Promise { - return queryService.getDelegateKeyByValidator(request); - }, - getDelegateKeyByEth(request: QueryDelegateKeysByEthAddress): Promise { - return queryService.getDelegateKeyByEth(request); - }, - getDelegateKeyByOrchestrator(request: QueryDelegateKeysByOrchestratorAddress): Promise { - return queryService.getDelegateKeyByOrchestrator(request); - }, - peggyModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.peggyModuleState(request); - }, - missingPeggoNonces(request?: MissingNoncesRequest): Promise { - return queryService.missingPeggoNonces(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseCurrentValsetQuery extends VueQueryParams { - request?: ReactiveQueryCurrentValsetRequest; -} -export interface UseValsetRequestQuery extends VueQueryParams { - request: ReactiveQueryValsetRequestRequest; -} -export interface UseValsetConfirmQuery extends VueQueryParams { - request: ReactiveQueryValsetConfirmRequest; -} -export interface UseValsetConfirmsByNonceQuery extends VueQueryParams { - request: ReactiveQueryValsetConfirmsByNonceRequest; -} -export interface UseLastValsetRequestsQuery extends VueQueryParams { - request?: ReactiveQueryLastValsetRequestsRequest; -} -export interface UseLastPendingValsetRequestByAddrQuery extends VueQueryParams { - request: ReactiveQueryLastPendingValsetRequestByAddrRequest; -} -export interface UseLastEventByAddrQuery extends VueQueryParams { - request: ReactiveQueryLastEventByAddrRequest; -} -export interface UseGetPendingSendToEthQuery extends VueQueryParams { - request: ReactiveQueryPendingSendToEth; -} -export interface UseBatchFeesQuery extends VueQueryParams { - request?: ReactiveQueryBatchFeeRequest; -} -export interface UseOutgoingTxBatchesQuery extends VueQueryParams { - request?: ReactiveQueryOutgoingTxBatchesRequest; -} -export interface UseLastPendingBatchRequestByAddrQuery extends VueQueryParams { - request: ReactiveQueryLastPendingBatchRequestByAddrRequest; -} -export interface UseBatchRequestByNonceQuery extends VueQueryParams { - request: ReactiveQueryBatchRequestByNonceRequest; -} -export interface UseBatchConfirmsQuery extends VueQueryParams { - request: ReactiveQueryBatchConfirmsRequest; -} -export interface UseERC20ToDenomQuery extends VueQueryParams { - request: ReactiveQueryERC20ToDenomRequest; -} -export interface UseDenomToERC20Query extends VueQueryParams { - request: ReactiveQueryDenomToERC20Request; -} -export interface UseGetDelegateKeyByValidatorQuery extends VueQueryParams { - request: ReactiveQueryDelegateKeysByValidatorAddress; -} -export interface UseGetDelegateKeyByEthQuery extends VueQueryParams { - request: ReactiveQueryDelegateKeysByEthAddress; -} -export interface UseGetDelegateKeyByOrchestratorQuery extends VueQueryParams { - request: ReactiveQueryDelegateKeysByOrchestratorAddress; -} -export interface UsePeggyModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export interface UseMissingPeggoNoncesQuery extends VueQueryParams { - request?: ReactiveMissingNoncesRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useCurrentValset = ({ - request, - options - }: UseCurrentValsetQuery) => { - const queryKey = ["currentValsetQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.currentValset(params); - }, - ...options - }); - }; - const useValsetRequest = ({ - request, - options - }: UseValsetRequestQuery) => { - const queryKey = ["valsetRequestQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.valsetRequest(params); - }, - ...options - }); - }; - const useValsetConfirm = ({ - request, - options - }: UseValsetConfirmQuery) => { - const queryKey = ["valsetConfirmQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.valsetConfirm(params); - }, - ...options - }); - }; - const useValsetConfirmsByNonce = ({ - request, - options - }: UseValsetConfirmsByNonceQuery) => { - const queryKey = ["valsetConfirmsByNonceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.valsetConfirmsByNonce(params); - }, - ...options - }); - }; - const useLastValsetRequests = ({ - request, - options - }: UseLastValsetRequestsQuery) => { - const queryKey = ["lastValsetRequestsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.lastValsetRequests(params); - }, - ...options - }); - }; - const useLastPendingValsetRequestByAddr = ({ - request, - options - }: UseLastPendingValsetRequestByAddrQuery) => { - const queryKey = ["lastPendingValsetRequestByAddrQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.lastPendingValsetRequestByAddr(params); - }, - ...options - }); - }; - const useLastEventByAddr = ({ - request, - options - }: UseLastEventByAddrQuery) => { - const queryKey = ["lastEventByAddrQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.lastEventByAddr(params); - }, - ...options - }); - }; - const useGetPendingSendToEth = ({ - request, - options - }: UseGetPendingSendToEthQuery) => { - const queryKey = ["getPendingSendToEthQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getPendingSendToEth(params); - }, - ...options - }); - }; - const useBatchFees = ({ - request, - options - }: UseBatchFeesQuery) => { - const queryKey = ["batchFeesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.batchFees(params); - }, - ...options - }); - }; - const useOutgoingTxBatches = ({ - request, - options - }: UseOutgoingTxBatchesQuery) => { - const queryKey = ["outgoingTxBatchesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.outgoingTxBatches(params); - }, - ...options - }); - }; - const useLastPendingBatchRequestByAddr = ({ - request, - options - }: UseLastPendingBatchRequestByAddrQuery) => { - const queryKey = ["lastPendingBatchRequestByAddrQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.lastPendingBatchRequestByAddr(params); - }, - ...options - }); - }; - const useBatchRequestByNonce = ({ - request, - options - }: UseBatchRequestByNonceQuery) => { - const queryKey = ["batchRequestByNonceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.batchRequestByNonce(params); - }, - ...options - }); - }; - const useBatchConfirms = ({ - request, - options - }: UseBatchConfirmsQuery) => { - const queryKey = ["batchConfirmsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.batchConfirms(params); - }, - ...options - }); - }; - const useERC20ToDenom = ({ - request, - options - }: UseERC20ToDenomQuery) => { - const queryKey = ["eRC20ToDenomQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.eRC20ToDenom(params); - }, - ...options - }); - }; - const useDenomToERC20 = ({ - request, - options - }: UseDenomToERC20Query) => { - const queryKey = ["denomToERC20Query", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomToERC20(params); - }, - ...options - }); - }; - const useGetDelegateKeyByValidator = ({ - request, - options - }: UseGetDelegateKeyByValidatorQuery) => { - const queryKey = ["getDelegateKeyByValidatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getDelegateKeyByValidator(params); - }, - ...options - }); - }; - const useGetDelegateKeyByEth = ({ - request, - options - }: UseGetDelegateKeyByEthQuery) => { - const queryKey = ["getDelegateKeyByEthQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getDelegateKeyByEth(params); - }, - ...options - }); - }; - const useGetDelegateKeyByOrchestrator = ({ - request, - options - }: UseGetDelegateKeyByOrchestratorQuery) => { - const queryKey = ["getDelegateKeyByOrchestratorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getDelegateKeyByOrchestrator(params); - }, - ...options - }); - }; - const usePeggyModuleState = ({ - request, - options - }: UsePeggyModuleStateQuery) => { - const queryKey = ["peggyModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.peggyModuleState(params); - }, - ...options - }); - }; - const useMissingPeggoNonces = ({ - request, - options - }: UseMissingPeggoNoncesQuery) => { - const queryKey = ["missingPeggoNoncesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.missingPeggoNonces(params); - }, - ...options - }); - }; - return { - /** Deployments queries deployments */useParams, - /** valset */useCurrentValset, - useValsetRequest, - useValsetConfirm, - useValsetConfirmsByNonce, - useLastValsetRequests, - useLastPendingValsetRequestByAddr, - /** claim */useLastEventByAddr, - /** batch */useGetPendingSendToEth, - useBatchFees, - useOutgoingTxBatches, - useLastPendingBatchRequestByAddr, - useBatchRequestByNonce, - useBatchConfirms, - useERC20ToDenom, - useDenomToERC20, - useGetDelegateKeyByValidator, - useGetDelegateKeyByEth, - useGetDelegateKeyByOrchestrator, - /** Retrieves the entire peggy module's state */usePeggyModuleState, - useMissingPeggoNonces - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/peggy/v1/query.rpc.func.ts b/libs/injective-vue/src/injective/peggy/v1/query.rpc.func.ts new file mode 100644 index 00000000..962ccf47 --- /dev/null +++ b/libs/injective-vue/src/injective/peggy/v1/query.rpc.func.ts @@ -0,0 +1,149 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.peggy.v1.Query", + method: "Params", + clientResolver +}); +export const createGetCurrentValset = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCurrentValsetRequest.encode, + decode: QueryCurrentValsetResponse.decode, + service: "injective.peggy.v1.Query", + method: "CurrentValset", + clientResolver +}); +export const createGetValsetRequest = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetRequestRequest.encode, + decode: QueryValsetRequestResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetRequest", + clientResolver +}); +export const createGetValsetConfirm = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetConfirmRequest.encode, + decode: QueryValsetConfirmResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetConfirm", + clientResolver +}); +export const createGetValsetConfirmsByNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetConfirmsByNonceRequest.encode, + decode: QueryValsetConfirmsByNonceResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetConfirmsByNonce", + clientResolver +}); +export const createGetLastValsetRequests = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastValsetRequestsRequest.encode, + decode: QueryLastValsetRequestsResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastValsetRequests", + clientResolver +}); +export const createGetLastPendingValsetRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastPendingValsetRequestByAddrRequest.encode, + decode: QueryLastPendingValsetRequestByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastPendingValsetRequestByAddr", + clientResolver +}); +export const createGetLastEventByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastEventByAddrRequest.encode, + decode: QueryLastEventByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastEventByAddr", + clientResolver +}); +export const createGetGetPendingSendToEth = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPendingSendToEth.encode, + decode: QueryPendingSendToEthResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetPendingSendToEth", + clientResolver +}); +export const createGetBatchFees = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchFeeRequest.encode, + decode: QueryBatchFeeResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchFees", + clientResolver +}); +export const createGetOutgoingTxBatches = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOutgoingTxBatchesRequest.encode, + decode: QueryOutgoingTxBatchesResponse.decode, + service: "injective.peggy.v1.Query", + method: "OutgoingTxBatches", + clientResolver +}); +export const createGetLastPendingBatchRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastPendingBatchRequestByAddrRequest.encode, + decode: QueryLastPendingBatchRequestByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastPendingBatchRequestByAddr", + clientResolver +}); +export const createGetBatchRequestByNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchRequestByNonceRequest.encode, + decode: QueryBatchRequestByNonceResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchRequestByNonce", + clientResolver +}); +export const createGetBatchConfirms = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchConfirmsRequest.encode, + decode: QueryBatchConfirmsResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchConfirms", + clientResolver +}); +export const createGetERC20ToDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryERC20ToDenomRequest.encode, + decode: QueryERC20ToDenomResponse.decode, + service: "injective.peggy.v1.Query", + method: "ERC20ToDenom", + clientResolver +}); +export const createGetDenomToERC20 = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomToERC20Request.encode, + decode: QueryDenomToERC20Response.decode, + service: "injective.peggy.v1.Query", + method: "DenomToERC20", + clientResolver +}); +export const createGetGetDelegateKeyByValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByValidatorAddress.encode, + decode: QueryDelegateKeysByValidatorAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByValidator", + clientResolver +}); +export const createGetGetDelegateKeyByEth = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByEthAddress.encode, + decode: QueryDelegateKeysByEthAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByEth", + clientResolver +}); +export const createGetGetDelegateKeyByOrchestrator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByOrchestratorAddress.encode, + decode: QueryDelegateKeysByOrchestratorAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByOrchestrator", + clientResolver +}); +export const createGetPeggyModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.peggy.v1.Query", + method: "PeggyModuleState", + clientResolver +}); +export const createGetMissingPeggoNonces = (clientResolver?: RpcResolver) => buildQuery({ + encode: MissingNoncesRequest.encode, + decode: MissingNoncesResponse.decode, + service: "injective.peggy.v1.Query", + method: "MissingPeggoNonces", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts b/libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts new file mode 100644 index 00000000..b0c4bc2c --- /dev/null +++ b/libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts @@ -0,0 +1,87 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; +import { createGetParams, createGetCurrentValset, createGetValsetRequest, createGetValsetConfirm, createGetValsetConfirmsByNonce, createGetLastValsetRequests, createGetLastPendingValsetRequestByAddr, createGetLastEventByAddr, createGetGetPendingSendToEth, createGetBatchFees, createGetOutgoingTxBatches, createGetLastPendingBatchRequestByAddr, createGetBatchRequestByNonce, createGetBatchConfirms, createGetERC20ToDenom, createGetDenomToERC20, createGetGetDelegateKeyByValidator, createGetGetDelegateKeyByEth, createGetGetDelegateKeyByOrchestrator, createGetPeggyModuleState, createGetMissingPeggoNonces } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetCurrentValset = buildUseVueQuery({ + builderQueryFn: createGetCurrentValset, + queryKeyPrefix: "CurrentValsetQuery" +}); +export const useGetValsetRequest = buildUseVueQuery({ + builderQueryFn: createGetValsetRequest, + queryKeyPrefix: "ValsetRequestQuery" +}); +export const useGetValsetConfirm = buildUseVueQuery({ + builderQueryFn: createGetValsetConfirm, + queryKeyPrefix: "ValsetConfirmQuery" +}); +export const useGetValsetConfirmsByNonce = buildUseVueQuery({ + builderQueryFn: createGetValsetConfirmsByNonce, + queryKeyPrefix: "ValsetConfirmsByNonceQuery" +}); +export const useGetLastValsetRequests = buildUseVueQuery({ + builderQueryFn: createGetLastValsetRequests, + queryKeyPrefix: "LastValsetRequestsQuery" +}); +export const useGetLastPendingValsetRequestByAddr = buildUseVueQuery({ + builderQueryFn: createGetLastPendingValsetRequestByAddr, + queryKeyPrefix: "LastPendingValsetRequestByAddrQuery" +}); +export const useGetLastEventByAddr = buildUseVueQuery({ + builderQueryFn: createGetLastEventByAddr, + queryKeyPrefix: "LastEventByAddrQuery" +}); +export const useGetGetPendingSendToEth = buildUseVueQuery({ + builderQueryFn: createGetGetPendingSendToEth, + queryKeyPrefix: "GetPendingSendToEthQuery" +}); +export const useGetBatchFees = buildUseVueQuery({ + builderQueryFn: createGetBatchFees, + queryKeyPrefix: "BatchFeesQuery" +}); +export const useGetOutgoingTxBatches = buildUseVueQuery({ + builderQueryFn: createGetOutgoingTxBatches, + queryKeyPrefix: "OutgoingTxBatchesQuery" +}); +export const useGetLastPendingBatchRequestByAddr = buildUseVueQuery({ + builderQueryFn: createGetLastPendingBatchRequestByAddr, + queryKeyPrefix: "LastPendingBatchRequestByAddrQuery" +}); +export const useGetBatchRequestByNonce = buildUseVueQuery({ + builderQueryFn: createGetBatchRequestByNonce, + queryKeyPrefix: "BatchRequestByNonceQuery" +}); +export const useGetBatchConfirms = buildUseVueQuery({ + builderQueryFn: createGetBatchConfirms, + queryKeyPrefix: "BatchConfirmsQuery" +}); +export const useGetERC20ToDenom = buildUseVueQuery({ + builderQueryFn: createGetERC20ToDenom, + queryKeyPrefix: "ERC20ToDenomQuery" +}); +export const useGetDenomToERC20 = buildUseVueQuery({ + builderQueryFn: createGetDenomToERC20, + queryKeyPrefix: "DenomToERC20Query" +}); +export const useGetGetDelegateKeyByValidator = buildUseVueQuery({ + builderQueryFn: createGetGetDelegateKeyByValidator, + queryKeyPrefix: "GetDelegateKeyByValidatorQuery" +}); +export const useGetGetDelegateKeyByEth = buildUseVueQuery({ + builderQueryFn: createGetGetDelegateKeyByEth, + queryKeyPrefix: "GetDelegateKeyByEthQuery" +}); +export const useGetGetDelegateKeyByOrchestrator = buildUseVueQuery({ + builderQueryFn: createGetGetDelegateKeyByOrchestrator, + queryKeyPrefix: "GetDelegateKeyByOrchestratorQuery" +}); +export const useGetPeggyModuleState = buildUseVueQuery({ + builderQueryFn: createGetPeggyModuleState, + queryKeyPrefix: "PeggyModuleStateQuery" +}); +export const useGetMissingPeggoNonces = buildUseVueQuery({ + builderQueryFn: createGetMissingPeggoNonces, + queryKeyPrefix: "MissingPeggoNoncesQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/peggy/v1/query.ts b/libs/injective-vue/src/injective/peggy/v1/query.ts index 51d38b56..f325d5d4 100644 --- a/libs/injective-vue/src/injective/peggy/v1/query.ts +++ b/libs/injective-vue/src/injective/peggy/v1/query.ts @@ -7,9 +7,7 @@ import { GenesisState, GenesisStateAmino } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryParamsRequest"; value: Uint8Array; @@ -22,9 +20,6 @@ export interface QueryParamsRequestAminoMsg { export interface QueryParamsResponse { params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryParamsResponse"; value: Uint8Array; @@ -37,7 +32,6 @@ export interface QueryParamsResponseAminoMsg { value: QueryParamsResponseAmino; } export interface QueryCurrentValsetRequest {} -export interface ReactiveQueryCurrentValsetRequest {} export interface QueryCurrentValsetRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryCurrentValsetRequest"; value: Uint8Array; @@ -50,9 +44,6 @@ export interface QueryCurrentValsetRequestAminoMsg { export interface QueryCurrentValsetResponse { valset?: Valset; } -export interface ReactiveQueryCurrentValsetResponse { - valset?: ComputedRef; -} export interface QueryCurrentValsetResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryCurrentValsetResponse"; value: Uint8Array; @@ -67,9 +58,6 @@ export interface QueryCurrentValsetResponseAminoMsg { export interface QueryValsetRequestRequest { nonce: bigint; } -export interface ReactiveQueryValsetRequestRequest { - nonce: ComputedRef; -} export interface QueryValsetRequestRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryValsetRequestRequest"; value: Uint8Array; @@ -84,9 +72,6 @@ export interface QueryValsetRequestRequestAminoMsg { export interface QueryValsetRequestResponse { valset?: Valset; } -export interface ReactiveQueryValsetRequestResponse { - valset?: ComputedRef; -} export interface QueryValsetRequestResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryValsetRequestResponse"; value: Uint8Array; @@ -102,10 +87,6 @@ export interface QueryValsetConfirmRequest { nonce: bigint; address: string; } -export interface ReactiveQueryValsetConfirmRequest { - nonce: ComputedRef; - address: ComputedRef; -} export interface QueryValsetConfirmRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryValsetConfirmRequest"; value: Uint8Array; @@ -121,9 +102,6 @@ export interface QueryValsetConfirmRequestAminoMsg { export interface QueryValsetConfirmResponse { confirm?: MsgValsetConfirm; } -export interface ReactiveQueryValsetConfirmResponse { - confirm?: ComputedRef; -} export interface QueryValsetConfirmResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryValsetConfirmResponse"; value: Uint8Array; @@ -138,9 +116,6 @@ export interface QueryValsetConfirmResponseAminoMsg { export interface QueryValsetConfirmsByNonceRequest { nonce: bigint; } -export interface ReactiveQueryValsetConfirmsByNonceRequest { - nonce: ComputedRef; -} export interface QueryValsetConfirmsByNonceRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest"; value: Uint8Array; @@ -155,9 +130,6 @@ export interface QueryValsetConfirmsByNonceRequestAminoMsg { export interface QueryValsetConfirmsByNonceResponse { confirms: MsgValsetConfirm[]; } -export interface ReactiveQueryValsetConfirmsByNonceResponse { - confirms: ComputedRef; -} export interface QueryValsetConfirmsByNonceResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse"; value: Uint8Array; @@ -170,7 +142,6 @@ export interface QueryValsetConfirmsByNonceResponseAminoMsg { value: QueryValsetConfirmsByNonceResponseAmino; } export interface QueryLastValsetRequestsRequest {} -export interface ReactiveQueryLastValsetRequestsRequest {} export interface QueryLastValsetRequestsRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsRequest"; value: Uint8Array; @@ -183,9 +154,6 @@ export interface QueryLastValsetRequestsRequestAminoMsg { export interface QueryLastValsetRequestsResponse { valsets: Valset[]; } -export interface ReactiveQueryLastValsetRequestsResponse { - valsets: ComputedRef; -} export interface QueryLastValsetRequestsResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsResponse"; value: Uint8Array; @@ -200,9 +168,6 @@ export interface QueryLastValsetRequestsResponseAminoMsg { export interface QueryLastPendingValsetRequestByAddrRequest { address: string; } -export interface ReactiveQueryLastPendingValsetRequestByAddrRequest { - address: ComputedRef; -} export interface QueryLastPendingValsetRequestByAddrRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest"; value: Uint8Array; @@ -217,9 +182,6 @@ export interface QueryLastPendingValsetRequestByAddrRequestAminoMsg { export interface QueryLastPendingValsetRequestByAddrResponse { valsets: Valset[]; } -export interface ReactiveQueryLastPendingValsetRequestByAddrResponse { - valsets: ComputedRef; -} export interface QueryLastPendingValsetRequestByAddrResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse"; value: Uint8Array; @@ -232,7 +194,6 @@ export interface QueryLastPendingValsetRequestByAddrResponseAminoMsg { value: QueryLastPendingValsetRequestByAddrResponseAmino; } export interface QueryBatchFeeRequest {} -export interface ReactiveQueryBatchFeeRequest {} export interface QueryBatchFeeRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryBatchFeeRequest"; value: Uint8Array; @@ -245,9 +206,6 @@ export interface QueryBatchFeeRequestAminoMsg { export interface QueryBatchFeeResponse { batchFees: BatchFees[]; } -export interface ReactiveQueryBatchFeeResponse { - batchFees: ComputedRef; -} export interface QueryBatchFeeResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryBatchFeeResponse"; value: Uint8Array; @@ -262,9 +220,6 @@ export interface QueryBatchFeeResponseAminoMsg { export interface QueryLastPendingBatchRequestByAddrRequest { address: string; } -export interface ReactiveQueryLastPendingBatchRequestByAddrRequest { - address: ComputedRef; -} export interface QueryLastPendingBatchRequestByAddrRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest"; value: Uint8Array; @@ -279,9 +234,6 @@ export interface QueryLastPendingBatchRequestByAddrRequestAminoMsg { export interface QueryLastPendingBatchRequestByAddrResponse { batch?: OutgoingTxBatch; } -export interface ReactiveQueryLastPendingBatchRequestByAddrResponse { - batch?: ComputedRef; -} export interface QueryLastPendingBatchRequestByAddrResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse"; value: Uint8Array; @@ -294,7 +246,6 @@ export interface QueryLastPendingBatchRequestByAddrResponseAminoMsg { value: QueryLastPendingBatchRequestByAddrResponseAmino; } export interface QueryOutgoingTxBatchesRequest {} -export interface ReactiveQueryOutgoingTxBatchesRequest {} export interface QueryOutgoingTxBatchesRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest"; value: Uint8Array; @@ -307,9 +258,6 @@ export interface QueryOutgoingTxBatchesRequestAminoMsg { export interface QueryOutgoingTxBatchesResponse { batches: OutgoingTxBatch[]; } -export interface ReactiveQueryOutgoingTxBatchesResponse { - batches: ComputedRef; -} export interface QueryOutgoingTxBatchesResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse"; value: Uint8Array; @@ -325,10 +273,6 @@ export interface QueryBatchRequestByNonceRequest { nonce: bigint; contractAddress: string; } -export interface ReactiveQueryBatchRequestByNonceRequest { - nonce: ComputedRef; - contractAddress: ComputedRef; -} export interface QueryBatchRequestByNonceRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceRequest"; value: Uint8Array; @@ -344,9 +288,6 @@ export interface QueryBatchRequestByNonceRequestAminoMsg { export interface QueryBatchRequestByNonceResponse { batch?: OutgoingTxBatch; } -export interface ReactiveQueryBatchRequestByNonceResponse { - batch?: ComputedRef; -} export interface QueryBatchRequestByNonceResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceResponse"; value: Uint8Array; @@ -362,10 +303,6 @@ export interface QueryBatchConfirmsRequest { nonce: bigint; contractAddress: string; } -export interface ReactiveQueryBatchConfirmsRequest { - nonce: ComputedRef; - contractAddress: ComputedRef; -} export interface QueryBatchConfirmsRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryBatchConfirmsRequest"; value: Uint8Array; @@ -381,9 +318,6 @@ export interface QueryBatchConfirmsRequestAminoMsg { export interface QueryBatchConfirmsResponse { confirms: MsgConfirmBatch[]; } -export interface ReactiveQueryBatchConfirmsResponse { - confirms: ComputedRef; -} export interface QueryBatchConfirmsResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryBatchConfirmsResponse"; value: Uint8Array; @@ -398,9 +332,6 @@ export interface QueryBatchConfirmsResponseAminoMsg { export interface QueryLastEventByAddrRequest { address: string; } -export interface ReactiveQueryLastEventByAddrRequest { - address: ComputedRef; -} export interface QueryLastEventByAddrRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastEventByAddrRequest"; value: Uint8Array; @@ -415,9 +346,6 @@ export interface QueryLastEventByAddrRequestAminoMsg { export interface QueryLastEventByAddrResponse { lastClaimEvent?: LastClaimEvent; } -export interface ReactiveQueryLastEventByAddrResponse { - lastClaimEvent?: ComputedRef; -} export interface QueryLastEventByAddrResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryLastEventByAddrResponse"; value: Uint8Array; @@ -432,9 +360,6 @@ export interface QueryLastEventByAddrResponseAminoMsg { export interface QueryERC20ToDenomRequest { erc20: string; } -export interface ReactiveQueryERC20ToDenomRequest { - erc20: ComputedRef; -} export interface QueryERC20ToDenomRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryERC20ToDenomRequest"; value: Uint8Array; @@ -450,10 +375,6 @@ export interface QueryERC20ToDenomResponse { denom: string; cosmosOriginated: boolean; } -export interface ReactiveQueryERC20ToDenomResponse { - denom: ComputedRef; - cosmosOriginated: ComputedRef; -} export interface QueryERC20ToDenomResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryERC20ToDenomResponse"; value: Uint8Array; @@ -469,9 +390,6 @@ export interface QueryERC20ToDenomResponseAminoMsg { export interface QueryDenomToERC20Request { denom: string; } -export interface ReactiveQueryDenomToERC20Request { - denom: ComputedRef; -} export interface QueryDenomToERC20RequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryDenomToERC20Request"; value: Uint8Array; @@ -487,10 +405,6 @@ export interface QueryDenomToERC20Response { erc20: string; cosmosOriginated: boolean; } -export interface ReactiveQueryDenomToERC20Response { - erc20: ComputedRef; - cosmosOriginated: ComputedRef; -} export interface QueryDenomToERC20ResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryDenomToERC20Response"; value: Uint8Array; @@ -506,9 +420,6 @@ export interface QueryDenomToERC20ResponseAminoMsg { export interface QueryDelegateKeysByValidatorAddress { validatorAddress: string; } -export interface ReactiveQueryDelegateKeysByValidatorAddress { - validatorAddress: ComputedRef; -} export interface QueryDelegateKeysByValidatorAddressProtoMsg { typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress"; value: Uint8Array; @@ -524,10 +435,6 @@ export interface QueryDelegateKeysByValidatorAddressResponse { ethAddress: string; orchestratorAddress: string; } -export interface ReactiveQueryDelegateKeysByValidatorAddressResponse { - ethAddress: ComputedRef; - orchestratorAddress: ComputedRef; -} export interface QueryDelegateKeysByValidatorAddressResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse"; value: Uint8Array; @@ -543,9 +450,6 @@ export interface QueryDelegateKeysByValidatorAddressResponseAminoMsg { export interface QueryDelegateKeysByEthAddress { ethAddress: string; } -export interface ReactiveQueryDelegateKeysByEthAddress { - ethAddress: ComputedRef; -} export interface QueryDelegateKeysByEthAddressProtoMsg { typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddress"; value: Uint8Array; @@ -561,10 +465,6 @@ export interface QueryDelegateKeysByEthAddressResponse { validatorAddress: string; orchestratorAddress: string; } -export interface ReactiveQueryDelegateKeysByEthAddressResponse { - validatorAddress: ComputedRef; - orchestratorAddress: ComputedRef; -} export interface QueryDelegateKeysByEthAddressResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse"; value: Uint8Array; @@ -580,9 +480,6 @@ export interface QueryDelegateKeysByEthAddressResponseAminoMsg { export interface QueryDelegateKeysByOrchestratorAddress { orchestratorAddress: string; } -export interface ReactiveQueryDelegateKeysByOrchestratorAddress { - orchestratorAddress: ComputedRef; -} export interface QueryDelegateKeysByOrchestratorAddressProtoMsg { typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress"; value: Uint8Array; @@ -598,10 +495,6 @@ export interface QueryDelegateKeysByOrchestratorAddressResponse { validatorAddress: string; ethAddress: string; } -export interface ReactiveQueryDelegateKeysByOrchestratorAddressResponse { - validatorAddress: ComputedRef; - ethAddress: ComputedRef; -} export interface QueryDelegateKeysByOrchestratorAddressResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse"; value: Uint8Array; @@ -617,9 +510,6 @@ export interface QueryDelegateKeysByOrchestratorAddressResponseAminoMsg { export interface QueryPendingSendToEth { senderAddress: string; } -export interface ReactiveQueryPendingSendToEth { - senderAddress: ComputedRef; -} export interface QueryPendingSendToEthProtoMsg { typeUrl: "/injective.peggy.v1.QueryPendingSendToEth"; value: Uint8Array; @@ -635,10 +525,6 @@ export interface QueryPendingSendToEthResponse { transfersInBatches: OutgoingTransferTx[]; unbatchedTransfers: OutgoingTransferTx[]; } -export interface ReactiveQueryPendingSendToEthResponse { - transfersInBatches: ComputedRef; - unbatchedTransfers: ComputedRef; -} export interface QueryPendingSendToEthResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryPendingSendToEthResponse"; value: Uint8Array; @@ -656,7 +542,6 @@ export interface QueryPendingSendToEthResponseAminoMsg { * RPC method. */ export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.peggy.v1.QueryModuleStateRequest"; value: Uint8Array; @@ -677,9 +562,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.peggy.v1.QueryModuleStateResponse"; value: Uint8Array; @@ -696,7 +578,6 @@ export interface QueryModuleStateResponseAminoMsg { value: QueryModuleStateResponseAmino; } export interface MissingNoncesRequest {} -export interface ReactiveMissingNoncesRequest {} export interface MissingNoncesRequestProtoMsg { typeUrl: "/injective.peggy.v1.MissingNoncesRequest"; value: Uint8Array; @@ -709,9 +590,6 @@ export interface MissingNoncesRequestAminoMsg { export interface MissingNoncesResponse { operatorAddresses: string[]; } -export interface ReactiveMissingNoncesResponse { - operatorAddresses: ComputedRef; -} export interface MissingNoncesResponseProtoMsg { typeUrl: "/injective.peggy.v1.MissingNoncesResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/peggy/v1/types.ts b/libs/injective-vue/src/injective/peggy/v1/types.ts index 3ab8ae9b..37fbe06a 100644 --- a/libs/injective-vue/src/injective/peggy/v1/types.ts +++ b/libs/injective-vue/src/injective/peggy/v1/types.ts @@ -1,16 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** BridgeValidator represents a validator's ETH address and its power */ export interface BridgeValidator { power: bigint; ethereumAddress: string; } -export interface ReactiveBridgeValidator { - power: ComputedRef; - ethereumAddress: ComputedRef; -} export interface BridgeValidatorProtoMsg { typeUrl: "/injective.peggy.v1.BridgeValidator"; value: Uint8Array; @@ -37,13 +32,6 @@ export interface Valset { /** the reward token in it's Ethereum hex address representation */ rewardToken: string; } -export interface ReactiveValset { - nonce: ComputedRef; - members: ComputedRef; - height: ComputedRef; - rewardAmount: ComputedRef; - rewardToken: ComputedRef; -} export interface ValsetProtoMsg { typeUrl: "/injective.peggy.v1.Valset"; value: Uint8Array; @@ -76,10 +64,6 @@ export interface LastObservedEthereumBlockHeight { cosmosBlockHeight: bigint; ethereumBlockHeight: bigint; } -export interface ReactiveLastObservedEthereumBlockHeight { - cosmosBlockHeight: ComputedRef; - ethereumBlockHeight: ComputedRef; -} export interface LastObservedEthereumBlockHeightProtoMsg { typeUrl: "/injective.peggy.v1.LastObservedEthereumBlockHeight"; value: Uint8Array; @@ -104,10 +88,6 @@ export interface LastClaimEvent { ethereumEventNonce: bigint; ethereumEventHeight: bigint; } -export interface ReactiveLastClaimEvent { - ethereumEventNonce: ComputedRef; - ethereumEventHeight: ComputedRef; -} export interface LastClaimEventProtoMsg { typeUrl: "/injective.peggy.v1.LastClaimEvent"; value: Uint8Array; @@ -129,10 +109,6 @@ export interface ERC20ToDenom { erc20: string; denom: string; } -export interface ReactiveERC20ToDenom { - erc20: ComputedRef; - denom: ComputedRef; -} export interface ERC20ToDenomProtoMsg { typeUrl: "/injective.peggy.v1.ERC20ToDenom"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/events.ts b/libs/injective-vue/src/injective/permissions/v1beta1/events.ts index bc4b15c1..06e5bb8d 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/events.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/events.ts @@ -2,15 +2,10 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface EventSetVoucher { addr: string; voucher: Coin; } -export interface ReactiveEventSetVoucher { - addr: ComputedRef; - voucher: ComputedRef; -} export interface EventSetVoucherProtoMsg { typeUrl: "/injective.permissions.v1beta1.EventSetVoucher"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/genesis.ts b/libs/injective-vue/src/injective/permissions/v1beta1/genesis.ts index 3cc6f49e..a78ac2db 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/genesis.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/genesis.ts @@ -3,17 +3,12 @@ import { Namespace, NamespaceAmino } from "./permissions"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the permissions module's genesis state. */ export interface GenesisState { /** params defines the parameters of the module. */ params: Params; namespaces: Namespace[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - namespaces: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.permissions.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/params.ts b/libs/injective-vue/src/injective/permissions/v1beta1/params.ts index e10e681e..24aa6bb5 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/params.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/params.ts @@ -1,14 +1,10 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Params defines the parameters for the permissions module. */ export interface Params { wasmHookQueryMaxGas: bigint; } -export interface ReactiveParams { - wasmHookQueryMaxGas: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.permissions.v1beta1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/permissions.ts b/libs/injective-vue/src/injective/permissions/v1beta1/permissions.ts index e8993ed8..6cd42f27 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/permissions.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/permissions.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** each Action enum value should be a power of two */ export enum Action { UNSPECIFIED = 0, @@ -60,15 +59,6 @@ export interface Namespace { rolePermissions: Role[]; addressRoles: AddressRoles[]; } -export interface ReactiveNamespace { - denom: ComputedRef; - wasmHook: ComputedRef; - mintsPaused: ComputedRef; - sendsPaused: ComputedRef; - burnsPaused: ComputedRef; - rolePermissions: ComputedRef; - addressRoles: ComputedRef; -} export interface NamespaceProtoMsg { typeUrl: "/injective.permissions.v1beta1.Namespace"; value: Uint8Array; @@ -94,10 +84,6 @@ export interface AddressRoles { address: string; roles: string[]; } -export interface ReactiveAddressRoles { - address: ComputedRef; - roles: ComputedRef; -} export interface AddressRolesProtoMsg { typeUrl: "/injective.permissions.v1beta1.AddressRoles"; value: Uint8Array; @@ -115,10 +101,6 @@ export interface Role { role: string; permissions: number; } -export interface ReactiveRole { - role: ComputedRef; - permissions: ComputedRef; -} export interface RoleProtoMsg { typeUrl: "/injective.permissions.v1beta1.Role"; value: Uint8Array; @@ -136,9 +118,6 @@ export interface RoleAminoMsg { export interface RoleIDs { roleIds: number[]; } -export interface ReactiveRoleIDs { - roleIds: ComputedRef; -} export interface RoleIDsProtoMsg { typeUrl: "/injective.permissions.v1beta1.RoleIDs"; value: Uint8Array; @@ -154,9 +133,6 @@ export interface RoleIDsAminoMsg { export interface Voucher { coins: Coin[]; } -export interface ReactiveVoucher { - coins: ComputedRef; -} export interface VoucherProtoMsg { typeUrl: "/injective.permissions.v1beta1.Voucher"; value: Uint8Array; @@ -172,10 +148,6 @@ export interface AddressVoucher { address: string; voucher?: Voucher; } -export interface ReactiveAddressVoucher { - address: ComputedRef; - voucher?: ComputedRef; -} export interface AddressVoucherProtoMsg { typeUrl: "/injective.permissions.v1beta1.AddressVoucher"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.Query.ts deleted file mode 100644 index fd44ab66..00000000 --- a/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,331 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse, ReactiveQueryParamsRequest, ReactiveQueryAllNamespacesRequest, ReactiveQueryNamespaceByDenomRequest, ReactiveQueryAddressRolesRequest, ReactiveQueryAddressesByRoleRequest, ReactiveQueryVouchersForAddressRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Params defines a gRPC query method that returns the permissions module's - * parameters. - */ - params(request?: QueryParamsRequest): Promise; - /** - * AllNamespaces defines a gRPC query method that returns the permissions - * module's created namespaces. - */ - allNamespaces(request?: QueryAllNamespacesRequest): Promise; - /** - * NamespaceByDenom defines a gRPC query method that returns the permissions - * module's namespace associated with the provided denom. - */ - namespaceByDenom(request: QueryNamespaceByDenomRequest): Promise; - /** - * AddressRoles defines a gRPC query method that returns address roles in the - * namespace - */ - addressRoles(request: QueryAddressRolesRequest): Promise; - /** - * AddressesByRole defines a gRPC query method that returns a namespace's - * roles associated with the provided address. - */ - addressesByRole(request: QueryAddressesByRoleRequest): Promise; - /** - * VouchersForAddress defines a gRPC query method that returns a map of - * vouchers that are held by permissions module for this address, keyed by the - * originator address - */ - vouchersForAddress(request: QueryVouchersForAddressRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params defines a gRPC query method that returns the permissions module's - parameters. */ - params = async (request: QueryParamsRequest = {}): Promise => { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); - }; - /* AllNamespaces defines a gRPC query method that returns the permissions - module's created namespaces. */ - allNamespaces = async (request: QueryAllNamespacesRequest = {}): Promise => { - const data = QueryAllNamespacesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Query", "AllNamespaces", data); - return promise.then(data => QueryAllNamespacesResponse.decode(new BinaryReader(data))); - }; - /* NamespaceByDenom defines a gRPC query method that returns the permissions - module's namespace associated with the provided denom. */ - namespaceByDenom = async (request: QueryNamespaceByDenomRequest): Promise => { - const data = QueryNamespaceByDenomRequest.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Query", "NamespaceByDenom", data); - return promise.then(data => QueryNamespaceByDenomResponse.decode(new BinaryReader(data))); - }; - /* AddressRoles defines a gRPC query method that returns address roles in the - namespace */ - addressRoles = async (request: QueryAddressRolesRequest): Promise => { - const data = QueryAddressRolesRequest.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Query", "AddressRoles", data); - return promise.then(data => QueryAddressRolesResponse.decode(new BinaryReader(data))); - }; - /* AddressesByRole defines a gRPC query method that returns a namespace's - roles associated with the provided address. */ - addressesByRole = async (request: QueryAddressesByRoleRequest): Promise => { - const data = QueryAddressesByRoleRequest.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Query", "AddressesByRole", data); - return promise.then(data => QueryAddressesByRoleResponse.decode(new BinaryReader(data))); - }; - /* VouchersForAddress defines a gRPC query method that returns a map of - vouchers that are held by permissions module for this address, keyed by the - originator address */ - vouchersForAddress = async (request: QueryVouchersForAddressRequest): Promise => { - const data = QueryVouchersForAddressRequest.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Query", "VouchersForAddress", data); - return promise.then(data => QueryVouchersForAddressResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - allNamespaces(request?: QueryAllNamespacesRequest): Promise { - return queryService.allNamespaces(request); - }, - namespaceByDenom(request: QueryNamespaceByDenomRequest): Promise { - return queryService.namespaceByDenom(request); - }, - addressRoles(request: QueryAddressRolesRequest): Promise { - return queryService.addressRoles(request); - }, - addressesByRole(request: QueryAddressesByRoleRequest): Promise { - return queryService.addressesByRole(request); - }, - vouchersForAddress(request: QueryVouchersForAddressRequest): Promise { - return queryService.vouchersForAddress(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseAllNamespacesQuery extends VueQueryParams { - request?: ReactiveQueryAllNamespacesRequest; -} -export interface UseNamespaceByDenomQuery extends VueQueryParams { - request: ReactiveQueryNamespaceByDenomRequest; -} -export interface UseAddressRolesQuery extends VueQueryParams { - request: ReactiveQueryAddressRolesRequest; -} -export interface UseAddressesByRoleQuery extends VueQueryParams { - request: ReactiveQueryAddressesByRoleRequest; -} -export interface UseVouchersForAddressQuery extends VueQueryParams { - request: ReactiveQueryVouchersForAddressRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useAllNamespaces = ({ - request, - options - }: UseAllNamespacesQuery) => { - const queryKey = ["allNamespacesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allNamespaces(params); - }, - ...options - }); - }; - const useNamespaceByDenom = ({ - request, - options - }: UseNamespaceByDenomQuery) => { - const queryKey = ["namespaceByDenomQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.namespaceByDenom(params); - }, - ...options - }); - }; - const useAddressRoles = ({ - request, - options - }: UseAddressRolesQuery) => { - const queryKey = ["addressRolesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.addressRoles(params); - }, - ...options - }); - }; - const useAddressesByRole = ({ - request, - options - }: UseAddressesByRoleQuery) => { - const queryKey = ["addressesByRoleQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.addressesByRole(params); - }, - ...options - }); - }; - const useVouchersForAddress = ({ - request, - options - }: UseVouchersForAddressQuery) => { - const queryKey = ["vouchersForAddressQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.vouchersForAddress(params); - }, - ...options - }); - }; - return { - /** - * Params defines a gRPC query method that returns the permissions module's - * parameters. - */ - useParams, - /** - * AllNamespaces defines a gRPC query method that returns the permissions - * module's created namespaces. - */ - useAllNamespaces, - /** - * NamespaceByDenom defines a gRPC query method that returns the permissions - * module's namespace associated with the provided denom. - */ - useNamespaceByDenom, - /** - * AddressRoles defines a gRPC query method that returns address roles in the - * namespace - */ - useAddressRoles, - /** - * AddressesByRole defines a gRPC query method that returns a namespace's - * roles associated with the provided address. - */ - useAddressesByRole, - /** - * VouchersForAddress defines a gRPC query method that returns a map of - * vouchers that are held by permissions module for this address, keyed by the - * originator address - */ - useVouchersForAddress - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..364cc281 --- /dev/null +++ b/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.func.ts @@ -0,0 +1,44 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetAllNamespaces = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllNamespacesRequest.encode, + decode: QueryAllNamespacesResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AllNamespaces", + clientResolver +}); +export const createGetNamespaceByDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryNamespaceByDenomRequest.encode, + decode: QueryNamespaceByDenomResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "NamespaceByDenom", + clientResolver +}); +export const createGetAddressRoles = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAddressRolesRequest.encode, + decode: QueryAddressRolesResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AddressRoles", + clientResolver +}); +export const createGetAddressesByRole = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAddressesByRoleRequest.encode, + decode: QueryAddressesByRoleResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AddressesByRole", + clientResolver +}); +export const createGetVouchersForAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVouchersForAddressRequest.encode, + decode: QueryVouchersForAddressResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "VouchersForAddress", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..98862317 --- /dev/null +++ b/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts @@ -0,0 +1,27 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; +import { createGetParams, createGetAllNamespaces, createGetNamespaceByDenom, createGetAddressRoles, createGetAddressesByRole, createGetVouchersForAddress } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetAllNamespaces = buildUseVueQuery({ + builderQueryFn: createGetAllNamespaces, + queryKeyPrefix: "AllNamespacesQuery" +}); +export const useGetNamespaceByDenom = buildUseVueQuery({ + builderQueryFn: createGetNamespaceByDenom, + queryKeyPrefix: "NamespaceByDenomQuery" +}); +export const useGetAddressRoles = buildUseVueQuery({ + builderQueryFn: createGetAddressRoles, + queryKeyPrefix: "AddressRolesQuery" +}); +export const useGetAddressesByRole = buildUseVueQuery({ + builderQueryFn: createGetAddressesByRole, + queryKeyPrefix: "AddressesByRoleQuery" +}); +export const useGetVouchersForAddress = buildUseVueQuery({ + builderQueryFn: createGetVouchersForAddress, + queryKeyPrefix: "VouchersForAddressQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/query.ts b/libs/injective-vue/src/injective/permissions/v1beta1/query.ts index fc197454..adce6867 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/query.ts @@ -4,10 +4,8 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -23,9 +21,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -44,7 +39,6 @@ export interface QueryParamsResponseAminoMsg { * method. */ export interface QueryAllNamespacesRequest {} -export interface ReactiveQueryAllNamespacesRequest {} export interface QueryAllNamespacesRequestProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesRequest"; value: Uint8Array; @@ -65,9 +59,6 @@ export interface QueryAllNamespacesRequestAminoMsg { export interface QueryAllNamespacesResponse { namespaces: Namespace[]; } -export interface ReactiveQueryAllNamespacesResponse { - namespaces: ComputedRef; -} export interface QueryAllNamespacesResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesResponse"; value: Uint8Array; @@ -91,10 +82,6 @@ export interface QueryNamespaceByDenomRequest { denom: string; includeRoles: boolean; } -export interface ReactiveQueryNamespaceByDenomRequest { - denom: ComputedRef; - includeRoles: ComputedRef; -} export interface QueryNamespaceByDenomRequestProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest"; value: Uint8Array; @@ -118,9 +105,6 @@ export interface QueryNamespaceByDenomRequestAminoMsg { export interface QueryNamespaceByDenomResponse { namespace?: Namespace; } -export interface ReactiveQueryNamespaceByDenomResponse { - namespace?: ComputedRef; -} export interface QueryNamespaceByDenomResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse"; value: Uint8Array; @@ -144,10 +128,6 @@ export interface QueryAddressesByRoleRequest { denom: string; role: string; } -export interface ReactiveQueryAddressesByRoleRequest { - denom: ComputedRef; - role: ComputedRef; -} export interface QueryAddressesByRoleRequestProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest"; value: Uint8Array; @@ -171,9 +151,6 @@ export interface QueryAddressesByRoleRequestAminoMsg { export interface QueryAddressesByRoleResponse { addresses: string[]; } -export interface ReactiveQueryAddressesByRoleResponse { - addresses: ComputedRef; -} export interface QueryAddressesByRoleResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse"; value: Uint8Array; @@ -193,10 +170,6 @@ export interface QueryAddressRolesRequest { denom: string; address: string; } -export interface ReactiveQueryAddressRolesRequest { - denom: ComputedRef; - address: ComputedRef; -} export interface QueryAddressRolesRequestProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesRequest"; value: Uint8Array; @@ -212,9 +185,6 @@ export interface QueryAddressRolesRequestAminoMsg { export interface QueryAddressRolesResponse { roles: string[]; } -export interface ReactiveQueryAddressRolesResponse { - roles: ComputedRef; -} export interface QueryAddressRolesResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesResponse"; value: Uint8Array; @@ -229,9 +199,6 @@ export interface QueryAddressRolesResponseAminoMsg { export interface QueryVouchersForAddressRequest { address: string; } -export interface ReactiveQueryVouchersForAddressRequest { - address: ComputedRef; -} export interface QueryVouchersForAddressRequestProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest"; value: Uint8Array; @@ -246,9 +213,6 @@ export interface QueryVouchersForAddressRequestAminoMsg { export interface QueryVouchersForAddressResponse { vouchers: Coin[]; } -export interface ReactiveQueryVouchersForAddressResponse { - vouchers: ComputedRef; -} export interface QueryVouchersForAddressResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/tx.amino.ts b/libs/injective-vue/src/injective/permissions/v1beta1/tx.amino.ts deleted file mode 100644 index e02f3f51..00000000 --- a/libs/injective-vue/src/injective/permissions/v1beta1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; -export const AminoConverter = { - "/injective.permissions.v1beta1.MsgUpdateParams": { - aminoType: "permissions/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/injective.permissions.v1beta1.MsgCreateNamespace": { - aminoType: "permissions/MsgCreateNamespace", - toAmino: MsgCreateNamespace.toAmino, - fromAmino: MsgCreateNamespace.fromAmino - }, - "/injective.permissions.v1beta1.MsgDeleteNamespace": { - aminoType: "permissions/MsgDeleteNamespace", - toAmino: MsgDeleteNamespace.toAmino, - fromAmino: MsgDeleteNamespace.fromAmino - }, - "/injective.permissions.v1beta1.MsgUpdateNamespace": { - aminoType: "permissions/MsgUpdateNamespace", - toAmino: MsgUpdateNamespace.toAmino, - fromAmino: MsgUpdateNamespace.fromAmino - }, - "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles": { - aminoType: "permissions/MsgUpdateNamespaceRoles", - toAmino: MsgUpdateNamespaceRoles.toAmino, - fromAmino: MsgUpdateNamespaceRoles.fromAmino - }, - "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles": { - aminoType: "permissions/MsgRevokeNamespaceRoles", - toAmino: MsgRevokeNamespaceRoles.toAmino, - fromAmino: MsgRevokeNamespaceRoles.fromAmino - }, - "/injective.permissions.v1beta1.MsgClaimVoucher": { - aminoType: "permissions/MsgClaimVoucher", - toAmino: MsgClaimVoucher.toAmino, - fromAmino: MsgClaimVoucher.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..7f8a521e --- /dev/null +++ b/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCreateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateNamespace.typeUrl, + encoders: toEncoders(MsgCreateNamespace), + converters: toConverters(MsgCreateNamespace) +}); +export const createDeleteNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeleteNamespace.typeUrl, + encoders: toEncoders(MsgDeleteNamespace), + converters: toConverters(MsgDeleteNamespace) +}); +export const createUpdateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateNamespace.typeUrl, + encoders: toEncoders(MsgUpdateNamespace), + converters: toConverters(MsgUpdateNamespace) +}); +export const createUpdateNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateNamespaceRoles.typeUrl, + encoders: toEncoders(MsgUpdateNamespaceRoles), + converters: toConverters(MsgUpdateNamespaceRoles) +}); +export const createRevokeNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeNamespaceRoles.typeUrl, + encoders: toEncoders(MsgRevokeNamespaceRoles), + converters: toConverters(MsgRevokeNamespaceRoles) +}); +export const createClaimVoucher = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgClaimVoucher.typeUrl, + encoders: toEncoders(MsgClaimVoucher), + converters: toConverters(MsgClaimVoucher) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 8de8e3ce..00000000 --- a/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgUpdateParams, MsgUpdateParamsResponse, MsgCreateNamespace, MsgCreateNamespaceResponse, MsgDeleteNamespace, MsgDeleteNamespaceResponse, MsgUpdateNamespace, MsgUpdateNamespaceResponse, MsgUpdateNamespaceRoles, MsgUpdateNamespaceRolesResponse, MsgRevokeNamespaceRoles, MsgRevokeNamespaceRolesResponse, MsgClaimVoucher, MsgClaimVoucherResponse } from "./tx"; -/** Msg defines the permissions module's gRPC message service. */ -export interface Msg { - updateParams(request: MsgUpdateParams): Promise; - createNamespace(request: MsgCreateNamespace): Promise; - deleteNamespace(request: MsgDeleteNamespace): Promise; - updateNamespace(request: MsgUpdateNamespace): Promise; - updateNamespaceRoles(request: MsgUpdateNamespaceRoles): Promise; - revokeNamespaceRoles(request: MsgRevokeNamespaceRoles): Promise; - claimVoucher(request: MsgClaimVoucher): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; - /* CreateNamespace */ - createNamespace = async (request: MsgCreateNamespace): Promise => { - const data = MsgCreateNamespace.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Msg", "CreateNamespace", data); - return promise.then(data => MsgCreateNamespaceResponse.decode(new BinaryReader(data))); - }; - /* DeleteNamespace */ - deleteNamespace = async (request: MsgDeleteNamespace): Promise => { - const data = MsgDeleteNamespace.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Msg", "DeleteNamespace", data); - return promise.then(data => MsgDeleteNamespaceResponse.decode(new BinaryReader(data))); - }; - /* UpdateNamespace */ - updateNamespace = async (request: MsgUpdateNamespace): Promise => { - const data = MsgUpdateNamespace.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Msg", "UpdateNamespace", data); - return promise.then(data => MsgUpdateNamespaceResponse.decode(new BinaryReader(data))); - }; - /* UpdateNamespaceRoles */ - updateNamespaceRoles = async (request: MsgUpdateNamespaceRoles): Promise => { - const data = MsgUpdateNamespaceRoles.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Msg", "UpdateNamespaceRoles", data); - return promise.then(data => MsgUpdateNamespaceRolesResponse.decode(new BinaryReader(data))); - }; - /* RevokeNamespaceRoles */ - revokeNamespaceRoles = async (request: MsgRevokeNamespaceRoles): Promise => { - const data = MsgRevokeNamespaceRoles.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Msg", "RevokeNamespaceRoles", data); - return promise.then(data => MsgRevokeNamespaceRolesResponse.decode(new BinaryReader(data))); - }; - /* ClaimVoucher */ - claimVoucher = async (request: MsgClaimVoucher): Promise => { - const data = MsgClaimVoucher.encode(request).finish(); - const promise = this.rpc.request("injective.permissions.v1beta1.Msg", "ClaimVoucher", data); - return promise.then(data => MsgClaimVoucherResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..e4723ee6 --- /dev/null +++ b/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; +import { createUpdateParams, createCreateNamespace, createDeleteNamespace, createUpdateNamespace, createUpdateNamespaceRoles, createRevokeNamespaceRoles, createClaimVoucher } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useCreateNamespace = buildUseVueMutation({ + builderMutationFn: createCreateNamespace +}); +export const useDeleteNamespace = buildUseVueMutation({ + builderMutationFn: createDeleteNamespace +}); +export const useUpdateNamespace = buildUseVueMutation({ + builderMutationFn: createUpdateNamespace +}); +export const useUpdateNamespaceRoles = buildUseVueMutation({ + builderMutationFn: createUpdateNamespaceRoles +}); +export const useRevokeNamespaceRoles = buildUseVueMutation({ + builderMutationFn: createRevokeNamespaceRoles +}); +export const useClaimVoucher = buildUseVueMutation({ + builderMutationFn: createClaimVoucher +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/tx.ts b/libs/injective-vue/src/injective/permissions/v1beta1/tx.ts index 068d2cc9..7fb20368 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/tx.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Namespace, NamespaceAmino, Role, RoleAmino, AddressRoles, AddressRolesA import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface MsgUpdateParams { /** authority is the address of the governance account. */ authority: string; @@ -14,10 +13,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -37,7 +32,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -51,10 +45,6 @@ export interface MsgCreateNamespace { sender: string; namespace: Namespace; } -export interface ReactiveMsgCreateNamespace { - sender: ComputedRef; - namespace: ComputedRef; -} export interface MsgCreateNamespaceProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespace"; value: Uint8Array; @@ -68,7 +58,6 @@ export interface MsgCreateNamespaceAminoMsg { value: MsgCreateNamespaceAmino; } export interface MsgCreateNamespaceResponse {} -export interface ReactiveMsgCreateNamespaceResponse {} export interface MsgCreateNamespaceResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse"; value: Uint8Array; @@ -82,10 +71,6 @@ export interface MsgDeleteNamespace { sender: string; namespaceDenom: string; } -export interface ReactiveMsgDeleteNamespace { - sender: ComputedRef; - namespaceDenom: ComputedRef; -} export interface MsgDeleteNamespaceProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespace"; value: Uint8Array; @@ -99,7 +84,6 @@ export interface MsgDeleteNamespaceAminoMsg { value: MsgDeleteNamespaceAmino; } export interface MsgDeleteNamespaceResponse {} -export interface ReactiveMsgDeleteNamespaceResponse {} export interface MsgDeleteNamespaceResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse"; value: Uint8Array; @@ -119,14 +103,6 @@ export interface MsgUpdateNamespace { sendsPaused?: MsgUpdateNamespace_MsgSetSendsPaused; burnsPaused?: MsgUpdateNamespace_MsgSetBurnsPaused; } -export interface ReactiveMsgUpdateNamespace { - sender: ComputedRef; - namespaceDenom: ComputedRef; - wasmHook?: ComputedRef; - mintsPaused?: ComputedRef; - sendsPaused?: ComputedRef; - burnsPaused?: ComputedRef; -} export interface MsgUpdateNamespaceProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespace"; value: Uint8Array; @@ -148,9 +124,6 @@ export interface MsgUpdateNamespaceAminoMsg { export interface MsgUpdateNamespace_MsgSetWasmHook { newValue: string; } -export interface ReactiveMsgUpdateNamespace_MsgSetWasmHook { - newValue: ComputedRef; -} export interface MsgUpdateNamespace_MsgSetWasmHookProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgSetWasmHook"; value: Uint8Array; @@ -165,9 +138,6 @@ export interface MsgUpdateNamespace_MsgSetWasmHookAminoMsg { export interface MsgUpdateNamespace_MsgSetMintsPaused { newValue: boolean; } -export interface ReactiveMsgUpdateNamespace_MsgSetMintsPaused { - newValue: ComputedRef; -} export interface MsgUpdateNamespace_MsgSetMintsPausedProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgSetMintsPaused"; value: Uint8Array; @@ -182,9 +152,6 @@ export interface MsgUpdateNamespace_MsgSetMintsPausedAminoMsg { export interface MsgUpdateNamespace_MsgSetSendsPaused { newValue: boolean; } -export interface ReactiveMsgUpdateNamespace_MsgSetSendsPaused { - newValue: ComputedRef; -} export interface MsgUpdateNamespace_MsgSetSendsPausedProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgSetSendsPaused"; value: Uint8Array; @@ -199,9 +166,6 @@ export interface MsgUpdateNamespace_MsgSetSendsPausedAminoMsg { export interface MsgUpdateNamespace_MsgSetBurnsPaused { newValue: boolean; } -export interface ReactiveMsgUpdateNamespace_MsgSetBurnsPaused { - newValue: ComputedRef; -} export interface MsgUpdateNamespace_MsgSetBurnsPausedProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgSetBurnsPaused"; value: Uint8Array; @@ -214,7 +178,6 @@ export interface MsgUpdateNamespace_MsgSetBurnsPausedAminoMsg { value: MsgUpdateNamespace_MsgSetBurnsPausedAmino; } export interface MsgUpdateNamespaceResponse {} -export interface ReactiveMsgUpdateNamespaceResponse {} export interface MsgUpdateNamespaceResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse"; value: Uint8Array; @@ -233,12 +196,6 @@ export interface MsgUpdateNamespaceRoles { /** new addresses to add or new roles for existing addresses to */ addressRoles: AddressRoles[]; } -export interface ReactiveMsgUpdateNamespaceRoles { - sender: ComputedRef; - namespaceDenom: ComputedRef; - rolePermissions: ComputedRef; - addressRoles: ComputedRef; -} export interface MsgUpdateNamespaceRolesProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles"; value: Uint8Array; @@ -257,7 +214,6 @@ export interface MsgUpdateNamespaceRolesAminoMsg { value: MsgUpdateNamespaceRolesAmino; } export interface MsgUpdateNamespaceRolesResponse {} -export interface ReactiveMsgUpdateNamespaceRolesResponse {} export interface MsgUpdateNamespaceRolesResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse"; value: Uint8Array; @@ -274,11 +230,6 @@ export interface MsgRevokeNamespaceRoles { /** {"address" => array of roles to revoke from this address} */ addressRolesToRevoke: AddressRoles[]; } -export interface ReactiveMsgRevokeNamespaceRoles { - sender: ComputedRef; - namespaceDenom: ComputedRef; - addressRolesToRevoke: ComputedRef; -} export interface MsgRevokeNamespaceRolesProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles"; value: Uint8Array; @@ -295,7 +246,6 @@ export interface MsgRevokeNamespaceRolesAminoMsg { value: MsgRevokeNamespaceRolesAmino; } export interface MsgRevokeNamespaceRolesResponse {} -export interface ReactiveMsgRevokeNamespaceRolesResponse {} export interface MsgRevokeNamespaceRolesResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse"; value: Uint8Array; @@ -309,10 +259,6 @@ export interface MsgClaimVoucher { sender: string; denom: string; } -export interface ReactiveMsgClaimVoucher { - sender: ComputedRef; - denom: ComputedRef; -} export interface MsgClaimVoucherProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucher"; value: Uint8Array; @@ -326,7 +272,6 @@ export interface MsgClaimVoucherAminoMsg { value: MsgClaimVoucherAmino; } export interface MsgClaimVoucherResponse {} -export interface ReactiveMsgClaimVoucherResponse {} export interface MsgClaimVoucherResponseProtoMsg { typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucherResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/rpc.query.ts b/libs/injective-vue/src/injective/rpc.query.ts deleted file mode 100644 index 6a9bf246..00000000 --- a/libs/injective-vue/src/injective/rpc.query.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import { QueryClient } from "@cosmjs/stargate"; -export const createRPCQueryClient = async ({ - rpcEndpoint -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - cosmos: { - auth: { - v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - bank: { - v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - gov: { - v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - staking: { - v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - tx: { - v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) - } - }, - injective: { - auction: { - v1beta1: (await import("./auction/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - exchange: { - v1beta1: (await import("./exchange/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - insurance: { - v1beta1: (await import("./insurance/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - ocr: { - v1beta1: (await import("./ocr/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - oracle: { - v1beta1: (await import("./oracle/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - peggy: { - v1: (await import("./peggy/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - permissions: { - v1beta1: (await import("./permissions/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - tokenfactory: { - v1beta1: (await import("./tokenfactory/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - wasmx: { - v1: (await import("./wasmx/v1/query.rpc.Query")).createRpcQueryExtension(client) - } - } - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/rpc.tx.ts b/libs/injective-vue/src/injective/rpc.tx.ts deleted file mode 100644 index c3f29aba..00000000 --- a/libs/injective-vue/src/injective/rpc.tx.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - authz: { - v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - injective: { - auction: { - v1beta1: new (await import("./auction/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - exchange: { - v1beta1: new (await import("./exchange/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - insurance: { - v1beta1: new (await import("./insurance/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - ocr: { - v1beta1: new (await import("./ocr/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - oracle: { - v1beta1: new (await import("./oracle/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - peggy: { - v1: new (await import("./peggy/v1/msgs.rpc.msg")).MsgClientImpl(rpc) - }, - permissions: { - v1beta1: new (await import("./permissions/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - tokenfactory: { - v1beta1: new (await import("./tokenfactory/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - wasmx: { - v1: new (await import("./wasmx/v1/tx.rpc.msg")).MsgClientImpl(rpc) - } - } -}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/stream/v1beta1/query.ts b/libs/injective-vue/src/injective/stream/v1beta1/query.ts index e3841241..ebb9599e 100644 --- a/libs/injective-vue/src/injective/stream/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/stream/v1beta1/query.ts @@ -3,7 +3,6 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; export enum OrderUpdateStatus { Unspecified = 0, Booked = 1, @@ -59,18 +58,6 @@ export interface StreamRequest { positionsFilter?: PositionsFilter; oraclePriceFilter?: OraclePriceFilter; } -export interface ReactiveStreamRequest { - bankBalancesFilter?: ComputedRef; - subaccountDepositsFilter?: ComputedRef; - spotTradesFilter?: ComputedRef; - derivativeTradesFilter?: ComputedRef; - spotOrdersFilter?: ComputedRef; - derivativeOrdersFilter?: ComputedRef; - spotOrderbooksFilter?: ComputedRef; - derivativeOrderbooksFilter?: ComputedRef; - positionsFilter?: ComputedRef; - oraclePriceFilter?: ComputedRef; -} export interface StreamRequestProtoMsg { typeUrl: "/injective.stream.v1beta1.StreamRequest"; value: Uint8Array; @@ -105,20 +92,6 @@ export interface StreamResponse { positions: Position[]; oraclePrices: OraclePrice[]; } -export interface ReactiveStreamResponse { - blockHeight: ComputedRef; - blockTime: ComputedRef; - bankBalances: ComputedRef; - subaccountDeposits: ComputedRef; - spotTrades: ComputedRef; - derivativeTrades: ComputedRef; - spotOrders: ComputedRef; - derivativeOrders: ComputedRef; - spotOrderbookUpdates: ComputedRef; - derivativeOrderbookUpdates: ComputedRef; - positions: ComputedRef; - oraclePrices: ComputedRef; -} export interface StreamResponseProtoMsg { typeUrl: "/injective.stream.v1beta1.StreamResponse"; value: Uint8Array; @@ -145,10 +118,6 @@ export interface OrderbookUpdate { seq: bigint; orderbook?: Orderbook; } -export interface ReactiveOrderbookUpdate { - seq: ComputedRef; - orderbook?: ComputedRef; -} export interface OrderbookUpdateProtoMsg { typeUrl: "/injective.stream.v1beta1.OrderbookUpdate"; value: Uint8Array; @@ -166,11 +135,6 @@ export interface Orderbook { buyLevels: Level[]; sellLevels: Level[]; } -export interface ReactiveOrderbook { - marketId: ComputedRef; - buyLevels: ComputedRef; - sellLevels: ComputedRef; -} export interface OrderbookProtoMsg { typeUrl: "/injective.stream.v1beta1.Orderbook"; value: Uint8Array; @@ -188,10 +152,6 @@ export interface BankBalance { account: string; balances: Coin[]; } -export interface ReactiveBankBalance { - account: ComputedRef; - balances: ComputedRef; -} export interface BankBalanceProtoMsg { typeUrl: "/injective.stream.v1beta1.BankBalance"; value: Uint8Array; @@ -208,10 +168,6 @@ export interface SubaccountDeposits { subaccountId: string; deposits: SubaccountDeposit[]; } -export interface ReactiveSubaccountDeposits { - subaccountId: ComputedRef; - deposits: ComputedRef; -} export interface SubaccountDepositsProtoMsg { typeUrl: "/injective.stream.v1beta1.SubaccountDeposits"; value: Uint8Array; @@ -228,10 +184,6 @@ export interface SubaccountDeposit { denom: string; deposit: Deposit; } -export interface ReactiveSubaccountDeposit { - denom: ComputedRef; - deposit: ComputedRef; -} export interface SubaccountDepositProtoMsg { typeUrl: "/injective.stream.v1beta1.SubaccountDeposit"; value: Uint8Array; @@ -250,12 +202,6 @@ export interface SpotOrderUpdate { cid: string; order?: SpotOrder; } -export interface ReactiveSpotOrderUpdate { - status: ComputedRef; - orderHash: ComputedRef; - cid: ComputedRef; - order?: ComputedRef; -} export interface SpotOrderUpdateProtoMsg { typeUrl: "/injective.stream.v1beta1.SpotOrderUpdate"; value: Uint8Array; @@ -274,10 +220,6 @@ export interface SpotOrder { marketId: string; order: SpotLimitOrder; } -export interface ReactiveSpotOrder { - marketId: ComputedRef; - order: ComputedRef; -} export interface SpotOrderProtoMsg { typeUrl: "/injective.stream.v1beta1.SpotOrder"; value: Uint8Array; @@ -296,12 +238,6 @@ export interface DerivativeOrderUpdate { cid: string; order?: DerivativeOrder; } -export interface ReactiveDerivativeOrderUpdate { - status: ComputedRef; - orderHash: ComputedRef; - cid: ComputedRef; - order?: ComputedRef; -} export interface DerivativeOrderUpdateProtoMsg { typeUrl: "/injective.stream.v1beta1.DerivativeOrderUpdate"; value: Uint8Array; @@ -321,11 +257,6 @@ export interface DerivativeOrder { order: DerivativeLimitOrder; isMarket: boolean; } -export interface ReactiveDerivativeOrder { - marketId: ComputedRef; - order: ComputedRef; - isMarket: ComputedRef; -} export interface DerivativeOrderProtoMsg { typeUrl: "/injective.stream.v1beta1.DerivativeOrder"; value: Uint8Array; @@ -348,15 +279,6 @@ export interface Position { margin: string; cumulativeFundingEntry: string; } -export interface ReactivePosition { - marketId: ComputedRef; - subaccountId: ComputedRef; - isLong: ComputedRef; - quantity: ComputedRef; - entryPrice: ComputedRef; - margin: ComputedRef; - cumulativeFundingEntry: ComputedRef; -} export interface PositionProtoMsg { typeUrl: "/injective.stream.v1beta1.Position"; value: Uint8Array; @@ -379,11 +301,6 @@ export interface OraclePrice { price: string; type: string; } -export interface ReactiveOraclePrice { - symbol: ComputedRef; - price: ComputedRef; - type: ComputedRef; -} export interface OraclePriceProtoMsg { typeUrl: "/injective.stream.v1beta1.OraclePrice"; value: Uint8Array; @@ -411,19 +328,6 @@ export interface SpotTrade { cid: string; tradeId: string; } -export interface ReactiveSpotTrade { - marketId: ComputedRef; - isBuy: ComputedRef; - executionType: ComputedRef; - quantity: ComputedRef; - price: ComputedRef; - subaccountId: ComputedRef; - fee: ComputedRef; - orderHash: ComputedRef; - feeRecipientAddress?: ComputedRef; - cid: ComputedRef; - tradeId: ComputedRef; -} export interface SpotTradeProtoMsg { typeUrl: "/injective.stream.v1beta1.SpotTrade"; value: Uint8Array; @@ -459,19 +363,6 @@ export interface DerivativeTrade { cid: string; tradeId: string; } -export interface ReactiveDerivativeTrade { - marketId: ComputedRef; - isBuy: ComputedRef; - executionType: ComputedRef; - subaccountId: ComputedRef; - positionDelta?: ComputedRef; - payout: ComputedRef; - fee: ComputedRef; - orderHash: ComputedRef; - feeRecipientAddress?: ComputedRef; - cid: ComputedRef; - tradeId: ComputedRef; -} export interface DerivativeTradeProtoMsg { typeUrl: "/injective.stream.v1beta1.DerivativeTrade"; value: Uint8Array; @@ -497,10 +388,6 @@ export interface TradesFilter { subaccountIds: string[]; marketIds: string[]; } -export interface ReactiveTradesFilter { - subaccountIds: ComputedRef; - marketIds: ComputedRef; -} export interface TradesFilterProtoMsg { typeUrl: "/injective.stream.v1beta1.TradesFilter"; value: Uint8Array; @@ -517,10 +404,6 @@ export interface PositionsFilter { subaccountIds: string[]; marketIds: string[]; } -export interface ReactivePositionsFilter { - subaccountIds: ComputedRef; - marketIds: ComputedRef; -} export interface PositionsFilterProtoMsg { typeUrl: "/injective.stream.v1beta1.PositionsFilter"; value: Uint8Array; @@ -537,10 +420,6 @@ export interface OrdersFilter { subaccountIds: string[]; marketIds: string[]; } -export interface ReactiveOrdersFilter { - subaccountIds: ComputedRef; - marketIds: ComputedRef; -} export interface OrdersFilterProtoMsg { typeUrl: "/injective.stream.v1beta1.OrdersFilter"; value: Uint8Array; @@ -556,9 +435,6 @@ export interface OrdersFilterAminoMsg { export interface OrderbookFilter { marketIds: string[]; } -export interface ReactiveOrderbookFilter { - marketIds: ComputedRef; -} export interface OrderbookFilterProtoMsg { typeUrl: "/injective.stream.v1beta1.OrderbookFilter"; value: Uint8Array; @@ -573,9 +449,6 @@ export interface OrderbookFilterAminoMsg { export interface BankBalancesFilter { accounts: string[]; } -export interface ReactiveBankBalancesFilter { - accounts: ComputedRef; -} export interface BankBalancesFilterProtoMsg { typeUrl: "/injective.stream.v1beta1.BankBalancesFilter"; value: Uint8Array; @@ -590,9 +463,6 @@ export interface BankBalancesFilterAminoMsg { export interface SubaccountDepositsFilter { subaccountIds: string[]; } -export interface ReactiveSubaccountDepositsFilter { - subaccountIds: ComputedRef; -} export interface SubaccountDepositsFilterProtoMsg { typeUrl: "/injective.stream.v1beta1.SubaccountDepositsFilter"; value: Uint8Array; @@ -607,9 +477,6 @@ export interface SubaccountDepositsFilterAminoMsg { export interface OraclePriceFilter { symbol: string[]; } -export interface ReactiveOraclePriceFilter { - symbol: ComputedRef; -} export interface OraclePriceFilterProtoMsg { typeUrl: "/injective.stream.v1beta1.OraclePriceFilter"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/authorityMetadata.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/authorityMetadata.ts index 8b2432fe..4497aa5e 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/authorityMetadata.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/authorityMetadata.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * DenomAuthorityMetadata specifies metadata for addresses that have specific * capabilities over a token factory denom. Right now there is only one Admin @@ -11,9 +10,6 @@ export interface DenomAuthorityMetadata { /** Can be empty for no admin, or a valid injective address */ admin: string; } -export interface ReactiveDenomAuthorityMetadata { - admin: ComputedRef; -} export interface DenomAuthorityMetadataProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.DenomAuthorityMetadata"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/events.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/events.ts index 4704704d..38852b9d 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/events.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/events.ts @@ -3,15 +3,10 @@ import { Metadata, MetadataAmino } from "../../../cosmos/bank/v1beta1/bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface EventCreateTFDenom { account: string; denom: string; } -export interface ReactiveEventCreateTFDenom { - account: ComputedRef; - denom: ComputedRef; -} export interface EventCreateTFDenomProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.EventCreateTFDenom"; value: Uint8Array; @@ -28,10 +23,6 @@ export interface EventMintTFDenom { recipientAddress: string; amount: Coin; } -export interface ReactiveEventMintTFDenom { - recipientAddress: ComputedRef; - amount: ComputedRef; -} export interface EventMintTFDenomProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.EventMintTFDenom"; value: Uint8Array; @@ -48,10 +39,6 @@ export interface EventBurnDenom { burnerAddress: string; amount: Coin; } -export interface ReactiveEventBurnDenom { - burnerAddress: ComputedRef; - amount: ComputedRef; -} export interface EventBurnDenomProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.EventBurnDenom"; value: Uint8Array; @@ -68,10 +55,6 @@ export interface EventChangeTFAdmin { denom: string; newAdminAddress: string; } -export interface ReactiveEventChangeTFAdmin { - denom: ComputedRef; - newAdminAddress: ComputedRef; -} export interface EventChangeTFAdminProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin"; value: Uint8Array; @@ -88,10 +71,6 @@ export interface EventSetTFDenomMetadata { denom: string; metadata: Metadata; } -export interface ReactiveEventSetTFDenomMetadata { - denom: ComputedRef; - metadata: ComputedRef; -} export interface EventSetTFDenomMetadataProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/genesis.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/genesis.ts index bda88659..d5df5325 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/genesis.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/genesis.ts @@ -3,17 +3,12 @@ import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino } from "./authority import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the tokenfactory module's genesis state. */ export interface GenesisState { /** params defines the parameters of the module. */ params: Params; factoryDenoms: GenesisDenom[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - factoryDenoms: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.GenesisState"; value: Uint8Array; @@ -40,13 +35,6 @@ export interface GenesisDenom { symbol: string; decimals: number; } -export interface ReactiveGenesisDenom { - denom: ComputedRef; - authorityMetadata: ComputedRef; - name: ComputedRef; - symbol: ComputedRef; - decimals: ComputedRef; -} export interface GenesisDenomProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.GenesisDenom"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/params.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/params.ts index 21bd9523..bb4a1ef3 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/params.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/params.ts @@ -2,14 +2,10 @@ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Params defines the parameters for the tokenfactory module. */ export interface Params { denomCreationFee: Coin[]; } -export interface ReactiveParams { - denomCreationFee: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.Params"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.Query.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.Query.ts deleted file mode 100644 index bed02946..00000000 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,224 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse, ReactiveQueryParamsRequest, ReactiveQueryDenomAuthorityMetadataRequest, ReactiveQueryDenomsFromCreatorRequest, ReactiveQueryModuleStateRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Params defines a gRPC query method that returns the tokenfactory module's - * parameters. - */ - params(request?: QueryParamsRequest): Promise; - /** - * DenomAuthorityMetadata defines a gRPC query method for fetching - * DenomAuthorityMetadata for a particular denom. - */ - denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise; - /** - * DenomsFromCreator defines a gRPC query method for fetching all - * denominations created by a specific admin/creator. - */ - denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise; - /** Retrieves the entire auction module's state */ - tokenfactoryModuleState(request?: QueryModuleStateRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params defines a gRPC query method that returns the tokenfactory module's - parameters. */ - params = async (request: QueryParamsRequest = {}): Promise => { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); - }; - /* DenomAuthorityMetadata defines a gRPC query method for fetching - DenomAuthorityMetadata for a particular denom. */ - denomAuthorityMetadata = async (request: QueryDenomAuthorityMetadataRequest): Promise => { - const data = QueryDenomAuthorityMetadataRequest.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Query", "DenomAuthorityMetadata", data); - return promise.then(data => QueryDenomAuthorityMetadataResponse.decode(new BinaryReader(data))); - }; - /* DenomsFromCreator defines a gRPC query method for fetching all - denominations created by a specific admin/creator. */ - denomsFromCreator = async (request: QueryDenomsFromCreatorRequest): Promise => { - const data = QueryDenomsFromCreatorRequest.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Query", "DenomsFromCreator", data); - return promise.then(data => QueryDenomsFromCreatorResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire auction module's state */ - tokenfactoryModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Query", "TokenfactoryModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise { - return queryService.denomAuthorityMetadata(request); - }, - denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise { - return queryService.denomsFromCreator(request); - }, - tokenfactoryModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.tokenfactoryModuleState(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseDenomAuthorityMetadataQuery extends VueQueryParams { - request: ReactiveQueryDenomAuthorityMetadataRequest; -} -export interface UseDenomsFromCreatorQuery extends VueQueryParams { - request: ReactiveQueryDenomsFromCreatorRequest; -} -export interface UseTokenfactoryModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useDenomAuthorityMetadata = ({ - request, - options - }: UseDenomAuthorityMetadataQuery) => { - const queryKey = ["denomAuthorityMetadataQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomAuthorityMetadata(params); - }, - ...options - }); - }; - const useDenomsFromCreator = ({ - request, - options - }: UseDenomsFromCreatorQuery) => { - const queryKey = ["denomsFromCreatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomsFromCreator(params); - }, - ...options - }); - }; - const useTokenfactoryModuleState = ({ - request, - options - }: UseTokenfactoryModuleStateQuery) => { - const queryKey = ["tokenfactoryModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.tokenfactoryModuleState(params); - }, - ...options - }); - }; - return { - /** - * Params defines a gRPC query method that returns the tokenfactory module's - * parameters. - */ - useParams, - /** - * DenomAuthorityMetadata defines a gRPC query method for fetching - * DenomAuthorityMetadata for a particular denom. - */ - useDenomAuthorityMetadata, - /** - * DenomsFromCreator defines a gRPC query method for fetching all - * denominations created by a specific admin/creator. - */ - useDenomsFromCreator, - /** Retrieves the entire auction module's state */useTokenfactoryModuleState - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.func.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..f18ad34f --- /dev/null +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.func.ts @@ -0,0 +1,30 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDenomAuthorityMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomAuthorityMetadataRequest.encode, + decode: QueryDenomAuthorityMetadataResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "DenomAuthorityMetadata", + clientResolver +}); +export const createGetDenomsFromCreator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomsFromCreatorRequest.encode, + decode: QueryDenomsFromCreatorResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "DenomsFromCreator", + clientResolver +}); +export const createGetTokenfactoryModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "TokenfactoryModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..4eb20078 --- /dev/null +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts @@ -0,0 +1,19 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetParams, createGetDenomAuthorityMetadata, createGetDenomsFromCreator, createGetTokenfactoryModuleState } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDenomAuthorityMetadata = buildUseVueQuery({ + builderQueryFn: createGetDenomAuthorityMetadata, + queryKeyPrefix: "DenomAuthorityMetadataQuery" +}); +export const useGetDenomsFromCreator = buildUseVueQuery({ + builderQueryFn: createGetDenomsFromCreator, + queryKeyPrefix: "DenomsFromCreatorQuery" +}); +export const useGetTokenfactoryModuleState = buildUseVueQuery({ + builderQueryFn: createGetTokenfactoryModuleState, + queryKeyPrefix: "TokenfactoryModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.ts index 74aa16e7..3a0d5408 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.ts @@ -4,10 +4,8 @@ import { GenesisState, GenesisStateAmino } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -23,9 +21,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -47,10 +42,6 @@ export interface QueryDenomAuthorityMetadataRequest { creator: string; subDenom: string; } -export interface ReactiveQueryDenomAuthorityMetadataRequest { - creator: ComputedRef; - subDenom: ComputedRef; -} export interface QueryDenomAuthorityMetadataRequestProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest"; value: Uint8Array; @@ -74,9 +65,6 @@ export interface QueryDenomAuthorityMetadataRequestAminoMsg { export interface QueryDenomAuthorityMetadataResponse { authorityMetadata: DenomAuthorityMetadata; } -export interface ReactiveQueryDenomAuthorityMetadataResponse { - authorityMetadata: ComputedRef; -} export interface QueryDenomAuthorityMetadataResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse"; value: Uint8Array; @@ -99,9 +87,6 @@ export interface QueryDenomAuthorityMetadataResponseAminoMsg { export interface QueryDenomsFromCreatorRequest { creator: string; } -export interface ReactiveQueryDenomsFromCreatorRequest { - creator: ComputedRef; -} export interface QueryDenomsFromCreatorRequestProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest"; value: Uint8Array; @@ -124,9 +109,6 @@ export interface QueryDenomsFromCreatorRequestAminoMsg { export interface QueryDenomsFromCreatorResponse { denoms: string[]; } -export interface ReactiveQueryDenomsFromCreatorResponse { - denoms: ComputedRef; -} export interface QueryDenomsFromCreatorResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse"; value: Uint8Array; @@ -147,7 +129,6 @@ export interface QueryDenomsFromCreatorResponseAminoMsg { * Query/TokenfactoryModuleState RPC method. */ export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest"; value: Uint8Array; @@ -168,9 +149,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.amino.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.amino.ts deleted file mode 100644 index 6b670b82..00000000 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.amino.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/injective.tokenfactory.v1beta1.MsgCreateDenom": { - aminoType: "injective/tokenfactory/create-denom", - toAmino: MsgCreateDenom.toAmino, - fromAmino: MsgCreateDenom.fromAmino - }, - "/injective.tokenfactory.v1beta1.MsgMint": { - aminoType: "injective/tokenfactory/mint", - toAmino: MsgMint.toAmino, - fromAmino: MsgMint.fromAmino - }, - "/injective.tokenfactory.v1beta1.MsgBurn": { - aminoType: "injective/tokenfactory/burn", - toAmino: MsgBurn.toAmino, - fromAmino: MsgBurn.fromAmino - }, - "/injective.tokenfactory.v1beta1.MsgChangeAdmin": { - aminoType: "injective/tokenfactory/change-admin", - toAmino: MsgChangeAdmin.toAmino, - fromAmino: MsgChangeAdmin.fromAmino - }, - "/injective.tokenfactory.v1beta1.MsgSetDenomMetadata": { - aminoType: "injective/tokenfactory/set-denom-metadata", - toAmino: MsgSetDenomMetadata.toAmino, - fromAmino: MsgSetDenomMetadata.fromAmino - }, - "/injective.tokenfactory.v1beta1.MsgUpdateParams": { - aminoType: "injective/tokenfactory/update-params", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..dd53b620 --- /dev/null +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts @@ -0,0 +1,39 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; +export const createCreateDenom = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDenom.typeUrl, + encoders: toEncoders(MsgCreateDenom), + converters: toConverters(MsgCreateDenom) +}); +export const createMint = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMint.typeUrl, + encoders: toEncoders(MsgMint), + converters: toConverters(MsgMint) +}); +export const createBurn = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBurn.typeUrl, + encoders: toEncoders(MsgBurn), + converters: toConverters(MsgBurn) +}); +export const createChangeAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChangeAdmin.typeUrl, + encoders: toEncoders(MsgChangeAdmin), + converters: toConverters(MsgChangeAdmin) +}); +export const createSetDenomMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetDenomMetadata.typeUrl, + encoders: toEncoders(MsgSetDenomMetadata), + converters: toConverters(MsgSetDenomMetadata) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 2a801aca..00000000 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the tokefactory module's gRPC message service. */ -export interface Msg { - createDenom(request: MsgCreateDenom): Promise; - mint(request: MsgMint): Promise; - burn(request: MsgBurn): Promise; - changeAdmin(request: MsgChangeAdmin): Promise; - setDenomMetadata(request: MsgSetDenomMetadata): Promise; - updateParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateDenom */ - createDenom = async (request: MsgCreateDenom): Promise => { - const data = MsgCreateDenom.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Msg", "CreateDenom", data); - return promise.then(data => MsgCreateDenomResponse.decode(new BinaryReader(data))); - }; - /* Mint */ - mint = async (request: MsgMint): Promise => { - const data = MsgMint.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Msg", "Mint", data); - return promise.then(data => MsgMintResponse.decode(new BinaryReader(data))); - }; - /* Burn */ - burn = async (request: MsgBurn): Promise => { - const data = MsgBurn.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Msg", "Burn", data); - return promise.then(data => MsgBurnResponse.decode(new BinaryReader(data))); - }; - /* ChangeAdmin */ - changeAdmin = async (request: MsgChangeAdmin): Promise => { - const data = MsgChangeAdmin.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Msg", "ChangeAdmin", data); - return promise.then(data => MsgChangeAdminResponse.decode(new BinaryReader(data))); - }; - /* SetDenomMetadata */ - setDenomMetadata = async (request: MsgSetDenomMetadata): Promise => { - const data = MsgSetDenomMetadata.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Msg", "SetDenomMetadata", data); - return promise.then(data => MsgSetDenomMetadataResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.tokenfactory.v1beta1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..f52bca08 --- /dev/null +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,21 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; +import { createCreateDenom, createMint, createBurn, createChangeAdmin, createSetDenomMetadata, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateDenom = buildUseVueMutation({ + builderMutationFn: createCreateDenom +}); +export const useMint = buildUseVueMutation({ + builderMutationFn: createMint +}); +export const useBurn = buildUseVueMutation({ + builderMutationFn: createBurn +}); +export const useChangeAdmin = buildUseVueMutation({ + builderMutationFn: createChangeAdmin +}); +export const useSetDenomMetadata = buildUseVueMutation({ + builderMutationFn: createSetDenomMetadata +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.ts index 862dc285..707eeec0 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Metadata, MetadataAmino, Params, ParamsAmino } from "../../../cosmos/ba import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgCreateDenom defines the message structure for the CreateDenom gRPC service * method. It allows an account to create a new denom. It requires a sender @@ -23,13 +22,6 @@ export interface MsgCreateDenom { symbol: string; decimals: number; } -export interface ReactiveMsgCreateDenom { - sender: ComputedRef; - subdenom: ComputedRef; - name: ComputedRef; - symbol: ComputedRef; - decimals: ComputedRef; -} export interface MsgCreateDenomProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenom"; value: Uint8Array; @@ -64,9 +56,6 @@ export interface MsgCreateDenomAminoMsg { export interface MsgCreateDenomResponse { newTokenDenom: string; } -export interface ReactiveMsgCreateDenomResponse { - newTokenDenom: ComputedRef; -} export interface MsgCreateDenomResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenomResponse"; value: Uint8Array; @@ -90,10 +79,6 @@ export interface MsgMint { sender: string; amount: Coin; } -export interface ReactiveMsgMint { - sender: ComputedRef; - amount: ComputedRef; -} export interface MsgMintProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgMint"; value: Uint8Array; @@ -111,7 +96,6 @@ export interface MsgMintAminoMsg { value: MsgMintAmino; } export interface MsgMintResponse {} -export interface ReactiveMsgMintResponse {} export interface MsgMintResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgMintResponse"; value: Uint8Array; @@ -129,10 +113,6 @@ export interface MsgBurn { sender: string; amount: Coin; } -export interface ReactiveMsgBurn { - sender: ComputedRef; - amount: ComputedRef; -} export interface MsgBurnProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgBurn"; value: Uint8Array; @@ -150,7 +130,6 @@ export interface MsgBurnAminoMsg { value: MsgBurnAmino; } export interface MsgBurnResponse {} -export interface ReactiveMsgBurnResponse {} export interface MsgBurnResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgBurnResponse"; value: Uint8Array; @@ -169,11 +148,6 @@ export interface MsgChangeAdmin { denom: string; newAdmin: string; } -export interface ReactiveMsgChangeAdmin { - sender: ComputedRef; - denom: ComputedRef; - newAdmin: ComputedRef; -} export interface MsgChangeAdminProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdmin"; value: Uint8Array; @@ -196,7 +170,6 @@ export interface MsgChangeAdminAminoMsg { * MsgChangeAdmin message. */ export interface MsgChangeAdminResponse {} -export interface ReactiveMsgChangeAdminResponse {} export interface MsgChangeAdminResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse"; value: Uint8Array; @@ -218,10 +191,6 @@ export interface MsgSetDenomMetadata { sender: string; metadata: Metadata; } -export interface ReactiveMsgSetDenomMetadata { - sender: ComputedRef; - metadata: ComputedRef; -} export interface MsgSetDenomMetadataProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadata"; value: Uint8Array; @@ -243,7 +212,6 @@ export interface MsgSetDenomMetadataAminoMsg { * MsgSetDenomMetadata message. */ export interface MsgSetDenomMetadataResponse {} -export interface ReactiveMsgSetDenomMetadataResponse {} export interface MsgSetDenomMetadataResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse"; value: Uint8Array; @@ -267,10 +235,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -290,7 +254,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/types/v1beta1/account.ts b/libs/injective-vue/src/injective/types/v1beta1/account.ts index 5e15c851..cd39998b 100644 --- a/libs/injective-vue/src/injective/types/v1beta1/account.ts +++ b/libs/injective-vue/src/injective/types/v1beta1/account.ts @@ -2,7 +2,6 @@ import { BaseAccount, BaseAccountAmino } from "../../../cosmos/auth/v1beta1/auth import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * EthAccount implements the authtypes.AccountI interface and embeds an * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. @@ -11,10 +10,6 @@ export interface EthAccount { baseAccount?: BaseAccount; codeHash: Uint8Array; } -export interface ReactiveEthAccount { - baseAccount?: ComputedRef; - codeHash: ComputedRef; -} export interface EthAccountProtoMsg { typeUrl: "/injective.types.v1beta1.EthAccount"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/types/v1beta1/tx_ext.ts b/libs/injective-vue/src/injective/types/v1beta1/tx_ext.ts index 8939a285..ac7f44f2 100644 --- a/libs/injective-vue/src/injective/types/v1beta1/tx_ext.ts +++ b/libs/injective-vue/src/injective/types/v1beta1/tx_ext.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface ExtensionOptionsWeb3Tx { /** * typedDataChainID used only in EIP712 Domain and should match @@ -19,11 +18,6 @@ export interface ExtensionOptionsWeb3Tx { */ feePayerSig: Uint8Array; } -export interface ReactiveExtensionOptionsWeb3Tx { - typedDataChainID: ComputedRef; - feePayer: ComputedRef; - feePayerSig: ComputedRef; -} export interface ExtensionOptionsWeb3TxProtoMsg { typeUrl: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/types/v1beta1/tx_response.ts b/libs/injective-vue/src/injective/types/v1beta1/tx_response.ts index cd98070f..14002e46 100644 --- a/libs/injective-vue/src/injective/types/v1beta1/tx_response.ts +++ b/libs/injective-vue/src/injective/types/v1beta1/tx_response.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * base header ak message type, we can cast the bytes into corresponding message * response type @@ -10,10 +9,6 @@ export interface TxResponseGenericMessage { header: string; data: Uint8Array; } -export interface ReactiveTxResponseGenericMessage { - header: ComputedRef; - data: ComputedRef; -} export interface TxResponseGenericMessageProtoMsg { typeUrl: "/injective.types.v1beta1.TxResponseGenericMessage"; value: Uint8Array; @@ -34,9 +29,6 @@ export interface TxResponseGenericMessageAminoMsg { export interface TxResponseData { messages: TxResponseGenericMessage[]; } -export interface ReactiveTxResponseData { - messages: ComputedRef; -} export interface TxResponseDataProtoMsg { typeUrl: "/injective.types.v1beta1.TxResponseData"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/wasmx/v1/events.ts b/libs/injective-vue/src/injective/wasmx/v1/events.ts index 6e732e65..b579a219 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/events.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/events.ts @@ -2,19 +2,12 @@ import { FundingMode } from "./proposal"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; export interface EventContractExecution { contractAddress: string; response: Uint8Array; otherError: string; executionError: string; } -export interface ReactiveEventContractExecution { - contractAddress: ComputedRef; - response: ComputedRef; - otherError: ComputedRef; - executionError: ComputedRef; -} export interface EventContractExecutionProtoMsg { typeUrl: "/injective.wasmx.v1.EventContractExecution"; value: Uint8Array; @@ -39,16 +32,6 @@ export interface EventContractRegistered { granterAddress: string; fundingMode: FundingMode; } -export interface ReactiveEventContractRegistered { - contractAddress: ComputedRef; - gasPrice: ComputedRef; - shouldPinContract: ComputedRef; - isMigrationAllowed: ComputedRef; - codeId: ComputedRef; - adminAddress: ComputedRef; - granterAddress: ComputedRef; - fundingMode: ComputedRef; -} export interface EventContractRegisteredProtoMsg { typeUrl: "/injective.wasmx.v1.EventContractRegistered"; value: Uint8Array; @@ -70,9 +53,6 @@ export interface EventContractRegisteredAminoMsg { export interface EventContractDeregistered { contractAddress: string; } -export interface ReactiveEventContractDeregistered { - contractAddress: ComputedRef; -} export interface EventContractDeregisteredProtoMsg { typeUrl: "/injective.wasmx.v1.EventContractDeregistered"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/wasmx/v1/genesis.ts b/libs/injective-vue/src/injective/wasmx/v1/genesis.ts index baec191e..80604cba 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/genesis.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/genesis.ts @@ -2,15 +2,10 @@ import { RegisteredContract, RegisteredContractAmino, Params, ParamsAmino } from import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface RegisteredContractWithAddress { address: string; registeredContract?: RegisteredContract; } -export interface ReactiveRegisteredContractWithAddress { - address: ComputedRef; - registeredContract?: ComputedRef; -} export interface RegisteredContractWithAddressProtoMsg { typeUrl: "/injective.wasmx.v1.RegisteredContractWithAddress"; value: Uint8Array; @@ -33,10 +28,6 @@ export interface GenesisState { */ registeredContracts: RegisteredContractWithAddress[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - registeredContracts: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/injective.wasmx.v1.GenesisState"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/wasmx/v1/proposal.ts b/libs/injective-vue/src/injective/wasmx/v1/proposal.ts index a119e7e7..69aeeed7 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/proposal.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/proposal.ts @@ -2,7 +2,6 @@ import { StoreCodeProposal, StoreCodeProposalAmino } from "../../../cosmwasm/was import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; export enum FundingMode { Unspecified = 0, SelfFunded = 1, @@ -51,11 +50,6 @@ export interface ContractRegistrationRequestProposal { description: string; contractRegistrationRequest: ContractRegistrationRequest; } -export interface ReactiveContractRegistrationRequestProposal { - title: ComputedRef; - description: ComputedRef; - contractRegistrationRequest: ComputedRef; -} export interface ContractRegistrationRequestProposalProtoMsg { typeUrl: "/injective.wasmx.v1.ContractRegistrationRequestProposal"; value: Uint8Array; @@ -74,11 +68,6 @@ export interface BatchContractRegistrationRequestProposal { description: string; contractRegistrationRequests: ContractRegistrationRequest[]; } -export interface ReactiveBatchContractRegistrationRequestProposal { - title: ComputedRef; - description: ComputedRef; - contractRegistrationRequests: ComputedRef; -} export interface BatchContractRegistrationRequestProposalProtoMsg { typeUrl: "/injective.wasmx.v1.BatchContractRegistrationRequestProposal"; value: Uint8Array; @@ -97,11 +86,6 @@ export interface BatchContractDeregistrationProposal { description: string; contracts: string[]; } -export interface ReactiveBatchContractDeregistrationProposal { - title: ComputedRef; - description: ComputedRef; - contracts: ComputedRef; -} export interface BatchContractDeregistrationProposalProtoMsg { typeUrl: "/injective.wasmx.v1.BatchContractDeregistrationProposal"; value: Uint8Array; @@ -146,17 +130,6 @@ export interface ContractRegistrationRequest { /** Specifies how the contract will fund its execution */ fundingMode: FundingMode; } -export interface ReactiveContractRegistrationRequest { - contractAddress: ComputedRef; - gasLimit: ComputedRef; - gasPrice: ComputedRef; - shouldPinContract: ComputedRef; - isMigrationAllowed: ComputedRef; - codeId: ComputedRef; - adminAddress: ComputedRef; - granterAddress: ComputedRef; - fundingMode: ComputedRef; -} export interface ContractRegistrationRequestProtoMsg { typeUrl: "/injective.wasmx.v1.ContractRegistrationRequest"; value: Uint8Array; @@ -201,11 +174,6 @@ export interface BatchStoreCodeProposal { description: string; proposals: StoreCodeProposal[]; } -export interface ReactiveBatchStoreCodeProposal { - title: ComputedRef; - description: ComputedRef; - proposals: ComputedRef; -} export interface BatchStoreCodeProposalProtoMsg { typeUrl: "/injective.wasmx.v1.BatchStoreCodeProposal"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/wasmx/v1/query.rpc.Query.ts b/libs/injective-vue/src/injective/wasmx/v1/query.rpc.Query.ts deleted file mode 100644 index 03501dc0..00000000 --- a/libs/injective-vue/src/injective/wasmx/v1/query.rpc.Query.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse, ReactiveQueryWasmxParamsRequest, ReactiveQueryContractRegistrationInfoRequest, ReactiveQueryModuleStateRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Retrieves wasmx params */ - wasmxParams(request?: QueryWasmxParamsRequest): Promise; - /** Retrieves contract registration info */ - contractRegistrationInfo(request: QueryContractRegistrationInfoRequest): Promise; - /** Retrieves the entire wasmx module's state */ - wasmxModuleState(request?: QueryModuleStateRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Retrieves wasmx params */ - wasmxParams = async (request: QueryWasmxParamsRequest = {}): Promise => { - const data = QueryWasmxParamsRequest.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Query", "WasmxParams", data); - return promise.then(data => QueryWasmxParamsResponse.decode(new BinaryReader(data))); - }; - /* Retrieves contract registration info */ - contractRegistrationInfo = async (request: QueryContractRegistrationInfoRequest): Promise => { - const data = QueryContractRegistrationInfoRequest.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Query", "ContractRegistrationInfo", data); - return promise.then(data => QueryContractRegistrationInfoResponse.decode(new BinaryReader(data))); - }; - /* Retrieves the entire wasmx module's state */ - wasmxModuleState = async (request: QueryModuleStateRequest = {}): Promise => { - const data = QueryModuleStateRequest.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Query", "WasmxModuleState", data); - return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - wasmxParams(request?: QueryWasmxParamsRequest): Promise { - return queryService.wasmxParams(request); - }, - contractRegistrationInfo(request: QueryContractRegistrationInfoRequest): Promise { - return queryService.contractRegistrationInfo(request); - }, - wasmxModuleState(request?: QueryModuleStateRequest): Promise { - return queryService.wasmxModuleState(request); - } - }; -}; -export interface UseWasmxParamsQuery extends VueQueryParams { - request?: ReactiveQueryWasmxParamsRequest; -} -export interface UseContractRegistrationInfoQuery extends VueQueryParams { - request: ReactiveQueryContractRegistrationInfoRequest; -} -export interface UseWasmxModuleStateQuery extends VueQueryParams { - request?: ReactiveQueryModuleStateRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useWasmxParams = ({ - request, - options - }: UseWasmxParamsQuery) => { - const queryKey = ["wasmxParamsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.wasmxParams(params); - }, - ...options - }); - }; - const useContractRegistrationInfo = ({ - request, - options - }: UseContractRegistrationInfoQuery) => { - const queryKey = ["contractRegistrationInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractRegistrationInfo(params); - }, - ...options - }); - }; - const useWasmxModuleState = ({ - request, - options - }: UseWasmxModuleStateQuery) => { - const queryKey = ["wasmxModuleStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.wasmxModuleState(params); - }, - ...options - }); - }; - return { - /** Retrieves wasmx params */useWasmxParams, - /** Retrieves contract registration info */useContractRegistrationInfo, - /** Retrieves the entire wasmx module's state */useWasmxModuleState - }; -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/wasmx/v1/query.rpc.func.ts b/libs/injective-vue/src/injective/wasmx/v1/query.rpc.func.ts new file mode 100644 index 00000000..22d53477 --- /dev/null +++ b/libs/injective-vue/src/injective/wasmx/v1/query.rpc.func.ts @@ -0,0 +1,23 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetWasmxParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmxParamsRequest.encode, + decode: QueryWasmxParamsResponse.decode, + service: "injective.wasmx.v1.Query", + method: "WasmxParams", + clientResolver +}); +export const createGetContractRegistrationInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractRegistrationInfoRequest.encode, + decode: QueryContractRegistrationInfoResponse.decode, + service: "injective.wasmx.v1.Query", + method: "ContractRegistrationInfo", + clientResolver +}); +export const createGetWasmxModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.wasmx.v1.Query", + method: "WasmxModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts b/libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts new file mode 100644 index 00000000..1cc8d81e --- /dev/null +++ b/libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +import { createGetWasmxParams, createGetContractRegistrationInfo, createGetWasmxModuleState } from "./query.rpc.func.ts"; +export const useGetWasmxParams = buildUseVueQuery({ + builderQueryFn: createGetWasmxParams, + queryKeyPrefix: "WasmxParamsQuery" +}); +export const useGetContractRegistrationInfo = buildUseVueQuery({ + builderQueryFn: createGetContractRegistrationInfo, + queryKeyPrefix: "ContractRegistrationInfoQuery" +}); +export const useGetWasmxModuleState = buildUseVueQuery({ + builderQueryFn: createGetWasmxModuleState, + queryKeyPrefix: "WasmxModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/wasmx/v1/query.ts b/libs/injective-vue/src/injective/wasmx/v1/query.ts index 3c80d4e0..002a060c 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/query.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/query.ts @@ -3,13 +3,11 @@ import { GenesisState, GenesisStateAmino } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * QueryWasmxParamsRequest is the request type for the Query/WasmxParams RPC * method. */ export interface QueryWasmxParamsRequest {} -export interface ReactiveQueryWasmxParamsRequest {} export interface QueryWasmxParamsRequestProtoMsg { typeUrl: "/injective.wasmx.v1.QueryWasmxParamsRequest"; value: Uint8Array; @@ -30,9 +28,6 @@ export interface QueryWasmxParamsRequestAminoMsg { export interface QueryWasmxParamsResponse { params: Params; } -export interface ReactiveQueryWasmxParamsResponse { - params: ComputedRef; -} export interface QueryWasmxParamsResponseProtoMsg { typeUrl: "/injective.wasmx.v1.QueryWasmxParamsResponse"; value: Uint8Array; @@ -53,7 +48,6 @@ export interface QueryWasmxParamsResponseAminoMsg { * RPC method. */ export interface QueryModuleStateRequest {} -export interface ReactiveQueryModuleStateRequest {} export interface QueryModuleStateRequestProtoMsg { typeUrl: "/injective.wasmx.v1.QueryModuleStateRequest"; value: Uint8Array; @@ -74,9 +68,6 @@ export interface QueryModuleStateRequestAminoMsg { export interface QueryModuleStateResponse { state?: GenesisState; } -export interface ReactiveQueryModuleStateResponse { - state?: ComputedRef; -} export interface QueryModuleStateResponseProtoMsg { typeUrl: "/injective.wasmx.v1.QueryModuleStateResponse"; value: Uint8Array; @@ -96,9 +87,6 @@ export interface QueryModuleStateResponseAminoMsg { export interface QueryContractRegistrationInfoRequest { contractAddress: string; } -export interface ReactiveQueryContractRegistrationInfoRequest { - contractAddress: ComputedRef; -} export interface QueryContractRegistrationInfoRequestProtoMsg { typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest"; value: Uint8Array; @@ -114,9 +102,6 @@ export interface QueryContractRegistrationInfoRequestAminoMsg { export interface QueryContractRegistrationInfoResponse { contract?: RegisteredContract; } -export interface ReactiveQueryContractRegistrationInfoResponse { - contract?: ComputedRef; -} export interface QueryContractRegistrationInfoResponseProtoMsg { typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/wasmx/v1/tx.amino.ts b/libs/injective-vue/src/injective/wasmx/v1/tx.amino.ts deleted file mode 100644 index 725c1afc..00000000 --- a/libs/injective-vue/src/injective/wasmx/v1/tx.amino.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; -export const AminoConverter = { - "/injective.wasmx.v1.MsgUpdateContract": { - aminoType: "wasmx/MsgUpdateContract", - toAmino: MsgUpdateContract.toAmino, - fromAmino: MsgUpdateContract.fromAmino - }, - "/injective.wasmx.v1.MsgActivateContract": { - aminoType: "wasmx/MsgActivateContract", - toAmino: MsgActivateContract.toAmino, - fromAmino: MsgActivateContract.fromAmino - }, - "/injective.wasmx.v1.MsgDeactivateContract": { - aminoType: "wasmx/MsgDeactivateContract", - toAmino: MsgDeactivateContract.toAmino, - fromAmino: MsgDeactivateContract.fromAmino - }, - "/injective.wasmx.v1.MsgExecuteContractCompat": { - aminoType: "wasmx/MsgExecuteContractCompat", - toAmino: MsgExecuteContractCompat.toAmino, - fromAmino: MsgExecuteContractCompat.fromAmino - }, - "/injective.wasmx.v1.MsgUpdateParams": { - aminoType: "wasmx/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/injective.wasmx.v1.MsgRegisterContract": { - aminoType: "wasmx/MsgRegisterContract", - toAmino: MsgRegisterContract.toAmino, - fromAmino: MsgRegisterContract.fromAmino - } -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.func.ts b/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.func.ts new file mode 100644 index 00000000..9f6c3d0c --- /dev/null +++ b/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.func.ts @@ -0,0 +1,39 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; +export const createUpdateRegistryContractParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateContract.typeUrl, + encoders: toEncoders(MsgUpdateContract), + converters: toConverters(MsgUpdateContract) +}); +export const createActivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgActivateContract.typeUrl, + encoders: toEncoders(MsgActivateContract), + converters: toConverters(MsgActivateContract) +}); +export const createDeactivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeactivateContract.typeUrl, + encoders: toEncoders(MsgDeactivateContract), + converters: toConverters(MsgDeactivateContract) +}); +export const createExecuteContractCompat = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecuteContractCompat.typeUrl, + encoders: toEncoders(MsgExecuteContractCompat), + converters: toConverters(MsgExecuteContractCompat) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createRegisterContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRegisterContract.typeUrl, + encoders: toEncoders(MsgRegisterContract), + converters: toConverters(MsgRegisterContract) +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.msg.ts b/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.msg.ts deleted file mode 100644 index 10baf37e..00000000 --- a/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgUpdateContract, MsgUpdateContractResponse, MsgActivateContract, MsgActivateContractResponse, MsgDeactivateContract, MsgDeactivateContractResponse, MsgExecuteContractCompat, MsgExecuteContractCompatResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgRegisterContract, MsgRegisterContractResponse } from "./tx"; -/** Msg defines the wasmx Msg service. */ -export interface Msg { - updateRegistryContractParams(request: MsgUpdateContract): Promise; - activateRegistryContract(request: MsgActivateContract): Promise; - deactivateRegistryContract(request: MsgDeactivateContract): Promise; - executeContractCompat(request: MsgExecuteContractCompat): Promise; - updateParams(request: MsgUpdateParams): Promise; - registerContract(request: MsgRegisterContract): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* UpdateRegistryContractParams */ - updateRegistryContractParams = async (request: MsgUpdateContract): Promise => { - const data = MsgUpdateContract.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Msg", "UpdateRegistryContractParams", data); - return promise.then(data => MsgUpdateContractResponse.decode(new BinaryReader(data))); - }; - /* ActivateRegistryContract */ - activateRegistryContract = async (request: MsgActivateContract): Promise => { - const data = MsgActivateContract.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Msg", "ActivateRegistryContract", data); - return promise.then(data => MsgActivateContractResponse.decode(new BinaryReader(data))); - }; - /* DeactivateRegistryContract */ - deactivateRegistryContract = async (request: MsgDeactivateContract): Promise => { - const data = MsgDeactivateContract.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Msg", "DeactivateRegistryContract", data); - return promise.then(data => MsgDeactivateContractResponse.decode(new BinaryReader(data))); - }; - /* ExecuteContractCompat */ - executeContractCompat = async (request: MsgExecuteContractCompat): Promise => { - const data = MsgExecuteContractCompat.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Msg", "ExecuteContractCompat", data); - return promise.then(data => MsgExecuteContractCompatResponse.decode(new BinaryReader(data))); - }; - /* UpdateParams */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; - /* RegisterContract */ - registerContract = async (request: MsgRegisterContract): Promise => { - const data = MsgRegisterContract.encode(request).finish(); - const promise = this.rpc.request("injective.wasmx.v1.Msg", "RegisterContract", data); - return promise.then(data => MsgRegisterContractResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..31de82d9 --- /dev/null +++ b/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts @@ -0,0 +1,21 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; +import { createUpdateRegistryContractParams, createActivateRegistryContract, createDeactivateRegistryContract, createExecuteContractCompat, createUpdateParams, createRegisterContract } from "./tx.rpc.func.ts"; +export const useUpdateRegistryContractParams = buildUseVueMutation({ + builderMutationFn: createUpdateRegistryContractParams +}); +export const useActivateRegistryContract = buildUseVueMutation({ + builderMutationFn: createActivateRegistryContract +}); +export const useDeactivateRegistryContract = buildUseVueMutation({ + builderMutationFn: createDeactivateRegistryContract +}); +export const useExecuteContractCompat = buildUseVueMutation({ + builderMutationFn: createExecuteContractCompat +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useRegisterContract = buildUseVueMutation({ + builderMutationFn: createRegisterContract +}); \ No newline at end of file diff --git a/libs/injective-vue/src/injective/wasmx/v1/tx.ts b/libs/injective-vue/src/injective/wasmx/v1/tx.ts index f9f749fa..a8b9a574 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/tx.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/tx.ts @@ -3,7 +3,6 @@ import { ContractRegistrationRequest, ContractRegistrationRequestAmino } from ". import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgExecuteContractCompat submits the given message data to a smart contract, * compatible with EIP712 @@ -18,12 +17,6 @@ export interface MsgExecuteContractCompat { /** Funds coins that are transferred to the contract on execution */ funds: string; } -export interface ReactiveMsgExecuteContractCompat { - sender: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; -} export interface MsgExecuteContractCompatProtoMsg { typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompat"; value: Uint8Array; @@ -51,9 +44,6 @@ export interface MsgExecuteContractCompatResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgExecuteContractCompatResponse { - data: ComputedRef; -} export interface MsgExecuteContractCompatResponseProtoMsg { typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompatResponse"; value: Uint8Array; @@ -78,13 +68,6 @@ export interface MsgUpdateContract { /** optional - admin account that will be allowed to perform any changes */ adminAddress?: string; } -export interface ReactiveMsgUpdateContract { - sender: ComputedRef; - contractAddress: ComputedRef; - gasLimit: ComputedRef; - gasPrice: ComputedRef; - adminAddress?: ComputedRef; -} export interface MsgUpdateContractProtoMsg { typeUrl: "/injective.wasmx.v1.MsgUpdateContract"; value: Uint8Array; @@ -105,7 +88,6 @@ export interface MsgUpdateContractAminoMsg { value: MsgUpdateContractAmino; } export interface MsgUpdateContractResponse {} -export interface ReactiveMsgUpdateContractResponse {} export interface MsgUpdateContractResponseProtoMsg { typeUrl: "/injective.wasmx.v1.MsgUpdateContractResponse"; value: Uint8Array; @@ -120,10 +102,6 @@ export interface MsgActivateContract { /** Unique Identifier for contract instance to be activated. */ contractAddress: string; } -export interface ReactiveMsgActivateContract { - sender: ComputedRef; - contractAddress: ComputedRef; -} export interface MsgActivateContractProtoMsg { typeUrl: "/injective.wasmx.v1.MsgActivateContract"; value: Uint8Array; @@ -138,7 +116,6 @@ export interface MsgActivateContractAminoMsg { value: MsgActivateContractAmino; } export interface MsgActivateContractResponse {} -export interface ReactiveMsgActivateContractResponse {} export interface MsgActivateContractResponseProtoMsg { typeUrl: "/injective.wasmx.v1.MsgActivateContractResponse"; value: Uint8Array; @@ -153,10 +130,6 @@ export interface MsgDeactivateContract { /** Unique Identifier for contract instance to be deactivated. */ contractAddress: string; } -export interface ReactiveMsgDeactivateContract { - sender: ComputedRef; - contractAddress: ComputedRef; -} export interface MsgDeactivateContractProtoMsg { typeUrl: "/injective.wasmx.v1.MsgDeactivateContract"; value: Uint8Array; @@ -171,7 +144,6 @@ export interface MsgDeactivateContractAminoMsg { value: MsgDeactivateContractAmino; } export interface MsgDeactivateContractResponse {} -export interface ReactiveMsgDeactivateContractResponse {} export interface MsgDeactivateContractResponseProtoMsg { typeUrl: "/injective.wasmx.v1.MsgDeactivateContractResponse"; value: Uint8Array; @@ -191,10 +163,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/injective.wasmx.v1.MsgUpdateParams"; value: Uint8Array; @@ -214,7 +182,6 @@ export interface MsgUpdateParamsAminoMsg { value: MsgUpdateParamsAmino; } export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/injective.wasmx.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -228,10 +195,6 @@ export interface MsgRegisterContract { sender: string; contractRegistrationRequest: ContractRegistrationRequest; } -export interface ReactiveMsgRegisterContract { - sender: ComputedRef; - contractRegistrationRequest: ComputedRef; -} export interface MsgRegisterContractProtoMsg { typeUrl: "/injective.wasmx.v1.MsgRegisterContract"; value: Uint8Array; @@ -245,7 +208,6 @@ export interface MsgRegisterContractAminoMsg { value: MsgRegisterContractAmino; } export interface MsgRegisterContractResponse {} -export interface ReactiveMsgRegisterContractResponse {} export interface MsgRegisterContractResponseProtoMsg { typeUrl: "/injective.wasmx.v1.MsgRegisterContractResponse"; value: Uint8Array; diff --git a/libs/injective-vue/src/injective/wasmx/v1/wasmx.ts b/libs/injective-vue/src/injective/wasmx/v1/wasmx.ts index 50cdb9fc..c52d253a 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/wasmx.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/wasmx.ts @@ -3,7 +3,6 @@ import { FundingMode } from "./proposal"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; export interface Params { /** * Set the status to active to indicate that contracts can be executed in @@ -27,13 +26,6 @@ export interface Params { minGasPrice: bigint; registerContractAccess: AccessConfig; } -export interface ReactiveParams { - isExecutionEnabled: ComputedRef; - maxBeginBlockTotalGas: ComputedRef; - maxContractGasLimit: ComputedRef; - minGasPrice: ComputedRef; - registerContractAccess: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/injective.wasmx.v1.Params"; value: Uint8Array; @@ -87,15 +79,6 @@ export interface RegisteredContract { /** funding mode */ fundMode: FundingMode; } -export interface ReactiveRegisteredContract { - gasLimit: ComputedRef; - gasPrice: ComputedRef; - isExecutable: ComputedRef; - codeId?: ComputedRef; - adminAddress?: ComputedRef; - granterAddress?: ComputedRef; - fundMode: ComputedRef; -} export interface RegisteredContractProtoMsg { typeUrl: "/injective.wasmx.v1.RegisteredContract"; value: Uint8Array; diff --git a/libs/injective-vue/src/registry.ts b/libs/injective-vue/src/registry.ts index 7356722f..1581e912 100644 --- a/libs/injective-vue/src/registry.ts +++ b/libs/injective-vue/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/tendermint/abci/types.ts b/libs/injective-vue/src/tendermint/abci/types.ts index b7d76036..734c33b1 100644 --- a/libs/injective-vue/src/tendermint/abci/types.ts +++ b/libs/injective-vue/src/tendermint/abci/types.ts @@ -6,7 +6,6 @@ import { BlockIDFlag } from "../types/validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes, isSet } from "../../helpers"; -import { ComputedRef } from "vue"; export enum CheckTxType { NEW = 0, RECHECK = 1, @@ -295,24 +294,6 @@ export interface Request { verifyVoteExtension?: RequestVerifyVoteExtension; finalizeBlock?: RequestFinalizeBlock; } -export interface ReactiveRequest { - echo?: ComputedRef; - flush?: ComputedRef; - info?: ComputedRef; - initChain?: ComputedRef; - query?: ComputedRef; - checkTx?: ComputedRef; - commit?: ComputedRef; - listSnapshots?: ComputedRef; - offerSnapshot?: ComputedRef; - loadSnapshotChunk?: ComputedRef; - applySnapshotChunk?: ComputedRef; - prepareProposal?: ComputedRef; - processProposal?: ComputedRef; - extendVote?: ComputedRef; - verifyVoteExtension?: ComputedRef; - finalizeBlock?: ComputedRef; -} export interface RequestProtoMsg { typeUrl: "/tendermint.abci.Request"; value: Uint8Array; @@ -342,9 +323,6 @@ export interface RequestAminoMsg { export interface RequestEcho { message: string; } -export interface ReactiveRequestEcho { - message: ComputedRef; -} export interface RequestEchoProtoMsg { typeUrl: "/tendermint.abci.RequestEcho"; value: Uint8Array; @@ -357,7 +335,6 @@ export interface RequestEchoAminoMsg { value: RequestEchoAmino; } export interface RequestFlush {} -export interface ReactiveRequestFlush {} export interface RequestFlushProtoMsg { typeUrl: "/tendermint.abci.RequestFlush"; value: Uint8Array; @@ -373,12 +350,6 @@ export interface RequestInfo { p2pVersion: bigint; abciVersion: string; } -export interface ReactiveRequestInfo { - version: ComputedRef; - blockVersion: ComputedRef; - p2pVersion: ComputedRef; - abciVersion: ComputedRef; -} export interface RequestInfoProtoMsg { typeUrl: "/tendermint.abci.RequestInfo"; value: Uint8Array; @@ -401,14 +372,6 @@ export interface RequestInitChain { appStateBytes: Uint8Array; initialHeight: bigint; } -export interface ReactiveRequestInitChain { - time: ComputedRef; - chainId: ComputedRef; - consensusParams?: ComputedRef; - validators: ComputedRef; - appStateBytes: ComputedRef; - initialHeight: ComputedRef; -} export interface RequestInitChainProtoMsg { typeUrl: "/tendermint.abci.RequestInitChain"; value: Uint8Array; @@ -431,12 +394,6 @@ export interface RequestQuery { height: bigint; prove: boolean; } -export interface ReactiveRequestQuery { - data: ComputedRef; - path: ComputedRef; - height: ComputedRef; - prove: ComputedRef; -} export interface RequestQueryProtoMsg { typeUrl: "/tendermint.abci.RequestQuery"; value: Uint8Array; @@ -455,10 +412,6 @@ export interface RequestCheckTx { tx: Uint8Array; type: CheckTxType; } -export interface ReactiveRequestCheckTx { - tx: ComputedRef; - type: ComputedRef; -} export interface RequestCheckTxProtoMsg { typeUrl: "/tendermint.abci.RequestCheckTx"; value: Uint8Array; @@ -472,7 +425,6 @@ export interface RequestCheckTxAminoMsg { value: RequestCheckTxAmino; } export interface RequestCommit {} -export interface ReactiveRequestCommit {} export interface RequestCommitProtoMsg { typeUrl: "/tendermint.abci.RequestCommit"; value: Uint8Array; @@ -484,7 +436,6 @@ export interface RequestCommitAminoMsg { } /** lists available snapshots */ export interface RequestListSnapshots {} -export interface ReactiveRequestListSnapshots {} export interface RequestListSnapshotsProtoMsg { typeUrl: "/tendermint.abci.RequestListSnapshots"; value: Uint8Array; @@ -502,10 +453,6 @@ export interface RequestOfferSnapshot { /** light client-verified app hash for snapshot height */ appHash: Uint8Array; } -export interface ReactiveRequestOfferSnapshot { - snapshot?: ComputedRef; - appHash: ComputedRef; -} export interface RequestOfferSnapshotProtoMsg { typeUrl: "/tendermint.abci.RequestOfferSnapshot"; value: Uint8Array; @@ -527,11 +474,6 @@ export interface RequestLoadSnapshotChunk { format: number; chunk: number; } -export interface ReactiveRequestLoadSnapshotChunk { - height: ComputedRef; - format: ComputedRef; - chunk: ComputedRef; -} export interface RequestLoadSnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk"; value: Uint8Array; @@ -552,11 +494,6 @@ export interface RequestApplySnapshotChunk { chunk: Uint8Array; sender: string; } -export interface ReactiveRequestApplySnapshotChunk { - index: ComputedRef; - chunk: ComputedRef; - sender: ComputedRef; -} export interface RequestApplySnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.RequestApplySnapshotChunk"; value: Uint8Array; @@ -587,16 +524,6 @@ export interface RequestPrepareProposal { /** address of the public key of the validator proposing the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestPrepareProposal { - maxTxBytes: ComputedRef; - txs: ComputedRef; - localLastCommit: ComputedRef; - misbehavior: ComputedRef; - height: ComputedRef; - time: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestPrepareProposalProtoMsg { typeUrl: "/tendermint.abci.RequestPrepareProposal"; value: Uint8Array; @@ -633,16 +560,6 @@ export interface RequestProcessProposal { /** address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestProcessProposal { - txs: ComputedRef; - proposedLastCommit: ComputedRef; - misbehavior: ComputedRef; - hash: ComputedRef; - height: ComputedRef; - time: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestProcessProposalProtoMsg { typeUrl: "/tendermint.abci.RequestProcessProposal"; value: Uint8Array; @@ -678,16 +595,6 @@ export interface RequestExtendVote { /** address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestExtendVote { - hash: ComputedRef; - height: ComputedRef; - time: ComputedRef; - txs: ComputedRef; - proposedLastCommit: ComputedRef; - misbehavior: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestExtendVoteProtoMsg { typeUrl: "/tendermint.abci.RequestExtendVote"; value: Uint8Array; @@ -720,12 +627,6 @@ export interface RequestVerifyVoteExtension { height: bigint; voteExtension: Uint8Array; } -export interface ReactiveRequestVerifyVoteExtension { - hash: ComputedRef; - validatorAddress: ComputedRef; - height: ComputedRef; - voteExtension: ComputedRef; -} export interface RequestVerifyVoteExtensionProtoMsg { typeUrl: "/tendermint.abci.RequestVerifyVoteExtension"; value: Uint8Array; @@ -755,16 +656,6 @@ export interface RequestFinalizeBlock { /** proposer_address is the address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestFinalizeBlock { - txs: ComputedRef; - decidedLastCommit: ComputedRef; - misbehavior: ComputedRef; - hash: ComputedRef; - height: ComputedRef; - time: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestFinalizeBlockProtoMsg { typeUrl: "/tendermint.abci.RequestFinalizeBlock"; value: Uint8Array; @@ -804,25 +695,6 @@ export interface Response { verifyVoteExtension?: ResponseVerifyVoteExtension; finalizeBlock?: ResponseFinalizeBlock; } -export interface ReactiveResponse { - exception?: ComputedRef; - echo?: ComputedRef; - flush?: ComputedRef; - info?: ComputedRef; - initChain?: ComputedRef; - query?: ComputedRef; - checkTx?: ComputedRef; - commit?: ComputedRef; - listSnapshots?: ComputedRef; - offerSnapshot?: ComputedRef; - loadSnapshotChunk?: ComputedRef; - applySnapshotChunk?: ComputedRef; - prepareProposal?: ComputedRef; - processProposal?: ComputedRef; - extendVote?: ComputedRef; - verifyVoteExtension?: ComputedRef; - finalizeBlock?: ComputedRef; -} export interface ResponseProtoMsg { typeUrl: "/tendermint.abci.Response"; value: Uint8Array; @@ -854,9 +726,6 @@ export interface ResponseAminoMsg { export interface ResponseException { error: string; } -export interface ReactiveResponseException { - error: ComputedRef; -} export interface ResponseExceptionProtoMsg { typeUrl: "/tendermint.abci.ResponseException"; value: Uint8Array; @@ -872,9 +741,6 @@ export interface ResponseExceptionAminoMsg { export interface ResponseEcho { message: string; } -export interface ReactiveResponseEcho { - message: ComputedRef; -} export interface ResponseEchoProtoMsg { typeUrl: "/tendermint.abci.ResponseEcho"; value: Uint8Array; @@ -887,7 +753,6 @@ export interface ResponseEchoAminoMsg { value: ResponseEchoAmino; } export interface ResponseFlush {} -export interface ReactiveResponseFlush {} export interface ResponseFlushProtoMsg { typeUrl: "/tendermint.abci.ResponseFlush"; value: Uint8Array; @@ -904,13 +769,6 @@ export interface ResponseInfo { lastBlockHeight: bigint; lastBlockAppHash: Uint8Array; } -export interface ReactiveResponseInfo { - data: ComputedRef; - version: ComputedRef; - appVersion: ComputedRef; - lastBlockHeight: ComputedRef; - lastBlockAppHash: ComputedRef; -} export interface ResponseInfoProtoMsg { typeUrl: "/tendermint.abci.ResponseInfo"; value: Uint8Array; @@ -931,11 +789,6 @@ export interface ResponseInitChain { validators: ValidatorUpdate[]; appHash: Uint8Array; } -export interface ReactiveResponseInitChain { - consensusParams?: ComputedRef; - validators: ComputedRef; - appHash: ComputedRef; -} export interface ResponseInitChainProtoMsg { typeUrl: "/tendermint.abci.ResponseInitChain"; value: Uint8Array; @@ -962,17 +815,6 @@ export interface ResponseQuery { height: bigint; codespace: string; } -export interface ReactiveResponseQuery { - code: ComputedRef; - log: ComputedRef; - info: ComputedRef; - index: ComputedRef; - key: ComputedRef; - value: ComputedRef; - proofOps?: ComputedRef; - height: ComputedRef; - codespace: ComputedRef; -} export interface ResponseQueryProtoMsg { typeUrl: "/tendermint.abci.ResponseQuery"; value: Uint8Array; @@ -1006,16 +848,6 @@ export interface ResponseCheckTx { events: Event[]; codespace: string; } -export interface ReactiveResponseCheckTx { - code: ComputedRef; - data: ComputedRef; - log: ComputedRef; - info: ComputedRef; - gasWanted: ComputedRef; - gasUsed: ComputedRef; - events: ComputedRef; - codespace: ComputedRef; -} export interface ResponseCheckTxProtoMsg { typeUrl: "/tendermint.abci.ResponseCheckTx"; value: Uint8Array; @@ -1039,9 +871,6 @@ export interface ResponseCheckTxAminoMsg { export interface ResponseCommit { retainHeight: bigint; } -export interface ReactiveResponseCommit { - retainHeight: ComputedRef; -} export interface ResponseCommitProtoMsg { typeUrl: "/tendermint.abci.ResponseCommit"; value: Uint8Array; @@ -1056,9 +885,6 @@ export interface ResponseCommitAminoMsg { export interface ResponseListSnapshots { snapshots: Snapshot[]; } -export interface ReactiveResponseListSnapshots { - snapshots: ComputedRef; -} export interface ResponseListSnapshotsProtoMsg { typeUrl: "/tendermint.abci.ResponseListSnapshots"; value: Uint8Array; @@ -1073,9 +899,6 @@ export interface ResponseListSnapshotsAminoMsg { export interface ResponseOfferSnapshot { result: ResponseOfferSnapshot_Result; } -export interface ReactiveResponseOfferSnapshot { - result: ComputedRef; -} export interface ResponseOfferSnapshotProtoMsg { typeUrl: "/tendermint.abci.ResponseOfferSnapshot"; value: Uint8Array; @@ -1090,9 +913,6 @@ export interface ResponseOfferSnapshotAminoMsg { export interface ResponseLoadSnapshotChunk { chunk: Uint8Array; } -export interface ReactiveResponseLoadSnapshotChunk { - chunk: ComputedRef; -} export interface ResponseLoadSnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk"; value: Uint8Array; @@ -1111,11 +931,6 @@ export interface ResponseApplySnapshotChunk { /** Chunk senders to reject and ban */ rejectSenders: string[]; } -export interface ReactiveResponseApplySnapshotChunk { - result: ComputedRef; - refetchChunks: ComputedRef; - rejectSenders: ComputedRef; -} export interface ResponseApplySnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk"; value: Uint8Array; @@ -1134,9 +949,6 @@ export interface ResponseApplySnapshotChunkAminoMsg { export interface ResponsePrepareProposal { txs: Uint8Array[]; } -export interface ReactiveResponsePrepareProposal { - txs: ComputedRef; -} export interface ResponsePrepareProposalProtoMsg { typeUrl: "/tendermint.abci.ResponsePrepareProposal"; value: Uint8Array; @@ -1151,9 +963,6 @@ export interface ResponsePrepareProposalAminoMsg { export interface ResponseProcessProposal { status: ResponseProcessProposal_ProposalStatus; } -export interface ReactiveResponseProcessProposal { - status: ComputedRef; -} export interface ResponseProcessProposalProtoMsg { typeUrl: "/tendermint.abci.ResponseProcessProposal"; value: Uint8Array; @@ -1168,9 +977,6 @@ export interface ResponseProcessProposalAminoMsg { export interface ResponseExtendVote { voteExtension: Uint8Array; } -export interface ReactiveResponseExtendVote { - voteExtension: ComputedRef; -} export interface ResponseExtendVoteProtoMsg { typeUrl: "/tendermint.abci.ResponseExtendVote"; value: Uint8Array; @@ -1185,9 +991,6 @@ export interface ResponseExtendVoteAminoMsg { export interface ResponseVerifyVoteExtension { status: ResponseVerifyVoteExtension_VerifyStatus; } -export interface ReactiveResponseVerifyVoteExtension { - status: ComputedRef; -} export interface ResponseVerifyVoteExtensionProtoMsg { typeUrl: "/tendermint.abci.ResponseVerifyVoteExtension"; value: Uint8Array; @@ -1218,13 +1021,6 @@ export interface ResponseFinalizeBlock { */ appHash: Uint8Array; } -export interface ReactiveResponseFinalizeBlock { - events: ComputedRef; - txResults: ComputedRef; - validatorUpdates: ComputedRef; - consensusParamUpdates?: ComputedRef; - appHash: ComputedRef; -} export interface ResponseFinalizeBlockProtoMsg { typeUrl: "/tendermint.abci.ResponseFinalizeBlock"; value: Uint8Array; @@ -1256,10 +1052,6 @@ export interface CommitInfo { round: number; votes: VoteInfo[]; } -export interface ReactiveCommitInfo { - round: ComputedRef; - votes: ComputedRef; -} export interface CommitInfoProtoMsg { typeUrl: "/tendermint.abci.CommitInfo"; value: Uint8Array; @@ -1286,10 +1078,6 @@ export interface ExtendedCommitInfo { */ votes: ExtendedVoteInfo[]; } -export interface ReactiveExtendedCommitInfo { - round: ComputedRef; - votes: ComputedRef; -} export interface ExtendedCommitInfoProtoMsg { typeUrl: "/tendermint.abci.ExtendedCommitInfo"; value: Uint8Array; @@ -1321,10 +1109,6 @@ export interface Event { type: string; attributes: EventAttribute[]; } -export interface ReactiveEvent { - type: ComputedRef; - attributes: ComputedRef; -} export interface EventProtoMsg { typeUrl: "/tendermint.abci.Event"; value: Uint8Array; @@ -1349,11 +1133,6 @@ export interface EventAttribute { /** nondeterministic */ index: boolean; } -export interface ReactiveEventAttribute { - key: ComputedRef; - value: ComputedRef; - index: ComputedRef; -} export interface EventAttributeProtoMsg { typeUrl: "/tendermint.abci.EventAttribute"; value: Uint8Array; @@ -1386,16 +1165,6 @@ export interface ExecTxResult { events: Event[]; codespace: string; } -export interface ReactiveExecTxResult { - code: ComputedRef; - data: ComputedRef; - log: ComputedRef; - info: ComputedRef; - gasWanted: ComputedRef; - gasUsed: ComputedRef; - events: ComputedRef; - codespace: ComputedRef; -} export interface ExecTxResultProtoMsg { typeUrl: "/tendermint.abci.ExecTxResult"; value: Uint8Array; @@ -1432,12 +1201,6 @@ export interface TxResult { tx: Uint8Array; result: ExecTxResult; } -export interface ReactiveTxResult { - height: ComputedRef; - index: ComputedRef; - tx: ComputedRef; - result: ComputedRef; -} export interface TxResultProtoMsg { typeUrl: "/tendermint.abci.TxResult"; value: Uint8Array; @@ -1463,10 +1226,6 @@ export interface Validator { /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ power: bigint; } -export interface ReactiveValidator { - address: ComputedRef; - power: ComputedRef; -} export interface ValidatorProtoMsg { typeUrl: "/tendermint.abci.Validator"; value: Uint8Array; @@ -1485,10 +1244,6 @@ export interface ValidatorUpdate { pubKey: PublicKey; power: bigint; } -export interface ReactiveValidatorUpdate { - pubKey: ComputedRef; - power: ComputedRef; -} export interface ValidatorUpdateProtoMsg { typeUrl: "/tendermint.abci.ValidatorUpdate"; value: Uint8Array; @@ -1505,10 +1260,6 @@ export interface VoteInfo { validator: Validator; blockIdFlag: BlockIDFlag; } -export interface ReactiveVoteInfo { - validator: ComputedRef; - blockIdFlag: ComputedRef; -} export interface VoteInfoProtoMsg { typeUrl: "/tendermint.abci.VoteInfo"; value: Uint8Array; @@ -1531,12 +1282,6 @@ export interface ExtendedVoteInfo { /** block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all */ blockIdFlag: BlockIDFlag; } -export interface ReactiveExtendedVoteInfo { - validator: ComputedRef; - voteExtension: ComputedRef; - extensionSignature: ComputedRef; - blockIdFlag: ComputedRef; -} export interface ExtendedVoteInfoProtoMsg { typeUrl: "/tendermint.abci.ExtendedVoteInfo"; value: Uint8Array; @@ -1570,13 +1315,6 @@ export interface Misbehavior { */ totalVotingPower: bigint; } -export interface ReactiveMisbehavior { - type: ComputedRef; - validator: ComputedRef; - height: ComputedRef; - time: ComputedRef; - totalVotingPower: ComputedRef; -} export interface MisbehaviorProtoMsg { typeUrl: "/tendermint.abci.Misbehavior"; value: Uint8Array; @@ -1612,13 +1350,6 @@ export interface Snapshot { /** Arbitrary application metadata */ metadata: Uint8Array; } -export interface ReactiveSnapshot { - height: ComputedRef; - format: ComputedRef; - chunks: ComputedRef; - hash: ComputedRef; - metadata: ComputedRef; -} export interface SnapshotProtoMsg { typeUrl: "/tendermint.abci.Snapshot"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/crypto/keys.ts b/libs/injective-vue/src/tendermint/crypto/keys.ts index ad49df83..9dc8476b 100644 --- a/libs/injective-vue/src/tendermint/crypto/keys.ts +++ b/libs/injective-vue/src/tendermint/crypto/keys.ts @@ -1,16 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** PublicKey defines the keys available for use with Validators */ export interface PublicKey { ed25519?: Uint8Array; secp256k1?: Uint8Array; } -export interface ReactivePublicKey { - ed25519?: ComputedRef; - secp256k1?: ComputedRef; -} export interface PublicKeyProtoMsg { typeUrl: "/tendermint.crypto.PublicKey"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/crypto/proof.ts b/libs/injective-vue/src/tendermint/crypto/proof.ts index f0d8f8de..5f372fcf 100644 --- a/libs/injective-vue/src/tendermint/crypto/proof.ts +++ b/libs/injective-vue/src/tendermint/crypto/proof.ts @@ -1,19 +1,12 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; export interface Proof { total: bigint; index: bigint; leafHash: Uint8Array; aunts: Uint8Array[]; } -export interface ReactiveProof { - total: ComputedRef; - index: ComputedRef; - leafHash: ComputedRef; - aunts: ComputedRef; -} export interface ProofProtoMsg { typeUrl: "/tendermint.crypto.Proof"; value: Uint8Array; @@ -34,10 +27,6 @@ export interface ValueOp { /** To encode in ProofOp.Data */ proof?: Proof; } -export interface ReactiveValueOp { - key: ComputedRef; - proof?: ComputedRef; -} export interface ValueOpProtoMsg { typeUrl: "/tendermint.crypto.ValueOp"; value: Uint8Array; @@ -57,11 +46,6 @@ export interface DominoOp { input: string; output: string; } -export interface ReactiveDominoOp { - key: ComputedRef; - input: ComputedRef; - output: ComputedRef; -} export interface DominoOpProtoMsg { typeUrl: "/tendermint.crypto.DominoOp"; value: Uint8Array; @@ -85,11 +69,6 @@ export interface ProofOp { key: Uint8Array; data: Uint8Array; } -export interface ReactiveProofOp { - type: ComputedRef; - key: ComputedRef; - data: ComputedRef; -} export interface ProofOpProtoMsg { typeUrl: "/tendermint.crypto.ProofOp"; value: Uint8Array; @@ -112,9 +91,6 @@ export interface ProofOpAminoMsg { export interface ProofOps { ops: ProofOp[]; } -export interface ReactiveProofOps { - ops: ComputedRef; -} export interface ProofOpsProtoMsg { typeUrl: "/tendermint.crypto.ProofOps"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/types/block.ts b/libs/injective-vue/src/tendermint/types/block.ts index cf8af491..0c40690e 100644 --- a/libs/injective-vue/src/tendermint/types/block.ts +++ b/libs/injective-vue/src/tendermint/types/block.ts @@ -3,19 +3,12 @@ import { EvidenceList, EvidenceListAmino } from "./evidence"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial } from "../../helpers"; -import { ComputedRef } from "vue"; export interface Block { header: Header; data: Data; evidence: EvidenceList; lastCommit?: Commit; } -export interface ReactiveBlock { - header: ComputedRef
; - data: ComputedRef; - evidence: ComputedRef; - lastCommit?: ComputedRef; -} export interface BlockProtoMsg { typeUrl: "/tendermint.types.Block"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/types/evidence.ts b/libs/injective-vue/src/tendermint/types/evidence.ts index 661b4f13..ad125f99 100644 --- a/libs/injective-vue/src/tendermint/types/evidence.ts +++ b/libs/injective-vue/src/tendermint/types/evidence.ts @@ -4,15 +4,10 @@ import { Validator, ValidatorAmino } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial, toTimestamp, fromTimestamp } from "../../helpers"; -import { ComputedRef } from "vue"; export interface Evidence { duplicateVoteEvidence?: DuplicateVoteEvidence; lightClientAttackEvidence?: LightClientAttackEvidence; } -export interface ReactiveEvidence { - duplicateVoteEvidence?: ComputedRef; - lightClientAttackEvidence?: ComputedRef; -} export interface EvidenceProtoMsg { typeUrl: "/tendermint.types.Evidence"; value: Uint8Array; @@ -33,13 +28,6 @@ export interface DuplicateVoteEvidence { validatorPower: bigint; timestamp: Date; } -export interface ReactiveDuplicateVoteEvidence { - voteA?: ComputedRef; - voteB?: ComputedRef; - totalVotingPower: ComputedRef; - validatorPower: ComputedRef; - timestamp: ComputedRef; -} export interface DuplicateVoteEvidenceProtoMsg { typeUrl: "/tendermint.types.DuplicateVoteEvidence"; value: Uint8Array; @@ -64,13 +52,6 @@ export interface LightClientAttackEvidence { totalVotingPower: bigint; timestamp: Date; } -export interface ReactiveLightClientAttackEvidence { - conflictingBlock?: ComputedRef; - commonHeight: ComputedRef; - byzantineValidators: ComputedRef; - totalVotingPower: ComputedRef; - timestamp: ComputedRef; -} export interface LightClientAttackEvidenceProtoMsg { typeUrl: "/tendermint.types.LightClientAttackEvidence"; value: Uint8Array; @@ -90,9 +71,6 @@ export interface LightClientAttackEvidenceAminoMsg { export interface EvidenceList { evidence: Evidence[]; } -export interface ReactiveEvidenceList { - evidence: ComputedRef; -} export interface EvidenceListProtoMsg { typeUrl: "/tendermint.types.EvidenceList"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/types/params.ts b/libs/injective-vue/src/tendermint/types/params.ts index 16da8bfc..317e7b84 100644 --- a/libs/injective-vue/src/tendermint/types/params.ts +++ b/libs/injective-vue/src/tendermint/types/params.ts @@ -2,7 +2,6 @@ import { Duration, DurationAmino } from "../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial } from "../../helpers"; -import { ComputedRef } from "vue"; /** * ConsensusParams contains consensus critical parameters that determine the * validity of blocks. @@ -14,13 +13,6 @@ export interface ConsensusParams { version?: VersionParams; abci?: ABCIParams; } -export interface ReactiveConsensusParams { - block?: ComputedRef; - evidence?: ComputedRef; - validator?: ComputedRef; - version?: ComputedRef; - abci?: ComputedRef; -} export interface ConsensusParamsProtoMsg { typeUrl: "/tendermint.types.ConsensusParams"; value: Uint8Array; @@ -53,10 +45,6 @@ export interface BlockParams { */ maxGas: bigint; } -export interface ReactiveBlockParams { - maxBytes: ComputedRef; - maxGas: ComputedRef; -} export interface BlockParamsProtoMsg { typeUrl: "/tendermint.types.BlockParams"; value: Uint8Array; @@ -102,11 +90,6 @@ export interface EvidenceParams { */ maxBytes: bigint; } -export interface ReactiveEvidenceParams { - maxAgeNumBlocks: ComputedRef; - maxAgeDuration: ComputedRef; - maxBytes: ComputedRef; -} export interface EvidenceParamsProtoMsg { typeUrl: "/tendermint.types.EvidenceParams"; value: Uint8Array; @@ -146,9 +129,6 @@ export interface EvidenceParamsAminoMsg { export interface ValidatorParams { pubKeyTypes: string[]; } -export interface ReactiveValidatorParams { - pubKeyTypes: ComputedRef; -} export interface ValidatorParamsProtoMsg { typeUrl: "/tendermint.types.ValidatorParams"; value: Uint8Array; @@ -168,9 +148,6 @@ export interface ValidatorParamsAminoMsg { export interface VersionParams { app: bigint; } -export interface ReactiveVersionParams { - app: ComputedRef; -} export interface VersionParamsProtoMsg { typeUrl: "/tendermint.types.VersionParams"; value: Uint8Array; @@ -192,10 +169,6 @@ export interface HashedParams { blockMaxBytes: bigint; blockMaxGas: bigint; } -export interface ReactiveHashedParams { - blockMaxBytes: ComputedRef; - blockMaxGas: ComputedRef; -} export interface HashedParamsProtoMsg { typeUrl: "/tendermint.types.HashedParams"; value: Uint8Array; @@ -228,9 +201,6 @@ export interface ABCIParams { */ voteExtensionsEnableHeight: bigint; } -export interface ReactiveABCIParams { - voteExtensionsEnableHeight: ComputedRef; -} export interface ABCIParamsProtoMsg { typeUrl: "/tendermint.types.ABCIParams"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/types/types.ts b/libs/injective-vue/src/tendermint/types/types.ts index 6863c83a..c44fd8af 100644 --- a/libs/injective-vue/src/tendermint/types/types.ts +++ b/libs/injective-vue/src/tendermint/types/types.ts @@ -5,7 +5,6 @@ import { BlockIDFlag, ValidatorSet, ValidatorSetAmino } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp, isSet } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** SignedMsgType is a type of signed message in the consensus. */ export enum SignedMsgType { SIGNED_MSG_TYPE_UNKNOWN = 0, @@ -57,10 +56,6 @@ export interface PartSetHeader { total: number; hash: Uint8Array; } -export interface ReactivePartSetHeader { - total: ComputedRef; - hash: ComputedRef; -} export interface PartSetHeaderProtoMsg { typeUrl: "/tendermint.types.PartSetHeader"; value: Uint8Array; @@ -79,11 +74,6 @@ export interface Part { bytes: Uint8Array; proof: Proof; } -export interface ReactivePart { - index: ComputedRef; - bytes: ComputedRef; - proof: ComputedRef; -} export interface PartProtoMsg { typeUrl: "/tendermint.types.Part"; value: Uint8Array; @@ -102,10 +92,6 @@ export interface BlockID { hash: Uint8Array; partSetHeader: PartSetHeader; } -export interface ReactiveBlockID { - hash: ComputedRef; - partSetHeader: ComputedRef; -} export interface BlockIDProtoMsg { typeUrl: "/tendermint.types.BlockID"; value: Uint8Array; @@ -147,22 +133,6 @@ export interface Header { /** original proposer of the block */ proposerAddress: Uint8Array; } -export interface ReactiveHeader { - version: ComputedRef; - chainId: ComputedRef; - height: ComputedRef; - time: ComputedRef; - lastBlockId: ComputedRef; - lastCommitHash: ComputedRef; - dataHash: ComputedRef; - validatorsHash: ComputedRef; - nextValidatorsHash: ComputedRef; - consensusHash: ComputedRef; - appHash: ComputedRef; - lastResultsHash: ComputedRef; - evidenceHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface HeaderProtoMsg { typeUrl: "/tendermint.types.Header"; value: Uint8Array; @@ -208,9 +178,6 @@ export interface Data { */ txs: Uint8Array[]; } -export interface ReactiveData { - txs: ComputedRef; -} export interface DataProtoMsg { typeUrl: "/tendermint.types.Data"; value: Uint8Array; @@ -258,18 +225,6 @@ export interface Vote { */ extensionSignature: Uint8Array; } -export interface ReactiveVote { - type: ComputedRef; - height: ComputedRef; - round: ComputedRef; - blockId: ComputedRef; - timestamp: ComputedRef; - validatorAddress: ComputedRef; - validatorIndex: ComputedRef; - signature: ComputedRef; - extension: ComputedRef; - extensionSignature: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/tendermint.types.Vote"; value: Uint8Array; @@ -315,12 +270,6 @@ export interface Commit { blockId: BlockID; signatures: CommitSig[]; } -export interface ReactiveCommit { - height: ComputedRef; - round: ComputedRef; - blockId: ComputedRef; - signatures: ComputedRef; -} export interface CommitProtoMsg { typeUrl: "/tendermint.types.Commit"; value: Uint8Array; @@ -343,12 +292,6 @@ export interface CommitSig { timestamp: Date; signature: Uint8Array; } -export interface ReactiveCommitSig { - blockIdFlag: ComputedRef; - validatorAddress: ComputedRef; - timestamp: ComputedRef; - signature: ComputedRef; -} export interface CommitSigProtoMsg { typeUrl: "/tendermint.types.CommitSig"; value: Uint8Array; @@ -370,12 +313,6 @@ export interface ExtendedCommit { blockId: BlockID; extendedSignatures: ExtendedCommitSig[]; } -export interface ReactiveExtendedCommit { - height: ComputedRef; - round: ComputedRef; - blockId: ComputedRef; - extendedSignatures: ComputedRef; -} export interface ExtendedCommitProtoMsg { typeUrl: "/tendermint.types.ExtendedCommit"; value: Uint8Array; @@ -405,14 +342,6 @@ export interface ExtendedCommitSig { /** Vote extension signature */ extensionSignature: Uint8Array; } -export interface ReactiveExtendedCommitSig { - blockIdFlag: ComputedRef; - validatorAddress: ComputedRef; - timestamp: ComputedRef; - signature: ComputedRef; - extension: ComputedRef; - extensionSignature: ComputedRef; -} export interface ExtendedCommitSigProtoMsg { typeUrl: "/tendermint.types.ExtendedCommitSig"; value: Uint8Array; @@ -445,15 +374,6 @@ export interface Proposal { timestamp: Date; signature: Uint8Array; } -export interface ReactiveProposal { - type: ComputedRef; - height: ComputedRef; - round: ComputedRef; - polRound: ComputedRef; - blockId: ComputedRef; - timestamp: ComputedRef; - signature: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/tendermint.types.Proposal"; value: Uint8Array; @@ -475,10 +395,6 @@ export interface SignedHeader { header?: Header; commit?: Commit; } -export interface ReactiveSignedHeader { - header?: ComputedRef
; - commit?: ComputedRef; -} export interface SignedHeaderProtoMsg { typeUrl: "/tendermint.types.SignedHeader"; value: Uint8Array; @@ -495,10 +411,6 @@ export interface LightBlock { signedHeader?: SignedHeader; validatorSet?: ValidatorSet; } -export interface ReactiveLightBlock { - signedHeader?: ComputedRef; - validatorSet?: ComputedRef; -} export interface LightBlockProtoMsg { typeUrl: "/tendermint.types.LightBlock"; value: Uint8Array; @@ -517,12 +429,6 @@ export interface BlockMeta { header: Header; numTxs: bigint; } -export interface ReactiveBlockMeta { - blockId: ComputedRef; - blockSize: ComputedRef; - header: ComputedRef
; - numTxs: ComputedRef; -} export interface BlockMetaProtoMsg { typeUrl: "/tendermint.types.BlockMeta"; value: Uint8Array; @@ -543,11 +449,6 @@ export interface TxProof { data: Uint8Array; proof?: Proof; } -export interface ReactiveTxProof { - rootHash: ComputedRef; - data: ComputedRef; - proof?: ComputedRef; -} export interface TxProofProtoMsg { typeUrl: "/tendermint.types.TxProof"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/types/validator.ts b/libs/injective-vue/src/tendermint/types/validator.ts index 52f72f9d..f01b225a 100644 --- a/libs/injective-vue/src/tendermint/types/validator.ts +++ b/libs/injective-vue/src/tendermint/types/validator.ts @@ -2,7 +2,6 @@ import { PublicKey, PublicKeyAmino } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; -import { ComputedRef } from "vue"; /** BlockIdFlag indicates which BlockID the signature is for */ export enum BlockIDFlag { /** BLOCK_ID_FLAG_UNKNOWN - indicates an error condition */ @@ -55,11 +54,6 @@ export interface ValidatorSet { proposer?: Validator; totalVotingPower: bigint; } -export interface ReactiveValidatorSet { - validators: ComputedRef; - proposer?: ComputedRef; - totalVotingPower: ComputedRef; -} export interface ValidatorSetProtoMsg { typeUrl: "/tendermint.types.ValidatorSet"; value: Uint8Array; @@ -79,12 +73,6 @@ export interface Validator { votingPower: bigint; proposerPriority: bigint; } -export interface ReactiveValidator { - address: ComputedRef; - pubKey: ComputedRef; - votingPower: ComputedRef; - proposerPriority: ComputedRef; -} export interface ValidatorProtoMsg { typeUrl: "/tendermint.types.Validator"; value: Uint8Array; @@ -103,10 +91,6 @@ export interface SimpleValidator { pubKey?: PublicKey; votingPower: bigint; } -export interface ReactiveSimpleValidator { - pubKey?: ComputedRef; - votingPower: ComputedRef; -} export interface SimpleValidatorProtoMsg { typeUrl: "/tendermint.types.SimpleValidator"; value: Uint8Array; diff --git a/libs/injective-vue/src/tendermint/version/types.ts b/libs/injective-vue/src/tendermint/version/types.ts index 3a71c21d..824f3644 100644 --- a/libs/injective-vue/src/tendermint/version/types.ts +++ b/libs/injective-vue/src/tendermint/version/types.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * App includes the protocol and software version for the application. * This information is included in ResponseInfo. The App.Protocol can be @@ -11,10 +10,6 @@ export interface App { protocol: bigint; software: string; } -export interface ReactiveApp { - protocol: ComputedRef; - software: ComputedRef; -} export interface AppProtoMsg { typeUrl: "/tendermint.version.App"; value: Uint8Array; @@ -41,10 +36,6 @@ export interface Consensus { block: bigint; app: bigint; } -export interface ReactiveConsensus { - block: ComputedRef; - app: ComputedRef; -} export interface ConsensusProtoMsg { typeUrl: "/tendermint.version.Consensus"; value: Uint8Array; diff --git a/libs/injective-vue/src/types.ts b/libs/injective-vue/src/types.ts index 2bace856..cdcfbdf9 100644 --- a/libs/injective-vue/src/types.ts +++ b/libs/injective-vue/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/utf8.ts b/libs/injective-vue/src/utf8.ts index c5dba8d6..c0f5c97c 100644 --- a/libs/injective-vue/src/utf8.ts +++ b/libs/injective-vue/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/varint.ts b/libs/injective-vue/src/varint.ts index 95ef3b55..70a851bd 100644 --- a/libs/injective-vue/src/varint.ts +++ b/libs/injective-vue/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/vue-query.ts b/libs/injective-vue/src/vue-query.ts index d37888af..867bd9f3 100644 --- a/libs/injective-vue/src/vue-query.ts +++ b/libs/injective-vue/src/vue-query.ts @@ -1,69 +1,122 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ + + + import { getRpcClient } from './extern' +import { + isRpc, + Rpc, +} from './helpers' +import { + ITxArgs, + ISigningClient, + StdFee, + DeliverTxResponse, + SigningClientResolver, + RpcResolver, + isISigningClient +} from './helper-func-types' import { useQuery, + useQueryClient, UseQueryOptions, + useMutation, + UseMutationOptions, + QueryKey, } from '@tanstack/vue-query'; -import { Ref, isRef } from 'vue' import { HttpEndpoint, ProtobufRpcClient } from '@cosmjs/stargate'; import { Tendermint34Client } from '@cosmjs/tendermint-rpc'; +import {Ref} from 'vue' + +export const DEFAULT_RPC_CLIENT_QUERY_KEY = 'rpcClient'; +export const DEFAULT_RPC_ENDPOINT_QUERY_KEY = 'rpcEndPoint'; +export const DEFAULT_SIGNING_CLIENT_QUERY_KEY = 'signingClient'; + +export interface CacheResolver { + rpcEndpoint?: string | HttpEndpoint; + clientQueryKey?: string; +} + +export function isCacheResolver(resolver: unknown): resolver is CacheResolver { + return ( + resolver !== null && + resolver !== undefined && + (resolver as CacheResolver).rpcEndpoint !== undefined && + (resolver as CacheResolver).clientQueryKey !== undefined + ); +} export interface VueQueryParams { - options?: Omit, 'queryKey'>; + options?: UseQueryOptions; } export interface UseRpcClientQuery extends VueQueryParams { - rpcEndpoint: Ref; + clientResolver?: CacheResolver; } export interface UseRpcEndpointQuery extends VueQueryParams { getter: () => Promise; + rpcEndPointKey?: string; + extraKey?: string } -export const useRpcEndpoint = ({ - getter, - options, -}: UseRpcEndpointQuery) => { - return useQuery({ - queryKey: ['rpcEndpoint', getter], - queryFn: async () => { - return await getter(); - }, - ...options - }) +export function useRpcEndpoint({ + getter, + options, + rpcEndPointKey, + extraKey, +}: UseRpcEndpointQuery) { + const key = rpcEndPointKey || DEFAULT_RPC_ENDPOINT_QUERY_KEY; + return useQuery( + { + queryKey: [key, extraKey], + queryFn: async () => { + return await getter(); + }, ...options + } + ); }; -export const useRpcClient = ({ - rpcEndpoint, - options, -}: UseRpcClientQuery) => { - let params = { - queryKey: ['rpcClient', rpcEndpoint], - queryFn: async () => { - return await getRpcClient(rpcEndpoint.value); - }, - }; - if (options && !isRef(options)) { - params = { - ...options, - ...params, - }; - } - return useQuery(params); -}; +export function useRpcClient({ + options, + clientResolver, +}: UseRpcClientQuery) { + const queryClient = useQueryClient(); + + const key = clientResolver?.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY; + return useQuery({ + queryKey: [key, clientResolver?.rpcEndpoint], + queryFn: async () => { + if (!clientResolver?.rpcEndpoint) { + throw new Error('rpcEndpoint is required'); + } + + const client = await getRpcClient(clientResolver.rpcEndpoint); + if (!client) { + throw new Error('Failed to connect to rpc client'); + } + + queryClient.setQueryData([key], client); + + return client; + }, + ...options + } + ); +} interface UseTendermintClient extends VueQueryParams { - rpcEndpoint: Ref; + rpcEndpoint: string | HttpEndpoint; } /** - * Hook that uses vue-query to cache a connected tendermint client. + * Function that uses vue-query to cache a connected tendermint client. */ export const useTendermintClient = ({ rpcEndpoint, @@ -71,12 +124,132 @@ export const useTendermintClient = ({ }: UseTendermintClient) => { const { data: client } = useQuery({ queryKey: ['client', 'tendermint', rpcEndpoint], - queryFn: () => Tendermint34Client.connect(rpcEndpoint.value), - // allow overriding - throwOnError: (e) => { - throw new Error(`Failed to connect to ${rpcEndpoint}` + '\n' + e) - }, - ...options, - }) - return { client } + queryFn: () => Tendermint34Client.connect(rpcEndpoint), + ...{ + // allow overriding + onError: (e: any) => { + throw new Error(`Failed to connect to ${rpcEndpoint}` + '\n' + e) + }, + ...options, + } + } + ); + return { client }; }; + +export interface UseQueryBuilderOptions { + builderQueryFn: ( + clientResolver?: RpcResolver + ) => (request: TReq) => Promise; + queryKeyPrefix: string; +} + +export function buildUseVueQuery( + opts: UseQueryBuilderOptions +) { + return function useBuiltQuery({ + request, + options, + clientResolver, + customizedQueryKey, + }: UseQueryParams) { + const queryClient = useQueryClient(); + let rpcResolver: RpcResolver | undefined; + if (isRpc(clientResolver)) { + rpcResolver = clientResolver; + + } else if (isCacheResolver(clientResolver)) { + const key = clientResolver.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY; + const queryKey = clientResolver.rpcEndpoint + ? [key, clientResolver.rpcEndpoint] + : [key]; + rpcResolver = queryClient.getQueryData(queryKey); + + if (!rpcResolver && clientResolver.rpcEndpoint) { + rpcResolver = clientResolver.rpcEndpoint; + } + } else { + rpcResolver = clientResolver; + + } + + const queryFn = opts.builderQueryFn(rpcResolver); + return useQuery({ + queryKey: customizedQueryKey || [opts.queryKeyPrefix, request], + queryFn: () => queryFn(request.value), + ...options + } + ); + }; +} + +export interface UseQueryParams + extends VueQueryParams { + request: Ref; + clientResolver?: CacheResolver | RpcResolver; + customizedQueryKey?: QueryKey; +} + +export interface VueMutationParams< + TData, + TError, + TVariables, + TContext = unknown +> { + options?: UseMutationOptions; + clientResolver?: CacheResolver | SigningClientResolver; +} + +export interface UseMutationBuilderOptions { + builderMutationFn: ( + clientResolver?: SigningClientResolver + ) => ( + signerAddress: string, + message: TMsg, + fee: StdFee | 'auto', + memo: string + ) => Promise; +} + +export function buildUseVueMutation( + opts: UseMutationBuilderOptions +) { + return function useBuiltMutation({ + options, + clientResolver, + }: VueMutationParams>) { + const queryClient = useQueryClient(); + + let signingClientResolver: SigningClientResolver | undefined; + + if (isISigningClient(clientResolver)) { + signingClientResolver = clientResolver; + } else if (isCacheResolver(clientResolver)) { + const key = + clientResolver.clientQueryKey || DEFAULT_SIGNING_CLIENT_QUERY_KEY; + const queryKey = clientResolver.rpcEndpoint + ? [key, clientResolver.rpcEndpoint] + : [key]; + signingClientResolver = queryClient.getQueryData( + queryKey + ); + } else { + clientResolver = clientResolver; + } + + const mutationFn = opts.builderMutationFn(signingClientResolver); + + return useMutation>( + { + mutationFn: (reqData: ITxArgs) => + mutationFn( + reqData.signerAddress, + reqData.message, + reqData.fee, + reqData.memo + ), + ...options + } + ); + }; +} diff --git a/libs/injectivejs/package.json b/libs/injectivejs/package.json index 15967ed9..6e1e26af 100644 --- a/libs/injectivejs/package.json +++ b/libs/injectivejs/package.json @@ -32,12 +32,6 @@ "@noble/hashes": "^1.3.1", "decimal.js": "^10.4.3" }, - "devDependencies": { - "@tanstack/react-query": "4.29.1" - }, - "peerDependencies": { - "@tanstack/react-query": "4.29.1" - }, "keywords": [ "cosmos", "blockchain", diff --git a/libs/injectivejs/src/binary.ts b/libs/injectivejs/src/binary.ts index 2eaa6cb6..e6922501 100644 --- a/libs/injectivejs/src/binary.ts +++ b/libs/injectivejs/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/extern.ts b/libs/injectivejs/src/extern.ts index 86edda83..eddf067e 100644 --- a/libs/injectivejs/src/extern.ts +++ b/libs/injectivejs/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/helper-func-types.ts b/libs/injectivejs/src/helper-func-types.ts index 7abfde29..7aeeb7bc 100644 --- a/libs/injectivejs/src/helper-func-types.ts +++ b/libs/injectivejs/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/helpers.ts b/libs/injectivejs/src/helpers.ts index 64d3444c..ba68bbdb 100644 --- a/libs/injectivejs/src/helpers.ts +++ b/libs/injectivejs/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/registry.ts b/libs/injectivejs/src/registry.ts index 7356722f..1581e912 100644 --- a/libs/injectivejs/src/registry.ts +++ b/libs/injectivejs/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/types.ts b/libs/injectivejs/src/types.ts index 2bace856..cdcfbdf9 100644 --- a/libs/injectivejs/src/types.ts +++ b/libs/injectivejs/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/utf8.ts b/libs/injectivejs/src/utf8.ts index c5dba8d6..c0f5c97c 100644 --- a/libs/injectivejs/src/utf8.ts +++ b/libs/injectivejs/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/varint.ts b/libs/injectivejs/src/varint.ts index 95ef3b55..70a851bd 100644 --- a/libs/injectivejs/src/varint.ts +++ b/libs/injectivejs/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/binary.ts b/libs/interchain-react/src/binary.ts index 2eaa6cb6..e6922501 100644 --- a/libs/interchain-react/src/binary.ts +++ b/libs/interchain-react/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.func.ts index 34356dfe..92d4faa4 100644 --- a/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryConfigRequest, QueryConfigResponse } from "./query"; export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryConfigRequest.encode, @@ -8,8 +7,4 @@ export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetConfig, - queryKeyPrefix: "ConfigQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts new file mode 100644 index 00000000..8a6a48d0 --- /dev/null +++ b/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts @@ -0,0 +1,7 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryConfigRequest, QueryConfigResponse } from "./query"; +import { createGetConfig } from "./query.rpc.func.ts"; +export const useGetConfig = buildUseQuery({ + builderQueryFn: createGetConfig, + queryKeyPrefix: "ConfigQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.func.ts index 174472fd..96ab73af 100644 --- a/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountsRequest.encode, @@ -9,10 +8,6 @@ export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAccounts, - queryKeyPrefix: "AccountsQuery" -}); export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountRequest.encode, decode: QueryAccountResponse.decode, @@ -21,10 +16,6 @@ export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAccount, - queryKeyPrefix: "AccountQuery" -}); export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountAddressByIDRequest.encode, decode: QueryAccountAddressByIDResponse.decode, @@ -33,10 +24,6 @@ export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse] }); -export const useGetAccountAddressByID = buildUseQuery({ - builderQueryFn: createGetAccountAddressByID, - queryKeyPrefix: "AccountAddressByIDQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -45,10 +32,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleAccountsRequest.encode, decode: QueryModuleAccountsResponse.decode, @@ -57,10 +40,6 @@ export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryModuleAccountsRequest, QueryModuleAccountsResponse] }); -export const useGetModuleAccounts = buildUseQuery({ - builderQueryFn: createGetModuleAccounts, - queryKeyPrefix: "ModuleAccountsQuery" -}); export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleAccountByNameRequest.encode, decode: QueryModuleAccountByNameResponse.decode, @@ -69,10 +48,6 @@ export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse] }); -export const useGetModuleAccountByName = buildUseQuery({ - builderQueryFn: createGetModuleAccountByName, - queryKeyPrefix: "ModuleAccountByNameQuery" -}); export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuery({ encode: Bech32PrefixRequest.encode, decode: Bech32PrefixResponse.decode, @@ -81,10 +56,6 @@ export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [Bech32PrefixRequest, Bech32PrefixResponse] }); -export const useGetBech32Prefix = buildUseQuery({ - builderQueryFn: createGetBech32Prefix, - queryKeyPrefix: "Bech32PrefixQuery" -}); export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => buildQuery({ encode: AddressBytesToStringRequest.encode, decode: AddressBytesToStringResponse.decode, @@ -93,10 +64,6 @@ export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => b clientResolver, deps: [AddressBytesToStringRequest, AddressBytesToStringResponse] }); -export const useGetAddressBytesToString = buildUseQuery({ - builderQueryFn: createGetAddressBytesToString, - queryKeyPrefix: "AddressBytesToStringQuery" -}); export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => buildQuery({ encode: AddressStringToBytesRequest.encode, decode: AddressStringToBytesResponse.decode, @@ -105,10 +72,6 @@ export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => b clientResolver, deps: [AddressStringToBytesRequest, AddressStringToBytesResponse] }); -export const useGetAddressStringToBytes = buildUseQuery({ - builderQueryFn: createGetAddressStringToBytes, - queryKeyPrefix: "AddressStringToBytesQuery" -}); export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountInfoRequest.encode, decode: QueryAccountInfoResponse.decode, @@ -116,8 +79,4 @@ export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery method: "AccountInfo", clientResolver, deps: [QueryAccountInfoRequest, QueryAccountInfoResponse] -}); -export const useGetAccountInfo = buildUseQuery({ - builderQueryFn: createGetAccountInfo, - queryKeyPrefix: "AccountInfoQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..f1ddc500 --- /dev/null +++ b/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts @@ -0,0 +1,43 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +export const useGetAccounts = buildUseQuery({ + builderQueryFn: createGetAccounts, + queryKeyPrefix: "AccountsQuery" +}); +export const useGetAccount = buildUseQuery({ + builderQueryFn: createGetAccount, + queryKeyPrefix: "AccountQuery" +}); +export const useGetAccountAddressByID = buildUseQuery({ + builderQueryFn: createGetAccountAddressByID, + queryKeyPrefix: "AccountAddressByIDQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetModuleAccounts = buildUseQuery({ + builderQueryFn: createGetModuleAccounts, + queryKeyPrefix: "ModuleAccountsQuery" +}); +export const useGetModuleAccountByName = buildUseQuery({ + builderQueryFn: createGetModuleAccountByName, + queryKeyPrefix: "ModuleAccountByNameQuery" +}); +export const useGetBech32Prefix = buildUseQuery({ + builderQueryFn: createGetBech32Prefix, + queryKeyPrefix: "Bech32PrefixQuery" +}); +export const useGetAddressBytesToString = buildUseQuery({ + builderQueryFn: createGetAddressBytesToString, + queryKeyPrefix: "AddressBytesToStringQuery" +}); +export const useGetAddressStringToBytes = buildUseQuery({ + builderQueryFn: createGetAddressStringToBytes, + queryKeyPrefix: "AddressStringToBytesQuery" +}); +export const useGetAccountInfo = buildUseQuery({ + builderQueryFn: createGetAccountInfo, + queryKeyPrefix: "AccountInfoQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.func.ts index 1e1ff831..6cf89cb1 100644 --- a/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams } from "./tx"; export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -8,7 +7,4 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..427464a2 --- /dev/null +++ b/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts @@ -0,0 +1,6 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgUpdateParams } from "./tx"; +import { createUpdateParams } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.func.ts index a000a061..cbb9526e 100644 --- a/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; export const createGetGrants = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGrantsRequest.encode, @@ -9,10 +8,6 @@ export const createGetGrants = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetGrants, - queryKeyPrefix: "GrantsQuery" -}); export const createGetGranterGrants = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGranterGrantsRequest.encode, decode: QueryGranterGrantsResponse.decode, @@ -21,10 +16,6 @@ export const createGetGranterGrants = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryGranterGrantsRequest, QueryGranterGrantsResponse] }); -export const useGetGranterGrants = buildUseQuery({ - builderQueryFn: createGetGranterGrants, - queryKeyPrefix: "GranterGrantsQuery" -}); export const createGetGranteeGrants = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGranteeGrantsRequest.encode, decode: QueryGranteeGrantsResponse.decode, @@ -32,8 +23,4 @@ export const createGetGranteeGrants = (clientResolver?: RpcResolver) => buildQue method: "GranteeGrants", clientResolver, deps: [QueryGranteeGrantsRequest, QueryGranteeGrantsResponse] -}); -export const useGetGranteeGrants = buildUseQuery({ - builderQueryFn: createGetGranteeGrants, - queryKeyPrefix: "GranteeGrantsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..2c287d62 --- /dev/null +++ b/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; +import { createGetGrants, createGetGranterGrants, createGetGranteeGrants } from "./query.rpc.func.ts"; +export const useGetGrants = buildUseQuery({ + builderQueryFn: createGetGrants, + queryKeyPrefix: "GrantsQuery" +}); +export const useGetGranterGrants = buildUseQuery({ + builderQueryFn: createGetGranterGrants, + queryKeyPrefix: "GranterGrantsQuery" +}); +export const useGetGranteeGrants = buildUseQuery({ + builderQueryFn: createGetGranteeGrants, + queryKeyPrefix: "GranteeGrantsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts index 0f34bbad..7c896912 100644 --- a/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createGrant -}); export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExec.typeUrl, @@ -19,16 +15,10 @@ export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createExec -}); export const createRevoke = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRevoke.typeUrl, encoders: toEncoders(MsgRevoke), converters: toConverters(MsgRevoke), deps: [MsgRevoke] -}); -export const useRevoke = buildUseMutation({ - builderMutationFn: createRevoke }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..c94561d2 --- /dev/null +++ b/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts @@ -0,0 +1,12 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +export const useGrant = buildUseMutation({ + builderMutationFn: createGrant +}); +export const useExec = buildUseMutation({ + builderMutationFn: createExec +}); +export const useRevoke = buildUseMutation({ + builderMutationFn: createRevoke +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.func.ts index ff32bc2e..8cfb0472 100644 --- a/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { AppOptionsRequest, AppOptionsResponse } from "./query"; export const createGetAppOptions = (clientResolver?: RpcResolver) => buildQuery({ encode: AppOptionsRequest.encode, @@ -8,8 +7,4 @@ export const createGetAppOptions = (clientResolver?: RpcResolver) => buildQuery< method: "AppOptions", clientResolver, deps: [AppOptionsRequest, AppOptionsResponse] -}); -export const useGetAppOptions = buildUseQuery({ - builderQueryFn: createGetAppOptions, - queryKeyPrefix: "AppOptionsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts new file mode 100644 index 00000000..2104f4d8 --- /dev/null +++ b/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts @@ -0,0 +1,7 @@ +import { buildUseQuery } from "../../../react-query"; +import { AppOptionsRequest, AppOptionsResponse } from "./query"; +import { createGetAppOptions } from "./query.rpc.func.ts"; +export const useGetAppOptions = buildUseQuery({ + builderQueryFn: createGetAppOptions, + queryKeyPrefix: "AppOptionsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.func.ts index 024880f8..70281597 100644 --- a/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBalanceRequest.encode, @@ -9,10 +8,6 @@ export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetBalance, - queryKeyPrefix: "BalanceQuery" -}); export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllBalancesRequest.encode, decode: QueryAllBalancesResponse.decode, @@ -21,10 +16,6 @@ export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryAllBalancesRequest, QueryAllBalancesResponse] }); -export const useGetAllBalances = buildUseQuery({ - builderQueryFn: createGetAllBalances, - queryKeyPrefix: "AllBalancesQuery" -}); export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpendableBalancesRequest.encode, decode: QuerySpendableBalancesResponse.decode, @@ -33,10 +24,6 @@ export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QuerySpendableBalancesRequest, QuerySpendableBalancesResponse] }); -export const useGetSpendableBalances = buildUseQuery({ - builderQueryFn: createGetSpendableBalances, - queryKeyPrefix: "SpendableBalancesQuery" -}); export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySpendableBalanceByDenomRequest.encode, decode: QuerySpendableBalanceByDenomResponse.decode, @@ -45,10 +32,6 @@ export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) = clientResolver, deps: [QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse] }); -export const useGetSpendableBalanceByDenom = buildUseQuery({ - builderQueryFn: createGetSpendableBalanceByDenom, - queryKeyPrefix: "SpendableBalanceByDenomQuery" -}); export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTotalSupplyRequest.encode, decode: QueryTotalSupplyResponse.decode, @@ -57,10 +40,6 @@ export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryTotalSupplyRequest, QueryTotalSupplyResponse] }); -export const useGetTotalSupply = buildUseQuery({ - builderQueryFn: createGetTotalSupply, - queryKeyPrefix: "TotalSupplyQuery" -}); export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySupplyOfRequest.encode, decode: QuerySupplyOfResponse.decode, @@ -69,10 +48,6 @@ export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetSupplyOf, - queryKeyPrefix: "SupplyOfQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -81,10 +56,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomMetadataRequest.encode, decode: QueryDenomMetadataResponse.decode, @@ -93,10 +64,6 @@ export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryDenomMetadataRequest, QueryDenomMetadataResponse] }); -export const useGetDenomMetadata = buildUseQuery({ - builderQueryFn: createGetDenomMetadata, - queryKeyPrefix: "DenomMetadataQuery" -}); export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomMetadataByQueryStringRequest.encode, decode: QueryDenomMetadataByQueryStringResponse.decode, @@ -105,10 +72,6 @@ export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver clientResolver, deps: [QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse] }); -export const useGetDenomMetadataByQueryString = buildUseQuery({ - builderQueryFn: createGetDenomMetadataByQueryString, - queryKeyPrefix: "DenomMetadataByQueryStringQuery" -}); export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomsMetadataRequest.encode, decode: QueryDenomsMetadataResponse.decode, @@ -117,10 +80,6 @@ export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryDenomsMetadataRequest, QueryDenomsMetadataResponse] }); -export const useGetDenomsMetadata = buildUseQuery({ - builderQueryFn: createGetDenomsMetadata, - queryKeyPrefix: "DenomsMetadataQuery" -}); export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomOwnersRequest.encode, decode: QueryDenomOwnersResponse.decode, @@ -129,10 +88,6 @@ export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryDenomOwnersRequest, QueryDenomOwnersResponse] }); -export const useGetDenomOwners = buildUseQuery({ - builderQueryFn: createGetDenomOwners, - queryKeyPrefix: "DenomOwnersQuery" -}); export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDenomOwnersByQueryRequest.encode, decode: QueryDenomOwnersByQueryResponse.decode, @@ -141,10 +96,6 @@ export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse] }); -export const useGetDenomOwnersByQuery = buildUseQuery({ - builderQueryFn: createGetDenomOwnersByQuery, - queryKeyPrefix: "DenomOwnersByQueryQuery" -}); export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySendEnabledRequest.encode, decode: QuerySendEnabledResponse.decode, @@ -152,8 +103,4 @@ export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery method: "SendEnabled", clientResolver, deps: [QuerySendEnabledRequest, QuerySendEnabledResponse] -}); -export const useGetSendEnabled = buildUseQuery({ - builderQueryFn: createGetSendEnabled, - queryKeyPrefix: "SendEnabledQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..8548218a --- /dev/null +++ b/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts @@ -0,0 +1,55 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +export const useGetBalance = buildUseQuery({ + builderQueryFn: createGetBalance, + queryKeyPrefix: "BalanceQuery" +}); +export const useGetAllBalances = buildUseQuery({ + builderQueryFn: createGetAllBalances, + queryKeyPrefix: "AllBalancesQuery" +}); +export const useGetSpendableBalances = buildUseQuery({ + builderQueryFn: createGetSpendableBalances, + queryKeyPrefix: "SpendableBalancesQuery" +}); +export const useGetSpendableBalanceByDenom = buildUseQuery({ + builderQueryFn: createGetSpendableBalanceByDenom, + queryKeyPrefix: "SpendableBalanceByDenomQuery" +}); +export const useGetTotalSupply = buildUseQuery({ + builderQueryFn: createGetTotalSupply, + queryKeyPrefix: "TotalSupplyQuery" +}); +export const useGetSupplyOf = buildUseQuery({ + builderQueryFn: createGetSupplyOf, + queryKeyPrefix: "SupplyOfQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDenomMetadata = buildUseQuery({ + builderQueryFn: createGetDenomMetadata, + queryKeyPrefix: "DenomMetadataQuery" +}); +export const useGetDenomMetadataByQueryString = buildUseQuery({ + builderQueryFn: createGetDenomMetadataByQueryString, + queryKeyPrefix: "DenomMetadataByQueryStringQuery" +}); +export const useGetDenomsMetadata = buildUseQuery({ + builderQueryFn: createGetDenomsMetadata, + queryKeyPrefix: "DenomsMetadataQuery" +}); +export const useGetDenomOwners = buildUseQuery({ + builderQueryFn: createGetDenomOwners, + queryKeyPrefix: "DenomOwnersQuery" +}); +export const useGetDenomOwnersByQuery = buildUseQuery({ + builderQueryFn: createGetDenomOwnersByQuery, + queryKeyPrefix: "DenomOwnersByQueryQuery" +}); +export const useGetSendEnabled = buildUseQuery({ + builderQueryFn: createGetSendEnabled, + queryKeyPrefix: "SendEnabledQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts index 08715cb8..e63f91ea 100644 --- a/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createSend -}); export const createMultiSend = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgMultiSend.typeUrl, @@ -19,9 +15,6 @@ export const createMultiSend = (clientResolver?: SigningClientResolver) => build converters: toConverters(MsgMultiSend), deps: [MsgMultiSend] }); -export const useMultiSend = buildUseMutation({ - builderMutationFn: createMultiSend -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -29,16 +22,10 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createSetSendEnabled = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSetSendEnabled.typeUrl, encoders: toEncoders(MsgSetSendEnabled), converters: toConverters(MsgSetSendEnabled), deps: [MsgSetSendEnabled] -}); -export const useSetSendEnabled = buildUseMutation({ - builderMutationFn: createSetSendEnabled }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..8162fe19 --- /dev/null +++ b/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +export const useSend = buildUseMutation({ + builderMutationFn: createSend +}); +export const useMultiSend = buildUseMutation({ + builderMutationFn: createMultiSend +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useSetSendEnabled = buildUseMutation({ + builderMutationFn: createSetSendEnabled +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.func.ts b/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.func.ts index 8cb28dbd..87c1b119 100644 --- a/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../../helper-func-types"; -import { buildUseQuery } from "../../../../react-query"; import { QueryRequest, QueryResponse, ListQueryHandlersRequest, ListQueryHandlersResponse } from "./service"; export const createGetQuery = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryRequest.encode, @@ -9,10 +8,6 @@ export const createGetQuery = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetQuery, - queryKeyPrefix: "QueryQuery" -}); export const createGetListQueryHandlers = (clientResolver?: RpcResolver) => buildQuery({ encode: ListQueryHandlersRequest.encode, decode: ListQueryHandlersResponse.decode, @@ -20,8 +15,4 @@ export const createGetListQueryHandlers = (clientResolver?: RpcResolver) => buil method: "ListQueryHandlers", clientResolver, deps: [ListQueryHandlersRequest, ListQueryHandlersResponse] -}); -export const useGetListQueryHandlers = buildUseQuery({ - builderQueryFn: createGetListQueryHandlers, - queryKeyPrefix: "ListQueryHandlersQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts b/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts new file mode 100644 index 00000000..a18d43ef --- /dev/null +++ b/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts @@ -0,0 +1,11 @@ +import { buildUseQuery } from "../../../../react-query"; +import { QueryRequest, QueryResponse, ListQueryHandlersRequest, ListQueryHandlersResponse } from "./service"; +import { createGetQuery, createGetListQueryHandlers } from "./service.rpc.func.ts"; +export const useGetQuery = buildUseQuery({ + builderQueryFn: createGetQuery, + queryKeyPrefix: "QueryQuery" +}); +export const useGetListQueryHandlers = buildUseQuery({ + builderQueryFn: createGetListQueryHandlers, + queryKeyPrefix: "ListQueryHandlersQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.func.ts index 4628d47c..2aea9040 100644 --- a/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../../helper-func-types"; -import { buildUseQuery } from "../../../../react-query"; import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ encode: ConfigRequest.encode, @@ -9,10 +8,6 @@ export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetConfig, - queryKeyPrefix: "ConfigQuery" -}); export const createGetStatus = (clientResolver?: RpcResolver) => buildQuery({ encode: StatusRequest.encode, decode: StatusResponse.decode, @@ -20,8 +15,4 @@ export const createGetStatus = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetStatus, - queryKeyPrefix: "StatusQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..4365eda7 --- /dev/null +++ b/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts @@ -0,0 +1,11 @@ +import { buildUseQuery } from "../../../../react-query"; +import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; +import { createGetConfig, createGetStatus } from "./query.rpc.func.ts"; +export const useGetConfig = buildUseQuery({ + builderQueryFn: createGetConfig, + queryKeyPrefix: "ConfigQuery" +}); +export const useGetStatus = buildUseQuery({ + builderQueryFn: createGetStatus, + queryKeyPrefix: "StatusQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.func.ts b/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.func.ts index 0fff94ce..c2724aa6 100644 --- a/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../../helper-func-types"; -import { buildUseQuery } from "../../../../react-query"; import { ConfigRequest, ConfigResponse } from "./query"; export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ encode: ConfigRequest.encode, @@ -8,8 +7,4 @@ export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetConfig, - queryKeyPrefix: "ConfigQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts b/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts new file mode 100644 index 00000000..e326581a --- /dev/null +++ b/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts @@ -0,0 +1,7 @@ +import { buildUseQuery } from "../../../../react-query"; +import { ConfigRequest, ConfigResponse } from "./query"; +import { createGetConfig } from "./query.rpc.func.ts"; +export const useGetConfig = buildUseQuery({ + builderQueryFn: createGetConfig, + queryKeyPrefix: "ConfigQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts b/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts index 9cc4ec01..b9ad410f 100644 --- a/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../../helper-func-types"; -import { buildUseQuery } from "../../../../react-query"; import { ListAllInterfacesRequest, ListAllInterfacesResponse, ListImplementationsRequest, ListImplementationsResponse } from "./reflection"; export const createGetListAllInterfaces = (clientResolver?: RpcResolver) => buildQuery({ encode: ListAllInterfacesRequest.encode, @@ -9,10 +8,6 @@ export const createGetListAllInterfaces = (clientResolver?: RpcResolver) => buil clientResolver, deps: [ListAllInterfacesRequest, ListAllInterfacesResponse] }); -export const useGetListAllInterfaces = buildUseQuery({ - builderQueryFn: createGetListAllInterfaces, - queryKeyPrefix: "ListAllInterfacesQuery" -}); export const createGetListImplementations = (clientResolver?: RpcResolver) => buildQuery({ encode: ListImplementationsRequest.encode, decode: ListImplementationsResponse.decode, @@ -20,8 +15,4 @@ export const createGetListImplementations = (clientResolver?: RpcResolver) => bu method: "ListImplementations", clientResolver, deps: [ListImplementationsRequest, ListImplementationsResponse] -}); -export const useGetListImplementations = buildUseQuery({ - builderQueryFn: createGetListImplementations, - queryKeyPrefix: "ListImplementationsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts b/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts new file mode 100644 index 00000000..cad07016 --- /dev/null +++ b/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts @@ -0,0 +1,11 @@ +import { buildUseQuery } from "../../../../react-query"; +import { ListAllInterfacesRequest, ListAllInterfacesResponse, ListImplementationsRequest, ListImplementationsResponse } from "./reflection"; +import { createGetListAllInterfaces, createGetListImplementations } from "./reflection.rpc.func.ts"; +export const useGetListAllInterfaces = buildUseQuery({ + builderQueryFn: createGetListAllInterfaces, + queryKeyPrefix: "ListAllInterfacesQuery" +}); +export const useGetListImplementations = buildUseQuery({ + builderQueryFn: createGetListImplementations, + queryKeyPrefix: "ListImplementationsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts b/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts index bb1abb37..bf23fd66 100644 --- a/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../../helper-func-types"; -import { buildUseQuery } from "../../../../react-query"; import { GetAuthnDescriptorRequest, GetAuthnDescriptorResponse, GetChainDescriptorRequest, GetChainDescriptorResponse, GetCodecDescriptorRequest, GetCodecDescriptorResponse, GetConfigurationDescriptorRequest, GetConfigurationDescriptorResponse, GetQueryServicesDescriptorRequest, GetQueryServicesDescriptorResponse, GetTxDescriptorRequest, GetTxDescriptorResponse } from "./reflection"; export const createGetGetAuthnDescriptor = (clientResolver?: RpcResolver) => buildQuery({ encode: GetAuthnDescriptorRequest.encode, @@ -9,10 +8,6 @@ export const createGetGetAuthnDescriptor = (clientResolver?: RpcResolver) => bui clientResolver, deps: [GetAuthnDescriptorRequest, GetAuthnDescriptorResponse] }); -export const useGetGetAuthnDescriptor = buildUseQuery({ - builderQueryFn: createGetGetAuthnDescriptor, - queryKeyPrefix: "GetAuthnDescriptorQuery" -}); export const createGetGetChainDescriptor = (clientResolver?: RpcResolver) => buildQuery({ encode: GetChainDescriptorRequest.encode, decode: GetChainDescriptorResponse.decode, @@ -21,10 +16,6 @@ export const createGetGetChainDescriptor = (clientResolver?: RpcResolver) => bui clientResolver, deps: [GetChainDescriptorRequest, GetChainDescriptorResponse] }); -export const useGetGetChainDescriptor = buildUseQuery({ - builderQueryFn: createGetGetChainDescriptor, - queryKeyPrefix: "GetChainDescriptorQuery" -}); export const createGetGetCodecDescriptor = (clientResolver?: RpcResolver) => buildQuery({ encode: GetCodecDescriptorRequest.encode, decode: GetCodecDescriptorResponse.decode, @@ -33,10 +24,6 @@ export const createGetGetCodecDescriptor = (clientResolver?: RpcResolver) => bui clientResolver, deps: [GetCodecDescriptorRequest, GetCodecDescriptorResponse] }); -export const useGetGetCodecDescriptor = buildUseQuery({ - builderQueryFn: createGetGetCodecDescriptor, - queryKeyPrefix: "GetCodecDescriptorQuery" -}); export const createGetGetConfigurationDescriptor = (clientResolver?: RpcResolver) => buildQuery({ encode: GetConfigurationDescriptorRequest.encode, decode: GetConfigurationDescriptorResponse.decode, @@ -45,10 +32,6 @@ export const createGetGetConfigurationDescriptor = (clientResolver?: RpcResolver clientResolver, deps: [GetConfigurationDescriptorRequest, GetConfigurationDescriptorResponse] }); -export const useGetGetConfigurationDescriptor = buildUseQuery({ - builderQueryFn: createGetGetConfigurationDescriptor, - queryKeyPrefix: "GetConfigurationDescriptorQuery" -}); export const createGetGetQueryServicesDescriptor = (clientResolver?: RpcResolver) => buildQuery({ encode: GetQueryServicesDescriptorRequest.encode, decode: GetQueryServicesDescriptorResponse.decode, @@ -57,10 +40,6 @@ export const createGetGetQueryServicesDescriptor = (clientResolver?: RpcResolver clientResolver, deps: [GetQueryServicesDescriptorRequest, GetQueryServicesDescriptorResponse] }); -export const useGetGetQueryServicesDescriptor = buildUseQuery({ - builderQueryFn: createGetGetQueryServicesDescriptor, - queryKeyPrefix: "GetQueryServicesDescriptorQuery" -}); export const createGetGetTxDescriptor = (clientResolver?: RpcResolver) => buildQuery({ encode: GetTxDescriptorRequest.encode, decode: GetTxDescriptorResponse.decode, @@ -68,8 +47,4 @@ export const createGetGetTxDescriptor = (clientResolver?: RpcResolver) => buildQ method: "GetTxDescriptor", clientResolver, deps: [GetTxDescriptorRequest, GetTxDescriptorResponse] -}); -export const useGetGetTxDescriptor = buildUseQuery({ - builderQueryFn: createGetGetTxDescriptor, - queryKeyPrefix: "GetTxDescriptorQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts b/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts new file mode 100644 index 00000000..e6aafa0e --- /dev/null +++ b/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts @@ -0,0 +1,27 @@ +import { buildUseQuery } from "../../../../react-query"; +import { GetAuthnDescriptorRequest, GetAuthnDescriptorResponse, GetChainDescriptorRequest, GetChainDescriptorResponse, GetCodecDescriptorRequest, GetCodecDescriptorResponse, GetConfigurationDescriptorRequest, GetConfigurationDescriptorResponse, GetQueryServicesDescriptorRequest, GetQueryServicesDescriptorResponse, GetTxDescriptorRequest, GetTxDescriptorResponse } from "./reflection"; +import { createGetGetAuthnDescriptor, createGetGetChainDescriptor, createGetGetCodecDescriptor, createGetGetConfigurationDescriptor, createGetGetQueryServicesDescriptor, createGetGetTxDescriptor } from "./reflection.rpc.func.ts"; +export const useGetGetAuthnDescriptor = buildUseQuery({ + builderQueryFn: createGetGetAuthnDescriptor, + queryKeyPrefix: "GetAuthnDescriptorQuery" +}); +export const useGetGetChainDescriptor = buildUseQuery({ + builderQueryFn: createGetGetChainDescriptor, + queryKeyPrefix: "GetChainDescriptorQuery" +}); +export const useGetGetCodecDescriptor = buildUseQuery({ + builderQueryFn: createGetGetCodecDescriptor, + queryKeyPrefix: "GetCodecDescriptorQuery" +}); +export const useGetGetConfigurationDescriptor = buildUseQuery({ + builderQueryFn: createGetGetConfigurationDescriptor, + queryKeyPrefix: "GetConfigurationDescriptorQuery" +}); +export const useGetGetQueryServicesDescriptor = buildUseQuery({ + builderQueryFn: createGetGetQueryServicesDescriptor, + queryKeyPrefix: "GetQueryServicesDescriptorQuery" +}); +export const useGetGetTxDescriptor = buildUseQuery({ + builderQueryFn: createGetGetTxDescriptor, + queryKeyPrefix: "GetTxDescriptorQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts index a3d7ae59..98462641 100644 --- a/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../../helper-func-types"; -import { buildUseQuery } from "../../../../react-query"; import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; export const createGetGetNodeInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: GetNodeInfoRequest.encode, @@ -9,10 +8,6 @@ export const createGetGetNodeInfo = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [GetNodeInfoRequest, GetNodeInfoResponse] }); -export const useGetGetNodeInfo = buildUseQuery({ - builderQueryFn: createGetGetNodeInfo, - queryKeyPrefix: "GetNodeInfoQuery" -}); export const createGetGetSyncing = (clientResolver?: RpcResolver) => buildQuery({ encode: GetSyncingRequest.encode, decode: GetSyncingResponse.decode, @@ -21,10 +16,6 @@ export const createGetGetSyncing = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [GetSyncingRequest, GetSyncingResponse] }); -export const useGetGetSyncing = buildUseQuery({ - builderQueryFn: createGetGetSyncing, - queryKeyPrefix: "GetSyncingQuery" -}); export const createGetGetLatestBlock = (clientResolver?: RpcResolver) => buildQuery({ encode: GetLatestBlockRequest.encode, decode: GetLatestBlockResponse.decode, @@ -33,10 +24,6 @@ export const createGetGetLatestBlock = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [GetLatestBlockRequest, GetLatestBlockResponse] }); -export const useGetGetLatestBlock = buildUseQuery({ - builderQueryFn: createGetGetLatestBlock, - queryKeyPrefix: "GetLatestBlockQuery" -}); export const createGetGetBlockByHeight = (clientResolver?: RpcResolver) => buildQuery({ encode: GetBlockByHeightRequest.encode, decode: GetBlockByHeightResponse.decode, @@ -45,10 +32,6 @@ export const createGetGetBlockByHeight = (clientResolver?: RpcResolver) => build clientResolver, deps: [GetBlockByHeightRequest, GetBlockByHeightResponse] }); -export const useGetGetBlockByHeight = buildUseQuery({ - builderQueryFn: createGetGetBlockByHeight, - queryKeyPrefix: "GetBlockByHeightQuery" -}); export const createGetGetLatestValidatorSet = (clientResolver?: RpcResolver) => buildQuery({ encode: GetLatestValidatorSetRequest.encode, decode: GetLatestValidatorSetResponse.decode, @@ -57,10 +40,6 @@ export const createGetGetLatestValidatorSet = (clientResolver?: RpcResolver) => clientResolver, deps: [GetLatestValidatorSetRequest, GetLatestValidatorSetResponse] }); -export const useGetGetLatestValidatorSet = buildUseQuery({ - builderQueryFn: createGetGetLatestValidatorSet, - queryKeyPrefix: "GetLatestValidatorSetQuery" -}); export const createGetGetValidatorSetByHeight = (clientResolver?: RpcResolver) => buildQuery({ encode: GetValidatorSetByHeightRequest.encode, decode: GetValidatorSetByHeightResponse.decode, @@ -69,10 +48,6 @@ export const createGetGetValidatorSetByHeight = (clientResolver?: RpcResolver) = clientResolver, deps: [GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse] }); -export const useGetGetValidatorSetByHeight = buildUseQuery({ - builderQueryFn: createGetGetValidatorSetByHeight, - queryKeyPrefix: "GetValidatorSetByHeightQuery" -}); export const createGetABCIQuery = (clientResolver?: RpcResolver) => buildQuery({ encode: ABCIQueryRequest.encode, decode: ABCIQueryResponse.decode, @@ -80,8 +55,4 @@ export const createGetABCIQuery = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetABCIQuery, - queryKeyPrefix: "ABCIQueryQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..7cf00d13 --- /dev/null +++ b/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts @@ -0,0 +1,31 @@ +import { buildUseQuery } from "../../../../react-query"; +import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; +import { createGetGetNodeInfo, createGetGetSyncing, createGetGetLatestBlock, createGetGetBlockByHeight, createGetGetLatestValidatorSet, createGetGetValidatorSetByHeight, createGetABCIQuery } from "./query.rpc.func.ts"; +export const useGetGetNodeInfo = buildUseQuery({ + builderQueryFn: createGetGetNodeInfo, + queryKeyPrefix: "GetNodeInfoQuery" +}); +export const useGetGetSyncing = buildUseQuery({ + builderQueryFn: createGetGetSyncing, + queryKeyPrefix: "GetSyncingQuery" +}); +export const useGetGetLatestBlock = buildUseQuery({ + builderQueryFn: createGetGetLatestBlock, + queryKeyPrefix: "GetLatestBlockQuery" +}); +export const useGetGetBlockByHeight = buildUseQuery({ + builderQueryFn: createGetGetBlockByHeight, + queryKeyPrefix: "GetBlockByHeightQuery" +}); +export const useGetGetLatestValidatorSet = buildUseQuery({ + builderQueryFn: createGetGetLatestValidatorSet, + queryKeyPrefix: "GetLatestValidatorSetQuery" +}); +export const useGetGetValidatorSetByHeight = buildUseQuery({ + builderQueryFn: createGetGetValidatorSetByHeight, + queryKeyPrefix: "GetValidatorSetByHeightQuery" +}); +export const useGetABCIQuery = buildUseQuery({ + builderQueryFn: createGetABCIQuery, + queryKeyPrefix: "ABCIQueryQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.func.ts index 9e672c12..e008f1f8 100644 --- a/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse } from "./query"; export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountRequest.encode, @@ -9,10 +8,6 @@ export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAccount, - queryKeyPrefix: "AccountQuery" -}); export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAccountsRequest.encode, decode: AccountsResponse.decode, @@ -21,10 +16,6 @@ export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAccounts, - queryKeyPrefix: "AccountsQuery" -}); export const createGetDisabledList = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDisabledListRequest.encode, decode: DisabledListResponse.decode, @@ -32,8 +23,4 @@ export const createGetDisabledList = (clientResolver?: RpcResolver) => buildQuer method: "DisabledList", clientResolver, deps: [QueryDisabledListRequest, DisabledListResponse] -}); -export const useGetDisabledList = buildUseQuery({ - builderQueryFn: createGetDisabledList, - queryKeyPrefix: "DisabledListQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts new file mode 100644 index 00000000..f4548b1e --- /dev/null +++ b/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse } from "./query"; +import { createGetAccount, createGetAccounts, createGetDisabledList } from "./query.rpc.func.ts"; +export const useGetAccount = buildUseQuery({ + builderQueryFn: createGetAccount, + queryKeyPrefix: "AccountQuery" +}); +export const useGetAccounts = buildUseQuery({ + builderQueryFn: createGetAccounts, + queryKeyPrefix: "AccountsQuery" +}); +export const useGetDisabledList = buildUseQuery({ + builderQueryFn: createGetDisabledList, + queryKeyPrefix: "DisabledListQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.func.ts index 31b3b7f0..4d785a72 100644 --- a/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; export const createAuthorizeCircuitBreaker = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createAuthorizeCircuitBreaker = (clientResolver?: SigningClientReso converters: toConverters(MsgAuthorizeCircuitBreaker), deps: [MsgAuthorizeCircuitBreaker] }); -export const useAuthorizeCircuitBreaker = buildUseMutation({ - builderMutationFn: createAuthorizeCircuitBreaker -}); export const createTripCircuitBreaker = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgTripCircuitBreaker.typeUrl, @@ -19,16 +15,10 @@ export const createTripCircuitBreaker = (clientResolver?: SigningClientResolver) converters: toConverters(MsgTripCircuitBreaker), deps: [MsgTripCircuitBreaker] }); -export const useTripCircuitBreaker = buildUseMutation({ - builderMutationFn: createTripCircuitBreaker -}); export const createResetCircuitBreaker = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgResetCircuitBreaker.typeUrl, encoders: toEncoders(MsgResetCircuitBreaker), converters: toConverters(MsgResetCircuitBreaker), deps: [MsgResetCircuitBreaker] -}); -export const useResetCircuitBreaker = buildUseMutation({ - builderMutationFn: createResetCircuitBreaker }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts new file mode 100644 index 00000000..6b57729f --- /dev/null +++ b/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts @@ -0,0 +1,12 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; +import { createAuthorizeCircuitBreaker, createTripCircuitBreaker, createResetCircuitBreaker } from "./tx.rpc.func.ts"; +export const useAuthorizeCircuitBreaker = buildUseMutation({ + builderMutationFn: createAuthorizeCircuitBreaker +}); +export const useTripCircuitBreaker = buildUseMutation({ + builderMutationFn: createTripCircuitBreaker +}); +export const useResetCircuitBreaker = buildUseMutation({ + builderMutationFn: createResetCircuitBreaker +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.func.ts index 1d4a7756..0372c167 100644 --- a/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -8,8 +7,4 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts new file mode 100644 index 00000000..7604e464 --- /dev/null +++ b/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts @@ -0,0 +1,7 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +import { createGetParams } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.func.ts index 1e1ff831..6cf89cb1 100644 --- a/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams } from "./tx"; export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -8,7 +7,4 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts new file mode 100644 index 00000000..427464a2 --- /dev/null +++ b/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts @@ -0,0 +1,6 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgUpdateParams } from "./tx"; +import { createUpdateParams } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.func.ts index 7fbed294..e7504501 100644 --- a/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; export const createVerifyInvariant = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,16 +8,10 @@ export const createVerifyInvariant = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgVerifyInvariant), deps: [MsgVerifyInvariant] }); -export const useVerifyInvariant = buildUseMutation({ - builderMutationFn: createVerifyInvariant -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..e7c209e3 --- /dev/null +++ b/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts @@ -0,0 +1,9 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; +import { createVerifyInvariant, createUpdateParams } from "./tx.rpc.func.ts"; +export const useVerifyInvariant = buildUseMutation({ + builderMutationFn: createVerifyInvariant +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.func.ts index e96a8c8f..123dddd2 100644 --- a/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetValidatorDistributionInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorDistributionInfoRequest.encode, decode: QueryValidatorDistributionInfoResponse.decode, @@ -21,10 +16,6 @@ export const createGetValidatorDistributionInfo = (clientResolver?: RpcResolver) clientResolver, deps: [QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse] }); -export const useGetValidatorDistributionInfo = buildUseQuery({ - builderQueryFn: createGetValidatorDistributionInfo, - queryKeyPrefix: "ValidatorDistributionInfoQuery" -}); export const createGetValidatorOutstandingRewards = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorOutstandingRewardsRequest.encode, decode: QueryValidatorOutstandingRewardsResponse.decode, @@ -33,10 +24,6 @@ export const createGetValidatorOutstandingRewards = (clientResolver?: RpcResolve clientResolver, deps: [QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse] }); -export const useGetValidatorOutstandingRewards = buildUseQuery({ - builderQueryFn: createGetValidatorOutstandingRewards, - queryKeyPrefix: "ValidatorOutstandingRewardsQuery" -}); export const createGetValidatorCommission = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorCommissionRequest.encode, decode: QueryValidatorCommissionResponse.decode, @@ -45,10 +32,6 @@ export const createGetValidatorCommission = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryValidatorCommissionRequest, QueryValidatorCommissionResponse] }); -export const useGetValidatorCommission = buildUseQuery({ - builderQueryFn: createGetValidatorCommission, - queryKeyPrefix: "ValidatorCommissionQuery" -}); export const createGetValidatorSlashes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorSlashesRequest.encode, decode: QueryValidatorSlashesResponse.decode, @@ -57,10 +40,6 @@ export const createGetValidatorSlashes = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryValidatorSlashesRequest, QueryValidatorSlashesResponse] }); -export const useGetValidatorSlashes = buildUseQuery({ - builderQueryFn: createGetValidatorSlashes, - queryKeyPrefix: "ValidatorSlashesQuery" -}); export const createGetDelegationRewards = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegationRewardsRequest.encode, decode: QueryDelegationRewardsResponse.decode, @@ -69,10 +48,6 @@ export const createGetDelegationRewards = (clientResolver?: RpcResolver) => buil clientResolver, deps: [QueryDelegationRewardsRequest, QueryDelegationRewardsResponse] }); -export const useGetDelegationRewards = buildUseQuery({ - builderQueryFn: createGetDelegationRewards, - queryKeyPrefix: "DelegationRewardsQuery" -}); export const createGetDelegationTotalRewards = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegationTotalRewardsRequest.encode, decode: QueryDelegationTotalRewardsResponse.decode, @@ -81,10 +56,6 @@ export const createGetDelegationTotalRewards = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse] }); -export const useGetDelegationTotalRewards = buildUseQuery({ - builderQueryFn: createGetDelegationTotalRewards, - queryKeyPrefix: "DelegationTotalRewardsQuery" -}); export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorValidatorsRequest.encode, decode: QueryDelegatorValidatorsResponse.decode, @@ -93,10 +64,6 @@ export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse] }); -export const useGetDelegatorValidators = buildUseQuery({ - builderQueryFn: createGetDelegatorValidators, - queryKeyPrefix: "DelegatorValidatorsQuery" -}); export const createGetDelegatorWithdrawAddress = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorWithdrawAddressRequest.encode, decode: QueryDelegatorWithdrawAddressResponse.decode, @@ -105,10 +72,6 @@ export const createGetDelegatorWithdrawAddress = (clientResolver?: RpcResolver) clientResolver, deps: [QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse] }); -export const useGetDelegatorWithdrawAddress = buildUseQuery({ - builderQueryFn: createGetDelegatorWithdrawAddress, - queryKeyPrefix: "DelegatorWithdrawAddressQuery" -}); export const createGetCommunityPool = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCommunityPoolRequest.encode, decode: QueryCommunityPoolResponse.decode, @@ -116,8 +79,4 @@ export const createGetCommunityPool = (clientResolver?: RpcResolver) => buildQue method: "CommunityPool", clientResolver, deps: [QueryCommunityPoolRequest, QueryCommunityPoolResponse] -}); -export const useGetCommunityPool = buildUseQuery({ - builderQueryFn: createGetCommunityPool, - queryKeyPrefix: "CommunityPoolQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..3b34a74d --- /dev/null +++ b/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts @@ -0,0 +1,43 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; +import { createGetParams, createGetValidatorDistributionInfo, createGetValidatorOutstandingRewards, createGetValidatorCommission, createGetValidatorSlashes, createGetDelegationRewards, createGetDelegationTotalRewards, createGetDelegatorValidators, createGetDelegatorWithdrawAddress, createGetCommunityPool } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetValidatorDistributionInfo = buildUseQuery({ + builderQueryFn: createGetValidatorDistributionInfo, + queryKeyPrefix: "ValidatorDistributionInfoQuery" +}); +export const useGetValidatorOutstandingRewards = buildUseQuery({ + builderQueryFn: createGetValidatorOutstandingRewards, + queryKeyPrefix: "ValidatorOutstandingRewardsQuery" +}); +export const useGetValidatorCommission = buildUseQuery({ + builderQueryFn: createGetValidatorCommission, + queryKeyPrefix: "ValidatorCommissionQuery" +}); +export const useGetValidatorSlashes = buildUseQuery({ + builderQueryFn: createGetValidatorSlashes, + queryKeyPrefix: "ValidatorSlashesQuery" +}); +export const useGetDelegationRewards = buildUseQuery({ + builderQueryFn: createGetDelegationRewards, + queryKeyPrefix: "DelegationRewardsQuery" +}); +export const useGetDelegationTotalRewards = buildUseQuery({ + builderQueryFn: createGetDelegationTotalRewards, + queryKeyPrefix: "DelegationTotalRewardsQuery" +}); +export const useGetDelegatorValidators = buildUseQuery({ + builderQueryFn: createGetDelegatorValidators, + queryKeyPrefix: "DelegatorValidatorsQuery" +}); +export const useGetDelegatorWithdrawAddress = buildUseQuery({ + builderQueryFn: createGetDelegatorWithdrawAddress, + queryKeyPrefix: "DelegatorWithdrawAddressQuery" +}); +export const useGetCommunityPool = buildUseQuery({ + builderQueryFn: createGetCommunityPool, + queryKeyPrefix: "CommunityPoolQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts index 026741df..28bf1510 100644 --- a/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) converters: toConverters(MsgSetWithdrawAddress), deps: [MsgSetWithdrawAddress] }); -export const useSetWithdrawAddress = buildUseMutation({ - builderMutationFn: createSetWithdrawAddress -}); export const createWithdrawDelegatorReward = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawDelegatorReward.typeUrl, @@ -19,9 +15,6 @@ export const createWithdrawDelegatorReward = (clientResolver?: SigningClientReso converters: toConverters(MsgWithdrawDelegatorReward), deps: [MsgWithdrawDelegatorReward] }); -export const useWithdrawDelegatorReward = buildUseMutation({ - builderMutationFn: createWithdrawDelegatorReward -}); export const createWithdrawValidatorCommission = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawValidatorCommission.typeUrl, @@ -29,9 +22,6 @@ export const createWithdrawValidatorCommission = (clientResolver?: SigningClient converters: toConverters(MsgWithdrawValidatorCommission), deps: [MsgWithdrawValidatorCommission] }); -export const useWithdrawValidatorCommission = buildUseMutation({ - builderMutationFn: createWithdrawValidatorCommission -}); export const createFundCommunityPool = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgFundCommunityPool.typeUrl, @@ -39,9 +29,6 @@ export const createFundCommunityPool = (clientResolver?: SigningClientResolver) converters: toConverters(MsgFundCommunityPool), deps: [MsgFundCommunityPool] }); -export const useFundCommunityPool = buildUseMutation({ - builderMutationFn: createFundCommunityPool -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -49,9 +36,6 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCommunityPoolSpend.typeUrl, @@ -59,16 +43,10 @@ export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) converters: toConverters(MsgCommunityPoolSpend), deps: [MsgCommunityPoolSpend] }); -export const useCommunityPoolSpend = buildUseMutation({ - builderMutationFn: createCommunityPoolSpend -}); export const createDepositValidatorRewardsPool = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDepositValidatorRewardsPool.typeUrl, encoders: toEncoders(MsgDepositValidatorRewardsPool), converters: toConverters(MsgDepositValidatorRewardsPool), deps: [MsgDepositValidatorRewardsPool] -}); -export const useDepositValidatorRewardsPool = buildUseMutation({ - builderMutationFn: createDepositValidatorRewardsPool }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..8cbf0e11 --- /dev/null +++ b/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +export const useSetWithdrawAddress = buildUseMutation({ + builderMutationFn: createSetWithdrawAddress +}); +export const useWithdrawDelegatorReward = buildUseMutation({ + builderMutationFn: createWithdrawDelegatorReward +}); +export const useWithdrawValidatorCommission = buildUseMutation({ + builderMutationFn: createWithdrawValidatorCommission +}); +export const useFundCommunityPool = buildUseMutation({ + builderMutationFn: createFundCommunityPool +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useCommunityPoolSpend = buildUseMutation({ + builderMutationFn: createCommunityPoolSpend +}); +export const useDepositValidatorRewardsPool = buildUseMutation({ + builderMutationFn: createDepositValidatorRewardsPool +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.func.ts index 8a8f28f1..2856b944 100644 --- a/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse } from "./query"; export const createGetEvidence = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryEvidenceRequest.encode, @@ -9,10 +8,6 @@ export const createGetEvidence = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetEvidence, - queryKeyPrefix: "EvidenceQuery" -}); export const createGetAllEvidence = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllEvidenceRequest.encode, decode: QueryAllEvidenceResponse.decode, @@ -20,8 +15,4 @@ export const createGetAllEvidence = (clientResolver?: RpcResolver) => buildQuery method: "AllEvidence", clientResolver, deps: [QueryAllEvidenceRequest, QueryAllEvidenceResponse] -}); -export const useGetAllEvidence = buildUseQuery({ - builderQueryFn: createGetAllEvidence, - queryKeyPrefix: "AllEvidenceQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..6db1024e --- /dev/null +++ b/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts @@ -0,0 +1,11 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse } from "./query"; +import { createGetEvidence, createGetAllEvidence } from "./query.rpc.func.ts"; +export const useGetEvidence = buildUseQuery({ + builderQueryFn: createGetEvidence, + queryKeyPrefix: "EvidenceQuery" +}); +export const useGetAllEvidence = buildUseQuery({ + builderQueryFn: createGetAllEvidence, + queryKeyPrefix: "AllEvidenceQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.func.ts index 35582ea3..c7960b9e 100644 --- a/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSubmitEvidence } from "./tx"; export const createSubmitEvidence = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -8,7 +7,4 @@ export const createSubmitEvidence = (clientResolver?: SigningClientResolver) => encoders: toEncoders(MsgSubmitEvidence), converters: toConverters(MsgSubmitEvidence), deps: [MsgSubmitEvidence] -}); -export const useSubmitEvidence = buildUseMutation({ - builderMutationFn: createSubmitEvidence }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..57f78e5e --- /dev/null +++ b/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts @@ -0,0 +1,6 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSubmitEvidence } from "./tx"; +import { createSubmitEvidence } from "./tx.rpc.func.ts"; +export const useSubmitEvidence = buildUseMutation({ + builderMutationFn: createSubmitEvidence +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.func.ts index cc28dc48..dec2fba5 100644 --- a/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; export const createGetAllowance = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllowanceRequest.encode, @@ -9,10 +8,6 @@ export const createGetAllowance = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAllowance, - queryKeyPrefix: "AllowanceQuery" -}); export const createGetAllowances = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllowancesRequest.encode, decode: QueryAllowancesResponse.decode, @@ -21,10 +16,6 @@ export const createGetAllowances = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QueryAllowancesRequest, QueryAllowancesResponse] }); -export const useGetAllowances = buildUseQuery({ - builderQueryFn: createGetAllowances, - queryKeyPrefix: "AllowancesQuery" -}); export const createGetAllowancesByGranter = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllowancesByGranterRequest.encode, decode: QueryAllowancesByGranterResponse.decode, @@ -32,8 +23,4 @@ export const createGetAllowancesByGranter = (clientResolver?: RpcResolver) => bu method: "AllowancesByGranter", clientResolver, deps: [QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse] -}); -export const useGetAllowancesByGranter = buildUseQuery({ - builderQueryFn: createGetAllowancesByGranter, - queryKeyPrefix: "AllowancesByGranterQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..2e06e17a --- /dev/null +++ b/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; +import { createGetAllowance, createGetAllowances, createGetAllowancesByGranter } from "./query.rpc.func.ts"; +export const useGetAllowance = buildUseQuery({ + builderQueryFn: createGetAllowance, + queryKeyPrefix: "AllowanceQuery" +}); +export const useGetAllowances = buildUseQuery({ + builderQueryFn: createGetAllowances, + queryKeyPrefix: "AllowancesQuery" +}); +export const useGetAllowancesByGranter = buildUseQuery({ + builderQueryFn: createGetAllowancesByGranter, + queryKeyPrefix: "AllowancesByGranterQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts index 70353a74..344d1149 100644 --- a/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; export const createGrantAllowance = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createGrantAllowance = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgGrantAllowance), deps: [MsgGrantAllowance] }); -export const useGrantAllowance = buildUseMutation({ - builderMutationFn: createGrantAllowance -}); export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRevokeAllowance.typeUrl, @@ -19,16 +15,10 @@ export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgRevokeAllowance), deps: [MsgRevokeAllowance] }); -export const useRevokeAllowance = buildUseMutation({ - builderMutationFn: createRevokeAllowance -}); export const createPruneAllowances = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgPruneAllowances.typeUrl, encoders: toEncoders(MsgPruneAllowances), converters: toConverters(MsgPruneAllowances), deps: [MsgPruneAllowances] -}); -export const usePruneAllowances = buildUseMutation({ - builderMutationFn: createPruneAllowances }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..72de88dc --- /dev/null +++ b/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts @@ -0,0 +1,12 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +export const useGrantAllowance = buildUseMutation({ + builderMutationFn: createGrantAllowance +}); +export const useRevokeAllowance = buildUseMutation({ + builderMutationFn: createRevokeAllowance +}); +export const usePruneAllowances = buildUseMutation({ + builderMutationFn: createPruneAllowances +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/gov/v1/query.rpc.func.ts index d1342988..1b3fe8c8 100644 --- a/libs/interchain-react/src/cosmos/gov/v1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/gov/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; export const createGetConstitution = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryConstitutionRequest.encode, @@ -9,10 +8,6 @@ export const createGetConstitution = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryConstitutionRequest, QueryConstitutionResponse] }); -export const useGetConstitution = buildUseQuery({ - builderQueryFn: createGetConstitution, - queryKeyPrefix: "ConstitutionQuery" -}); export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalRequest.encode, decode: QueryProposalResponse.decode, @@ -21,10 +16,6 @@ export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetProposal, - queryKeyPrefix: "ProposalQuery" -}); export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalsRequest.encode, decode: QueryProposalsResponse.decode, @@ -33,10 +24,6 @@ export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetProposals, - queryKeyPrefix: "ProposalsQuery" -}); export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVoteRequest.encode, decode: QueryVoteResponse.decode, @@ -45,10 +32,6 @@ export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetVote, - queryKeyPrefix: "VoteQuery" -}); export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVotesRequest.encode, decode: QueryVotesResponse.decode, @@ -57,10 +40,6 @@ export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetVotes, - queryKeyPrefix: "VotesQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -69,10 +48,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDepositRequest.encode, decode: QueryDepositResponse.decode, @@ -81,10 +56,6 @@ export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetDeposit, - queryKeyPrefix: "DepositQuery" -}); export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDepositsRequest.encode, decode: QueryDepositsResponse.decode, @@ -93,10 +64,6 @@ export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetDeposits, - queryKeyPrefix: "DepositsQuery" -}); export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTallyResultRequest.encode, decode: QueryTallyResultResponse.decode, @@ -104,8 +71,4 @@ export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery method: "TallyResult", clientResolver, deps: [QueryTallyResultRequest, QueryTallyResultResponse] -}); -export const useGetTallyResult = buildUseQuery({ - builderQueryFn: createGetTallyResult, - queryKeyPrefix: "TallyResultQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts new file mode 100644 index 00000000..7a51b586 --- /dev/null +++ b/libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts @@ -0,0 +1,39 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +import { createGetConstitution, createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +export const useGetConstitution = buildUseQuery({ + builderQueryFn: createGetConstitution, + queryKeyPrefix: "ConstitutionQuery" +}); +export const useGetProposal = buildUseQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposals = buildUseQuery({ + builderQueryFn: createGetProposals, + queryKeyPrefix: "ProposalsQuery" +}); +export const useGetVote = buildUseQuery({ + builderQueryFn: createGetVote, + queryKeyPrefix: "VoteQuery" +}); +export const useGetVotes = buildUseQuery({ + builderQueryFn: createGetVotes, + queryKeyPrefix: "VotesQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDeposit = buildUseQuery({ + builderQueryFn: createGetDeposit, + queryKeyPrefix: "DepositQuery" +}); +export const useGetDeposits = buildUseQuery({ + builderQueryFn: createGetDeposits, + queryKeyPrefix: "DepositsQuery" +}); +export const useGetTallyResult = buildUseQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.func.ts index 1e23e126..21c06ac1 100644 --- a/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSubmitProposal = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgSubmitProposal), deps: [MsgSubmitProposal] }); -export const useSubmitProposal = buildUseMutation({ - builderMutationFn: createSubmitProposal -}); export const createExecLegacyContent = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExecLegacyContent.typeUrl, @@ -19,9 +15,6 @@ export const createExecLegacyContent = (clientResolver?: SigningClientResolver) converters: toConverters(MsgExecLegacyContent), deps: [MsgExecLegacyContent] }); -export const useExecLegacyContent = buildUseMutation({ - builderMutationFn: createExecLegacyContent -}); export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVote.typeUrl, @@ -29,9 +22,6 @@ export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createVote -}); export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVoteWeighted.typeUrl, @@ -39,9 +29,6 @@ export const createVoteWeighted = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgVoteWeighted), deps: [MsgVoteWeighted] }); -export const useVoteWeighted = buildUseMutation({ - builderMutationFn: createVoteWeighted -}); export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDeposit.typeUrl, @@ -49,9 +36,6 @@ export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx converters: toConverters(MsgDeposit), deps: [MsgDeposit] }); -export const useDeposit = buildUseMutation({ - builderMutationFn: createDeposit -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -59,16 +43,10 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createCancelProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelProposal.typeUrl, encoders: toEncoders(MsgCancelProposal), converters: toConverters(MsgCancelProposal), deps: [MsgCancelProposal] -}); -export const useCancelProposal = buildUseMutation({ - builderMutationFn: createCancelProposal }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts new file mode 100644 index 00000000..45490d6f --- /dev/null +++ b/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const useExecLegacyContent = buildUseMutation({ + builderMutationFn: createExecLegacyContent +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useCancelProposal = buildUseMutation({ + builderMutationFn: createCancelProposal +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.func.ts index fc5de4b2..93896ba8 100644 --- a/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalRequest.encode, @@ -9,10 +8,6 @@ export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetProposal, - queryKeyPrefix: "ProposalQuery" -}); export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalsRequest.encode, decode: QueryProposalsResponse.decode, @@ -21,10 +16,6 @@ export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetProposals, - queryKeyPrefix: "ProposalsQuery" -}); export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVoteRequest.encode, decode: QueryVoteResponse.decode, @@ -33,10 +24,6 @@ export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetVote, - queryKeyPrefix: "VoteQuery" -}); export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVotesRequest.encode, decode: QueryVotesResponse.decode, @@ -45,10 +32,6 @@ export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetVotes, - queryKeyPrefix: "VotesQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -57,10 +40,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDepositRequest.encode, decode: QueryDepositResponse.decode, @@ -69,10 +48,6 @@ export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetDeposit, - queryKeyPrefix: "DepositQuery" -}); export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDepositsRequest.encode, decode: QueryDepositsResponse.decode, @@ -81,10 +56,6 @@ export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetDeposits, - queryKeyPrefix: "DepositsQuery" -}); export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTallyResultRequest.encode, decode: QueryTallyResultResponse.decode, @@ -92,8 +63,4 @@ export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery method: "TallyResult", clientResolver, deps: [QueryTallyResultRequest, QueryTallyResultResponse] -}); -export const useGetTallyResult = buildUseQuery({ - builderQueryFn: createGetTallyResult, - queryKeyPrefix: "TallyResultQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..5f574fba --- /dev/null +++ b/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts @@ -0,0 +1,35 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +export const useGetProposal = buildUseQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposals = buildUseQuery({ + builderQueryFn: createGetProposals, + queryKeyPrefix: "ProposalsQuery" +}); +export const useGetVote = buildUseQuery({ + builderQueryFn: createGetVote, + queryKeyPrefix: "VoteQuery" +}); +export const useGetVotes = buildUseQuery({ + builderQueryFn: createGetVotes, + queryKeyPrefix: "VotesQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDeposit = buildUseQuery({ + builderQueryFn: createGetDeposit, + queryKeyPrefix: "DepositQuery" +}); +export const useGetDeposits = buildUseQuery({ + builderQueryFn: createGetDeposits, + queryKeyPrefix: "DepositsQuery" +}); +export const useGetTallyResult = buildUseQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts index 3dcafe92..aecdfcb7 100644 --- a/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createSubmitProposal = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgSubmitProposal), deps: [MsgSubmitProposal] }); -export const useSubmitProposal = buildUseMutation({ - builderMutationFn: createSubmitProposal -}); export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVote.typeUrl, @@ -19,9 +15,6 @@ export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createVote -}); export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVoteWeighted.typeUrl, @@ -29,16 +22,10 @@ export const createVoteWeighted = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgVoteWeighted), deps: [MsgVoteWeighted] }); -export const useVoteWeighted = buildUseMutation({ - builderMutationFn: createVoteWeighted -}); export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDeposit.typeUrl, encoders: toEncoders(MsgDeposit), converters: toConverters(MsgDeposit), deps: [MsgDeposit] -}); -export const useDeposit = buildUseMutation({ - builderMutationFn: createDeposit }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..b2fb7805 --- /dev/null +++ b/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/group/v1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/group/v1/query.rpc.func.ts index 65371b9d..f339bd9a 100644 --- a/libs/interchain-react/src/cosmos/group/v1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/group/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse } from "./query"; export const createGetGroupInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupInfoRequest.encode, @@ -9,10 +8,6 @@ export const createGetGroupInfo = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetGroupInfo, - queryKeyPrefix: "GroupInfoQuery" -}); export const createGetGroupPolicyInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupPolicyInfoRequest.encode, decode: QueryGroupPolicyInfoResponse.decode, @@ -21,10 +16,6 @@ export const createGetGroupPolicyInfo = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse] }); -export const useGetGroupPolicyInfo = buildUseQuery({ - builderQueryFn: createGetGroupPolicyInfo, - queryKeyPrefix: "GroupPolicyInfoQuery" -}); export const createGetGroupMembers = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupMembersRequest.encode, decode: QueryGroupMembersResponse.decode, @@ -33,10 +24,6 @@ export const createGetGroupMembers = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryGroupMembersRequest, QueryGroupMembersResponse] }); -export const useGetGroupMembers = buildUseQuery({ - builderQueryFn: createGetGroupMembers, - queryKeyPrefix: "GroupMembersQuery" -}); export const createGetGroupsByAdmin = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupsByAdminRequest.encode, decode: QueryGroupsByAdminResponse.decode, @@ -45,10 +32,6 @@ export const createGetGroupsByAdmin = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryGroupsByAdminRequest, QueryGroupsByAdminResponse] }); -export const useGetGroupsByAdmin = buildUseQuery({ - builderQueryFn: createGetGroupsByAdmin, - queryKeyPrefix: "GroupsByAdminQuery" -}); export const createGetGroupPoliciesByGroup = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupPoliciesByGroupRequest.encode, decode: QueryGroupPoliciesByGroupResponse.decode, @@ -57,10 +40,6 @@ export const createGetGroupPoliciesByGroup = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse] }); -export const useGetGroupPoliciesByGroup = buildUseQuery({ - builderQueryFn: createGetGroupPoliciesByGroup, - queryKeyPrefix: "GroupPoliciesByGroupQuery" -}); export const createGetGroupPoliciesByAdmin = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupPoliciesByAdminRequest.encode, decode: QueryGroupPoliciesByAdminResponse.decode, @@ -69,10 +48,6 @@ export const createGetGroupPoliciesByAdmin = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse] }); -export const useGetGroupPoliciesByAdmin = buildUseQuery({ - builderQueryFn: createGetGroupPoliciesByAdmin, - queryKeyPrefix: "GroupPoliciesByAdminQuery" -}); export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalRequest.encode, decode: QueryProposalResponse.decode, @@ -81,10 +56,6 @@ export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetProposal, - queryKeyPrefix: "ProposalQuery" -}); export const createGetProposalsByGroupPolicy = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryProposalsByGroupPolicyRequest.encode, decode: QueryProposalsByGroupPolicyResponse.decode, @@ -93,10 +64,6 @@ export const createGetProposalsByGroupPolicy = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse] }); -export const useGetProposalsByGroupPolicy = buildUseQuery({ - builderQueryFn: createGetProposalsByGroupPolicy, - queryKeyPrefix: "ProposalsByGroupPolicyQuery" -}); export const createGetVoteByProposalVoter = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVoteByProposalVoterRequest.encode, decode: QueryVoteByProposalVoterResponse.decode, @@ -105,10 +72,6 @@ export const createGetVoteByProposalVoter = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse] }); -export const useGetVoteByProposalVoter = buildUseQuery({ - builderQueryFn: createGetVoteByProposalVoter, - queryKeyPrefix: "VoteByProposalVoterQuery" -}); export const createGetVotesByProposal = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVotesByProposalRequest.encode, decode: QueryVotesByProposalResponse.decode, @@ -117,10 +80,6 @@ export const createGetVotesByProposal = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryVotesByProposalRequest, QueryVotesByProposalResponse] }); -export const useGetVotesByProposal = buildUseQuery({ - builderQueryFn: createGetVotesByProposal, - queryKeyPrefix: "VotesByProposalQuery" -}); export const createGetVotesByVoter = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryVotesByVoterRequest.encode, decode: QueryVotesByVoterResponse.decode, @@ -129,10 +88,6 @@ export const createGetVotesByVoter = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryVotesByVoterRequest, QueryVotesByVoterResponse] }); -export const useGetVotesByVoter = buildUseQuery({ - builderQueryFn: createGetVotesByVoter, - queryKeyPrefix: "VotesByVoterQuery" -}); export const createGetGroupsByMember = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupsByMemberRequest.encode, decode: QueryGroupsByMemberResponse.decode, @@ -141,10 +96,6 @@ export const createGetGroupsByMember = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryGroupsByMemberRequest, QueryGroupsByMemberResponse] }); -export const useGetGroupsByMember = buildUseQuery({ - builderQueryFn: createGetGroupsByMember, - queryKeyPrefix: "GroupsByMemberQuery" -}); export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryTallyResultRequest.encode, decode: QueryTallyResultResponse.decode, @@ -153,10 +104,6 @@ export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryTallyResultRequest, QueryTallyResultResponse] }); -export const useGetTallyResult = buildUseQuery({ - builderQueryFn: createGetTallyResult, - queryKeyPrefix: "TallyResultQuery" -}); export const createGetGroups = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryGroupsRequest.encode, decode: QueryGroupsResponse.decode, @@ -164,8 +111,4 @@ export const createGetGroups = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetGroups, - queryKeyPrefix: "GroupsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts new file mode 100644 index 00000000..cd6fda98 --- /dev/null +++ b/libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts @@ -0,0 +1,59 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse } from "./query"; +import { createGetGroupInfo, createGetGroupPolicyInfo, createGetGroupMembers, createGetGroupsByAdmin, createGetGroupPoliciesByGroup, createGetGroupPoliciesByAdmin, createGetProposal, createGetProposalsByGroupPolicy, createGetVoteByProposalVoter, createGetVotesByProposal, createGetVotesByVoter, createGetGroupsByMember, createGetTallyResult, createGetGroups } from "./query.rpc.func.ts"; +export const useGetGroupInfo = buildUseQuery({ + builderQueryFn: createGetGroupInfo, + queryKeyPrefix: "GroupInfoQuery" +}); +export const useGetGroupPolicyInfo = buildUseQuery({ + builderQueryFn: createGetGroupPolicyInfo, + queryKeyPrefix: "GroupPolicyInfoQuery" +}); +export const useGetGroupMembers = buildUseQuery({ + builderQueryFn: createGetGroupMembers, + queryKeyPrefix: "GroupMembersQuery" +}); +export const useGetGroupsByAdmin = buildUseQuery({ + builderQueryFn: createGetGroupsByAdmin, + queryKeyPrefix: "GroupsByAdminQuery" +}); +export const useGetGroupPoliciesByGroup = buildUseQuery({ + builderQueryFn: createGetGroupPoliciesByGroup, + queryKeyPrefix: "GroupPoliciesByGroupQuery" +}); +export const useGetGroupPoliciesByAdmin = buildUseQuery({ + builderQueryFn: createGetGroupPoliciesByAdmin, + queryKeyPrefix: "GroupPoliciesByAdminQuery" +}); +export const useGetProposal = buildUseQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposalsByGroupPolicy = buildUseQuery({ + builderQueryFn: createGetProposalsByGroupPolicy, + queryKeyPrefix: "ProposalsByGroupPolicyQuery" +}); +export const useGetVoteByProposalVoter = buildUseQuery({ + builderQueryFn: createGetVoteByProposalVoter, + queryKeyPrefix: "VoteByProposalVoterQuery" +}); +export const useGetVotesByProposal = buildUseQuery({ + builderQueryFn: createGetVotesByProposal, + queryKeyPrefix: "VotesByProposalQuery" +}); +export const useGetVotesByVoter = buildUseQuery({ + builderQueryFn: createGetVotesByVoter, + queryKeyPrefix: "VotesByVoterQuery" +}); +export const useGetGroupsByMember = buildUseQuery({ + builderQueryFn: createGetGroupsByMember, + queryKeyPrefix: "GroupsByMemberQuery" +}); +export const useGetTallyResult = buildUseQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); +export const useGetGroups = buildUseQuery({ + builderQueryFn: createGetGroups, + queryKeyPrefix: "GroupsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/group/v1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/group/v1/tx.rpc.func.ts index c580c689..b04f9190 100644 --- a/libs/interchain-react/src/cosmos/group/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/group/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; export const createCreateGroup = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateGroup = (clientResolver?: SigningClientResolver) => bui converters: toConverters(MsgCreateGroup), deps: [MsgCreateGroup] }); -export const useCreateGroup = buildUseMutation({ - builderMutationFn: createCreateGroup -}); export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupMembers.typeUrl, @@ -19,9 +15,6 @@ export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) converters: toConverters(MsgUpdateGroupMembers), deps: [MsgUpdateGroupMembers] }); -export const useUpdateGroupMembers = buildUseMutation({ - builderMutationFn: createUpdateGroupMembers -}); export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupAdmin.typeUrl, @@ -29,9 +22,6 @@ export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgUpdateGroupAdmin), deps: [MsgUpdateGroupAdmin] }); -export const useUpdateGroupAdmin = buildUseMutation({ - builderMutationFn: createUpdateGroupAdmin -}); export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupMetadata.typeUrl, @@ -39,9 +29,6 @@ export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver converters: toConverters(MsgUpdateGroupMetadata), deps: [MsgUpdateGroupMetadata] }); -export const useUpdateGroupMetadata = buildUseMutation({ - builderMutationFn: createUpdateGroupMetadata -}); export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateGroupPolicy.typeUrl, @@ -49,9 +36,6 @@ export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) converters: toConverters(MsgCreateGroupPolicy), deps: [MsgCreateGroupPolicy] }); -export const useCreateGroupPolicy = buildUseMutation({ - builderMutationFn: createCreateGroupPolicy -}); export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreateGroupWithPolicy.typeUrl, @@ -59,9 +43,6 @@ export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolv converters: toConverters(MsgCreateGroupWithPolicy), deps: [MsgCreateGroupWithPolicy] }); -export const useCreateGroupWithPolicy = buildUseMutation({ - builderMutationFn: createCreateGroupWithPolicy -}); export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupPolicyAdmin.typeUrl, @@ -69,9 +50,6 @@ export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResol converters: toConverters(MsgUpdateGroupPolicyAdmin), deps: [MsgUpdateGroupPolicyAdmin] }); -export const useUpdateGroupPolicyAdmin = buildUseMutation({ - builderMutationFn: createUpdateGroupPolicyAdmin -}); export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupPolicyDecisionPolicy.typeUrl, @@ -79,9 +57,6 @@ export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningCl converters: toConverters(MsgUpdateGroupPolicyDecisionPolicy), deps: [MsgUpdateGroupPolicyDecisionPolicy] }); -export const useUpdateGroupPolicyDecisionPolicy = buildUseMutation({ - builderMutationFn: createUpdateGroupPolicyDecisionPolicy -}); export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateGroupPolicyMetadata.typeUrl, @@ -89,9 +64,6 @@ export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientRe converters: toConverters(MsgUpdateGroupPolicyMetadata), deps: [MsgUpdateGroupPolicyMetadata] }); -export const useUpdateGroupPolicyMetadata = buildUseMutation({ - builderMutationFn: createUpdateGroupPolicyMetadata -}); export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSubmitProposal.typeUrl, @@ -99,9 +71,6 @@ export const createSubmitProposal = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgSubmitProposal), deps: [MsgSubmitProposal] }); -export const useSubmitProposal = buildUseMutation({ - builderMutationFn: createSubmitProposal -}); export const createWithdrawProposal = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgWithdrawProposal.typeUrl, @@ -109,9 +78,6 @@ export const createWithdrawProposal = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgWithdrawProposal), deps: [MsgWithdrawProposal] }); -export const useWithdrawProposal = buildUseMutation({ - builderMutationFn: createWithdrawProposal -}); export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgVote.typeUrl, @@ -119,9 +85,6 @@ export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createVote -}); export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExec.typeUrl, @@ -129,16 +92,10 @@ export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createExec -}); export const createLeaveGroup = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgLeaveGroup.typeUrl, encoders: toEncoders(MsgLeaveGroup), converters: toConverters(MsgLeaveGroup), deps: [MsgLeaveGroup] -}); -export const useLeaveGroup = buildUseMutation({ - builderMutationFn: createLeaveGroup }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts new file mode 100644 index 00000000..25f1ac84 --- /dev/null +++ b/libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts @@ -0,0 +1,45 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +export const useCreateGroup = buildUseMutation({ + builderMutationFn: createCreateGroup +}); +export const useUpdateGroupMembers = buildUseMutation({ + builderMutationFn: createUpdateGroupMembers +}); +export const useUpdateGroupAdmin = buildUseMutation({ + builderMutationFn: createUpdateGroupAdmin +}); +export const useUpdateGroupMetadata = buildUseMutation({ + builderMutationFn: createUpdateGroupMetadata +}); +export const useCreateGroupPolicy = buildUseMutation({ + builderMutationFn: createCreateGroupPolicy +}); +export const useCreateGroupWithPolicy = buildUseMutation({ + builderMutationFn: createCreateGroupWithPolicy +}); +export const useUpdateGroupPolicyAdmin = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyAdmin +}); +export const useUpdateGroupPolicyDecisionPolicy = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyDecisionPolicy +}); +export const useUpdateGroupPolicyMetadata = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyMetadata +}); +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const useWithdrawProposal = buildUseMutation({ + builderMutationFn: createWithdrawProposal +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const useExec = buildUseMutation({ + builderMutationFn: createExec +}); +export const useLeaveGroup = buildUseMutation({ + builderMutationFn: createLeaveGroup +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.func.ts index eb3815e3..b568b5fe 100644 --- a/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetInflation = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryInflationRequest.encode, decode: QueryInflationResponse.decode, @@ -21,10 +16,6 @@ export const createGetInflation = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetInflation, - queryKeyPrefix: "InflationQuery" -}); export const createGetAnnualProvisions = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAnnualProvisionsRequest.encode, decode: QueryAnnualProvisionsResponse.decode, @@ -32,8 +23,4 @@ export const createGetAnnualProvisions = (clientResolver?: RpcResolver) => build method: "AnnualProvisions", clientResolver, deps: [QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse] -}); -export const useGetAnnualProvisions = buildUseQuery({ - builderQueryFn: createGetAnnualProvisions, - queryKeyPrefix: "AnnualProvisionsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..9c9b0f31 --- /dev/null +++ b/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; +import { createGetParams, createGetInflation, createGetAnnualProvisions } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetInflation = buildUseQuery({ + builderQueryFn: createGetInflation, + queryKeyPrefix: "InflationQuery" +}); +export const useGetAnnualProvisions = buildUseQuery({ + builderQueryFn: createGetAnnualProvisions, + queryKeyPrefix: "AnnualProvisionsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.func.ts index 1e1ff831..6cf89cb1 100644 --- a/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams } from "./tx"; export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -8,7 +7,4 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..427464a2 --- /dev/null +++ b/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts @@ -0,0 +1,6 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgUpdateParams } from "./tx"; +import { createUpdateParams } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.func.ts index 36a61b02..53410d79 100644 --- a/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBalanceRequest.encode, @@ -9,10 +8,6 @@ export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetBalance, - queryKeyPrefix: "BalanceQuery" -}); export const createGetOwner = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryOwnerRequest.encode, decode: QueryOwnerResponse.decode, @@ -21,10 +16,6 @@ export const createGetOwner = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetOwner, - queryKeyPrefix: "OwnerQuery" -}); export const createGetSupply = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySupplyRequest.encode, decode: QuerySupplyResponse.decode, @@ -33,10 +24,6 @@ export const createGetSupply = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetSupply, - queryKeyPrefix: "SupplyQuery" -}); export const createGetNFTs = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryNFTsRequest.encode, decode: QueryNFTsResponse.decode, @@ -45,10 +32,6 @@ export const createGetNFTs = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetNFTs, - queryKeyPrefix: "NFTsQuery" -}); export const createGetNFT = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryNFTRequest.encode, decode: QueryNFTResponse.decode, @@ -57,10 +40,6 @@ export const createGetNFT = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetNFT, - queryKeyPrefix: "NFTQuery" -}); export const createGetClass = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryClassRequest.encode, decode: QueryClassResponse.decode, @@ -69,10 +48,6 @@ export const createGetClass = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetClass, - queryKeyPrefix: "ClassQuery" -}); export const createGetClasses = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryClassesRequest.encode, decode: QueryClassesResponse.decode, @@ -80,8 +55,4 @@ export const createGetClasses = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetClasses, - queryKeyPrefix: "ClassesQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..860909b4 --- /dev/null +++ b/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts @@ -0,0 +1,31 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; +import { createGetBalance, createGetOwner, createGetSupply, createGetNFTs, createGetNFT, createGetClass, createGetClasses } from "./query.rpc.func.ts"; +export const useGetBalance = buildUseQuery({ + builderQueryFn: createGetBalance, + queryKeyPrefix: "BalanceQuery" +}); +export const useGetOwner = buildUseQuery({ + builderQueryFn: createGetOwner, + queryKeyPrefix: "OwnerQuery" +}); +export const useGetSupply = buildUseQuery({ + builderQueryFn: createGetSupply, + queryKeyPrefix: "SupplyQuery" +}); +export const useGetNFTs = buildUseQuery({ + builderQueryFn: createGetNFTs, + queryKeyPrefix: "NFTsQuery" +}); +export const useGetNFT = buildUseQuery({ + builderQueryFn: createGetNFT, + queryKeyPrefix: "NFTQuery" +}); +export const useGetClass = buildUseQuery({ + builderQueryFn: createGetClass, + queryKeyPrefix: "ClassQuery" +}); +export const useGetClasses = buildUseQuery({ + builderQueryFn: createGetClasses, + queryKeyPrefix: "ClassesQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.func.ts index bdc2d93a..d0b9b9b8 100644 --- a/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSend } from "./tx"; export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -8,7 +7,4 @@ export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ - builderMutationFn: createSend }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..01f2c701 --- /dev/null +++ b/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts @@ -0,0 +1,6 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSend } from "./tx"; +import { createSend } from "./tx.rpc.func.ts"; +export const useSend = buildUseMutation({ + builderMutationFn: createSend +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts index efc4250b..697c8514 100644 --- a/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../../helper-func-types"; -import { buildUseQuery } from "../../../../react-query"; import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; export const createGetGet = (clientResolver?: RpcResolver) => buildQuery({ encode: GetRequest.encode, @@ -9,10 +8,6 @@ export const createGetGet = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetGet, - queryKeyPrefix: "GetQuery" -}); export const createGetList = (clientResolver?: RpcResolver) => buildQuery({ encode: ListRequest.encode, decode: ListResponse.decode, @@ -20,8 +15,4 @@ export const createGetList = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetList, - queryKeyPrefix: "ListQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts new file mode 100644 index 00000000..62fcf321 --- /dev/null +++ b/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts @@ -0,0 +1,11 @@ +import { buildUseQuery } from "../../../../react-query"; +import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; +import { createGetGet, createGetList } from "./query.rpc.func.ts"; +export const useGetGet = buildUseQuery({ + builderQueryFn: createGetGet, + queryKeyPrefix: "GetQuery" +}); +export const useGetList = buildUseQuery({ + builderQueryFn: createGetList, + queryKeyPrefix: "ListQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.func.ts index a6cd146f..d6aad80b 100644 --- a/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetSubspaces = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySubspacesRequest.encode, decode: QuerySubspacesResponse.decode, @@ -20,8 +15,4 @@ export const createGetSubspaces = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetSubspaces, - queryKeyPrefix: "SubspacesQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..9ef0617b --- /dev/null +++ b/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts @@ -0,0 +1,11 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; +import { createGetParams, createGetSubspaces } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetSubspaces = buildUseQuery({ + builderQueryFn: createGetSubspaces, + queryKeyPrefix: "SubspacesQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.func.ts b/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.func.ts index 8a27bb7f..217c99b0 100644 --- a/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { FileDescriptorsRequest, FileDescriptorsResponse } from "./reflection"; export const createGetFileDescriptors = (clientResolver?: RpcResolver) => buildQuery({ encode: FileDescriptorsRequest.encode, @@ -8,8 +7,4 @@ export const createGetFileDescriptors = (clientResolver?: RpcResolver) => buildQ method: "FileDescriptors", clientResolver, deps: [FileDescriptorsRequest, FileDescriptorsResponse] -}); -export const useGetFileDescriptors = buildUseQuery({ - builderQueryFn: createGetFileDescriptors, - queryKeyPrefix: "FileDescriptorsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts b/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts new file mode 100644 index 00000000..1cfa2ba9 --- /dev/null +++ b/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts @@ -0,0 +1,7 @@ +import { buildUseQuery } from "../../../react-query"; +import { FileDescriptorsRequest, FileDescriptorsResponse } from "./reflection"; +import { createGetFileDescriptors } from "./reflection.rpc.func.ts"; +export const useGetFileDescriptors = buildUseQuery({ + builderQueryFn: createGetFileDescriptors, + queryKeyPrefix: "FileDescriptorsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.func.ts index 115f422d..a65cb892 100644 --- a/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./query"; export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, @@ -9,10 +8,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetSigningInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySigningInfoRequest.encode, decode: QuerySigningInfoResponse.decode, @@ -21,10 +16,6 @@ export const createGetSigningInfo = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QuerySigningInfoRequest, QuerySigningInfoResponse] }); -export const useGetSigningInfo = buildUseQuery({ - builderQueryFn: createGetSigningInfo, - queryKeyPrefix: "SigningInfoQuery" -}); export const createGetSigningInfos = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySigningInfosRequest.encode, decode: QuerySigningInfosResponse.decode, @@ -32,8 +23,4 @@ export const createGetSigningInfos = (clientResolver?: RpcResolver) => buildQuer method: "SigningInfos", clientResolver, deps: [QuerySigningInfosRequest, QuerySigningInfosResponse] -}); -export const useGetSigningInfos = buildUseQuery({ - builderQueryFn: createGetSigningInfos, - queryKeyPrefix: "SigningInfosQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..81907d3e --- /dev/null +++ b/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts @@ -0,0 +1,15 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./query"; +import { createGetParams, createGetSigningInfo, createGetSigningInfos } from "./query.rpc.func.ts"; +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetSigningInfo = buildUseQuery({ + builderQueryFn: createGetSigningInfo, + queryKeyPrefix: "SigningInfoQuery" +}); +export const useGetSigningInfos = buildUseQuery({ + builderQueryFn: createGetSigningInfos, + queryKeyPrefix: "SigningInfosQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.func.ts index 07485178..9be9feef 100644 --- a/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgUnjail, MsgUpdateParams } from "./tx"; export const createUnjail = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,16 +8,10 @@ export const createUnjail = (clientResolver?: SigningClientResolver) => buildTx< converters: toConverters(MsgUnjail), deps: [MsgUnjail] }); -export const useUnjail = buildUseMutation({ - builderMutationFn: createUnjail -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..f4cbb8c9 --- /dev/null +++ b/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts @@ -0,0 +1,9 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgUnjail, MsgUpdateParams } from "./tx"; +import { createUnjail, createUpdateParams } from "./tx.rpc.func.ts"; +export const useUnjail = buildUseMutation({ + builderMutationFn: createUnjail +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.func.ts index 9673c3d2..679c908c 100644 --- a/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorsRequest.encode, @@ -9,10 +8,6 @@ export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QueryValidatorsRequest, QueryValidatorsResponse] }); -export const useGetValidators = buildUseQuery({ - builderQueryFn: createGetValidators, - queryKeyPrefix: "ValidatorsQuery" -}); export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorRequest.encode, decode: QueryValidatorResponse.decode, @@ -21,10 +16,6 @@ export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetValidator, - queryKeyPrefix: "ValidatorQuery" -}); export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorDelegationsRequest.encode, decode: QueryValidatorDelegationsResponse.decode, @@ -33,10 +24,6 @@ export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse] }); -export const useGetValidatorDelegations = buildUseQuery({ - builderQueryFn: createGetValidatorDelegations, - queryKeyPrefix: "ValidatorDelegationsQuery" -}); export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryValidatorUnbondingDelegationsRequest.encode, decode: QueryValidatorUnbondingDelegationsResponse.decode, @@ -45,10 +32,6 @@ export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResol clientResolver, deps: [QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse] }); -export const useGetValidatorUnbondingDelegations = buildUseQuery({ - builderQueryFn: createGetValidatorUnbondingDelegations, - queryKeyPrefix: "ValidatorUnbondingDelegationsQuery" -}); export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegationRequest.encode, decode: QueryDelegationResponse.decode, @@ -57,10 +40,6 @@ export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery< clientResolver, deps: [QueryDelegationRequest, QueryDelegationResponse] }); -export const useGetDelegation = buildUseQuery({ - builderQueryFn: createGetDelegation, - queryKeyPrefix: "DelegationQuery" -}); export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryUnbondingDelegationRequest.encode, decode: QueryUnbondingDelegationResponse.decode, @@ -69,10 +48,6 @@ export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse] }); -export const useGetUnbondingDelegation = buildUseQuery({ - builderQueryFn: createGetUnbondingDelegation, - queryKeyPrefix: "UnbondingDelegationQuery" -}); export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorDelegationsRequest.encode, decode: QueryDelegatorDelegationsResponse.decode, @@ -81,10 +56,6 @@ export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => b clientResolver, deps: [QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse] }); -export const useGetDelegatorDelegations = buildUseQuery({ - builderQueryFn: createGetDelegatorDelegations, - queryKeyPrefix: "DelegatorDelegationsQuery" -}); export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorUnbondingDelegationsRequest.encode, decode: QueryDelegatorUnbondingDelegationsResponse.decode, @@ -93,10 +64,6 @@ export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResol clientResolver, deps: [QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse] }); -export const useGetDelegatorUnbondingDelegations = buildUseQuery({ - builderQueryFn: createGetDelegatorUnbondingDelegations, - queryKeyPrefix: "DelegatorUnbondingDelegationsQuery" -}); export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryRedelegationsRequest.encode, decode: QueryRedelegationsResponse.decode, @@ -105,10 +72,6 @@ export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [QueryRedelegationsRequest, QueryRedelegationsResponse] }); -export const useGetRedelegations = buildUseQuery({ - builderQueryFn: createGetRedelegations, - queryKeyPrefix: "RedelegationsQuery" -}); export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorValidatorsRequest.encode, decode: QueryDelegatorValidatorsResponse.decode, @@ -117,10 +80,6 @@ export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => bu clientResolver, deps: [QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse] }); -export const useGetDelegatorValidators = buildUseQuery({ - builderQueryFn: createGetDelegatorValidators, - queryKeyPrefix: "DelegatorValidatorsQuery" -}); export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryDelegatorValidatorRequest.encode, decode: QueryDelegatorValidatorResponse.decode, @@ -129,10 +88,6 @@ export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse] }); -export const useGetDelegatorValidator = buildUseQuery({ - builderQueryFn: createGetDelegatorValidator, - queryKeyPrefix: "DelegatorValidatorQuery" -}); export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryHistoricalInfoRequest.encode, decode: QueryHistoricalInfoResponse.decode, @@ -141,10 +96,6 @@ export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryHistoricalInfoRequest, QueryHistoricalInfoResponse] }); -export const useGetHistoricalInfo = buildUseQuery({ - builderQueryFn: createGetHistoricalInfo, - queryKeyPrefix: "HistoricalInfoQuery" -}); export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPoolRequest.encode, decode: QueryPoolResponse.decode, @@ -153,10 +104,6 @@ export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetPool, - queryKeyPrefix: "PoolQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -164,8 +111,4 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..07eb6ea0 --- /dev/null +++ b/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts @@ -0,0 +1,59 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +export const useGetValidators = buildUseQuery({ + builderQueryFn: createGetValidators, + queryKeyPrefix: "ValidatorsQuery" +}); +export const useGetValidator = buildUseQuery({ + builderQueryFn: createGetValidator, + queryKeyPrefix: "ValidatorQuery" +}); +export const useGetValidatorDelegations = buildUseQuery({ + builderQueryFn: createGetValidatorDelegations, + queryKeyPrefix: "ValidatorDelegationsQuery" +}); +export const useGetValidatorUnbondingDelegations = buildUseQuery({ + builderQueryFn: createGetValidatorUnbondingDelegations, + queryKeyPrefix: "ValidatorUnbondingDelegationsQuery" +}); +export const useGetDelegation = buildUseQuery({ + builderQueryFn: createGetDelegation, + queryKeyPrefix: "DelegationQuery" +}); +export const useGetUnbondingDelegation = buildUseQuery({ + builderQueryFn: createGetUnbondingDelegation, + queryKeyPrefix: "UnbondingDelegationQuery" +}); +export const useGetDelegatorDelegations = buildUseQuery({ + builderQueryFn: createGetDelegatorDelegations, + queryKeyPrefix: "DelegatorDelegationsQuery" +}); +export const useGetDelegatorUnbondingDelegations = buildUseQuery({ + builderQueryFn: createGetDelegatorUnbondingDelegations, + queryKeyPrefix: "DelegatorUnbondingDelegationsQuery" +}); +export const useGetRedelegations = buildUseQuery({ + builderQueryFn: createGetRedelegations, + queryKeyPrefix: "RedelegationsQuery" +}); +export const useGetDelegatorValidators = buildUseQuery({ + builderQueryFn: createGetDelegatorValidators, + queryKeyPrefix: "DelegatorValidatorsQuery" +}); +export const useGetDelegatorValidator = buildUseQuery({ + builderQueryFn: createGetDelegatorValidator, + queryKeyPrefix: "DelegatorValidatorQuery" +}); +export const useGetHistoricalInfo = buildUseQuery({ + builderQueryFn: createGetHistoricalInfo, + queryKeyPrefix: "HistoricalInfoQuery" +}); +export const useGetPool = buildUseQuery({ + builderQueryFn: createGetPool, + queryKeyPrefix: "PoolQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts index 85f1b7a8..98ad73ff 100644 --- a/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; export const createCreateValidator = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateValidator = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgCreateValidator), deps: [MsgCreateValidator] }); -export const useCreateValidator = buildUseMutation({ - builderMutationFn: createCreateValidator -}); export const createEditValidator = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgEditValidator.typeUrl, @@ -19,9 +15,6 @@ export const createEditValidator = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgEditValidator), deps: [MsgEditValidator] }); -export const useEditValidator = buildUseMutation({ - builderMutationFn: createEditValidator -}); export const createDelegate = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgDelegate.typeUrl, @@ -29,9 +22,6 @@ export const createDelegate = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgDelegate), deps: [MsgDelegate] }); -export const useDelegate = buildUseMutation({ - builderMutationFn: createDelegate -}); export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgBeginRedelegate.typeUrl, @@ -39,9 +29,6 @@ export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgBeginRedelegate), deps: [MsgBeginRedelegate] }); -export const useBeginRedelegate = buildUseMutation({ - builderMutationFn: createBeginRedelegate -}); export const createUndelegate = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUndelegate.typeUrl, @@ -49,9 +36,6 @@ export const createUndelegate = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgUndelegate), deps: [MsgUndelegate] }); -export const useUndelegate = buildUseMutation({ - builderMutationFn: createUndelegate -}); export const createCancelUnbondingDelegation = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelUnbondingDelegation.typeUrl, @@ -59,16 +43,10 @@ export const createCancelUnbondingDelegation = (clientResolver?: SigningClientRe converters: toConverters(MsgCancelUnbondingDelegation), deps: [MsgCancelUnbondingDelegation] }); -export const useCancelUnbondingDelegation = buildUseMutation({ - builderMutationFn: createCancelUnbondingDelegation -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..a5acb059 --- /dev/null +++ b/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateValidator = buildUseMutation({ + builderMutationFn: createCreateValidator +}); +export const useEditValidator = buildUseMutation({ + builderMutationFn: createEditValidator +}); +export const useDelegate = buildUseMutation({ + builderMutationFn: createDelegate +}); +export const useBeginRedelegate = buildUseMutation({ + builderMutationFn: createBeginRedelegate +}); +export const useUndelegate = buildUseMutation({ + builderMutationFn: createUndelegate +}); +export const useCancelUnbondingDelegation = buildUseMutation({ + builderMutationFn: createCancelUnbondingDelegation +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.func.ts b/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.func.ts index 685a17ba..096bfb4f 100644 --- a/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ encode: SimulateRequest.encode, @@ -9,10 +8,6 @@ export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetSimulate, - queryKeyPrefix: "SimulateQuery" -}); export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ encode: GetTxRequest.encode, decode: GetTxResponse.decode, @@ -21,10 +16,6 @@ export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetGetTx, - queryKeyPrefix: "GetTxQuery" -}); export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery({ encode: BroadcastTxRequest.encode, decode: BroadcastTxResponse.decode, @@ -33,10 +24,6 @@ export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [BroadcastTxRequest, BroadcastTxResponse] }); -export const useGetBroadcastTx = buildUseQuery({ - builderQueryFn: createGetBroadcastTx, - queryKeyPrefix: "BroadcastTxQuery" -}); export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery({ encode: GetTxsEventRequest.encode, decode: GetTxsEventResponse.decode, @@ -45,10 +32,6 @@ export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [GetTxsEventRequest, GetTxsEventResponse] }); -export const useGetGetTxsEvent = buildUseQuery({ - builderQueryFn: createGetGetTxsEvent, - queryKeyPrefix: "GetTxsEventQuery" -}); export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQuery({ encode: GetBlockWithTxsRequest.encode, decode: GetBlockWithTxsResponse.decode, @@ -57,10 +40,6 @@ export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [GetBlockWithTxsRequest, GetBlockWithTxsResponse] }); -export const useGetGetBlockWithTxs = buildUseQuery({ - builderQueryFn: createGetGetBlockWithTxs, - queryKeyPrefix: "GetBlockWithTxsQuery" -}); export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ encode: TxDecodeRequest.encode, decode: TxDecodeResponse.decode, @@ -69,10 +48,6 @@ export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetTxDecode, - queryKeyPrefix: "TxDecodeQuery" -}); export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ encode: TxEncodeRequest.encode, decode: TxEncodeResponse.decode, @@ -81,10 +56,6 @@ export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetTxEncode, - queryKeyPrefix: "TxEncodeQuery" -}); export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQuery({ encode: TxEncodeAminoRequest.encode, decode: TxEncodeAminoResponse.decode, @@ -93,10 +64,6 @@ export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQue clientResolver, deps: [TxEncodeAminoRequest, TxEncodeAminoResponse] }); -export const useGetTxEncodeAmino = buildUseQuery({ - builderQueryFn: createGetTxEncodeAmino, - queryKeyPrefix: "TxEncodeAminoQuery" -}); export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQuery({ encode: TxDecodeAminoRequest.encode, decode: TxDecodeAminoResponse.decode, @@ -104,8 +71,4 @@ export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQue method: "TxDecodeAmino", clientResolver, deps: [TxDecodeAminoRequest, TxDecodeAminoResponse] -}); -export const useGetTxDecodeAmino = buildUseQuery({ - builderQueryFn: createGetTxDecodeAmino, - queryKeyPrefix: "TxDecodeAminoQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts b/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts new file mode 100644 index 00000000..53085d29 --- /dev/null +++ b/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts @@ -0,0 +1,39 @@ +import { buildUseQuery } from "../../../react-query"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +export const useGetSimulate = buildUseQuery({ + builderQueryFn: createGetSimulate, + queryKeyPrefix: "SimulateQuery" +}); +export const useGetGetTx = buildUseQuery({ + builderQueryFn: createGetGetTx, + queryKeyPrefix: "GetTxQuery" +}); +export const useGetBroadcastTx = buildUseQuery({ + builderQueryFn: createGetBroadcastTx, + queryKeyPrefix: "BroadcastTxQuery" +}); +export const useGetGetTxsEvent = buildUseQuery({ + builderQueryFn: createGetGetTxsEvent, + queryKeyPrefix: "GetTxsEventQuery" +}); +export const useGetGetBlockWithTxs = buildUseQuery({ + builderQueryFn: createGetGetBlockWithTxs, + queryKeyPrefix: "GetBlockWithTxsQuery" +}); +export const useGetTxDecode = buildUseQuery({ + builderQueryFn: createGetTxDecode, + queryKeyPrefix: "TxDecodeQuery" +}); +export const useGetTxEncode = buildUseQuery({ + builderQueryFn: createGetTxEncode, + queryKeyPrefix: "TxEncodeQuery" +}); +export const useGetTxEncodeAmino = buildUseQuery({ + builderQueryFn: createGetTxEncodeAmino, + queryKeyPrefix: "TxEncodeAminoQuery" +}); +export const useGetTxDecodeAmino = buildUseQuery({ + builderQueryFn: createGetTxDecodeAmino, + queryKeyPrefix: "TxDecodeAminoQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.func.ts b/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.func.ts index 90140969..cea48cec 100644 --- a/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; export const createGetCurrentPlan = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCurrentPlanRequest.encode, @@ -9,10 +8,6 @@ export const createGetCurrentPlan = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryCurrentPlanRequest, QueryCurrentPlanResponse] }); -export const useGetCurrentPlan = buildUseQuery({ - builderQueryFn: createGetCurrentPlan, - queryKeyPrefix: "CurrentPlanQuery" -}); export const createGetAppliedPlan = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAppliedPlanRequest.encode, decode: QueryAppliedPlanResponse.decode, @@ -21,10 +16,6 @@ export const createGetAppliedPlan = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryAppliedPlanRequest, QueryAppliedPlanResponse] }); -export const useGetAppliedPlan = buildUseQuery({ - builderQueryFn: createGetAppliedPlan, - queryKeyPrefix: "AppliedPlanQuery" -}); export const createGetUpgradedConsensusState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryUpgradedConsensusStateRequest.encode, decode: QueryUpgradedConsensusStateResponse.decode, @@ -33,10 +24,6 @@ export const createGetUpgradedConsensusState = (clientResolver?: RpcResolver) => clientResolver, deps: [QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse] }); -export const useGetUpgradedConsensusState = buildUseQuery({ - builderQueryFn: createGetUpgradedConsensusState, - queryKeyPrefix: "UpgradedConsensusStateQuery" -}); export const createGetModuleVersions = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryModuleVersionsRequest.encode, decode: QueryModuleVersionsResponse.decode, @@ -45,10 +32,6 @@ export const createGetModuleVersions = (clientResolver?: RpcResolver) => buildQu clientResolver, deps: [QueryModuleVersionsRequest, QueryModuleVersionsResponse] }); -export const useGetModuleVersions = buildUseQuery({ - builderQueryFn: createGetModuleVersions, - queryKeyPrefix: "ModuleVersionsQuery" -}); export const createGetAuthority = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAuthorityRequest.encode, decode: QueryAuthorityResponse.decode, @@ -56,8 +39,4 @@ export const createGetAuthority = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetAuthority, - queryKeyPrefix: "AuthorityQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts new file mode 100644 index 00000000..28870ca0 --- /dev/null +++ b/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts @@ -0,0 +1,23 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; +import { createGetCurrentPlan, createGetAppliedPlan, createGetUpgradedConsensusState, createGetModuleVersions, createGetAuthority } from "./query.rpc.func.ts"; +export const useGetCurrentPlan = buildUseQuery({ + builderQueryFn: createGetCurrentPlan, + queryKeyPrefix: "CurrentPlanQuery" +}); +export const useGetAppliedPlan = buildUseQuery({ + builderQueryFn: createGetAppliedPlan, + queryKeyPrefix: "AppliedPlanQuery" +}); +export const useGetUpgradedConsensusState = buildUseQuery({ + builderQueryFn: createGetUpgradedConsensusState, + queryKeyPrefix: "UpgradedConsensusStateQuery" +}); +export const useGetModuleVersions = buildUseQuery({ + builderQueryFn: createGetModuleVersions, + queryKeyPrefix: "ModuleVersionsQuery" +}); +export const useGetAuthority = buildUseQuery({ + builderQueryFn: createGetAuthority, + queryKeyPrefix: "AuthorityQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts index d1a3c4b8..b2bdf2eb 100644 --- a/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; export const createSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,16 +8,10 @@ export const createSoftwareUpgrade = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgSoftwareUpgrade), deps: [MsgSoftwareUpgrade] }); -export const useSoftwareUpgrade = buildUseMutation({ - builderMutationFn: createSoftwareUpgrade -}); export const createCancelUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCancelUpgrade.typeUrl, encoders: toEncoders(MsgCancelUpgrade), converters: toConverters(MsgCancelUpgrade), deps: [MsgCancelUpgrade] -}); -export const useCancelUpgrade = buildUseMutation({ - builderMutationFn: createCancelUpgrade }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..83144e14 --- /dev/null +++ b/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts @@ -0,0 +1,9 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +import { createSoftwareUpgrade, createCancelUpgrade } from "./tx.rpc.func.ts"; +export const useSoftwareUpgrade = buildUseMutation({ + builderMutationFn: createSoftwareUpgrade +}); +export const useCancelUpgrade = buildUseMutation({ + builderMutationFn: createCancelUpgrade +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts b/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts index d73007c6..d693bff4 100644 --- a/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; export const createCreateVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateVestingAccount = (clientResolver?: SigningClientResolve converters: toConverters(MsgCreateVestingAccount), deps: [MsgCreateVestingAccount] }); -export const useCreateVestingAccount = buildUseMutation({ - builderMutationFn: createCreateVestingAccount -}); export const createCreatePermanentLockedAccount = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreatePermanentLockedAccount.typeUrl, @@ -19,16 +15,10 @@ export const createCreatePermanentLockedAccount = (clientResolver?: SigningClien converters: toConverters(MsgCreatePermanentLockedAccount), deps: [MsgCreatePermanentLockedAccount] }); -export const useCreatePermanentLockedAccount = buildUseMutation({ - builderMutationFn: createCreatePermanentLockedAccount -}); export const createCreatePeriodicVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgCreatePeriodicVestingAccount.typeUrl, encoders: toEncoders(MsgCreatePeriodicVestingAccount), converters: toConverters(MsgCreatePeriodicVestingAccount), deps: [MsgCreatePeriodicVestingAccount] -}); -export const useCreatePeriodicVestingAccount = buildUseMutation({ - builderMutationFn: createCreatePeriodicVestingAccount }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts new file mode 100644 index 00000000..9c725c4e --- /dev/null +++ b/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts @@ -0,0 +1,12 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +export const useCreateVestingAccount = buildUseMutation({ + builderMutationFn: createCreateVestingAccount +}); +export const useCreatePermanentLockedAccount = buildUseMutation({ + builderMutationFn: createCreatePermanentLockedAccount +}); +export const useCreatePeriodicVestingAccount = buildUseMutation({ + builderMutationFn: createCreatePeriodicVestingAccount +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.func.ts b/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.func.ts index 32e4b695..eff06fce 100644 --- a/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.func.ts +++ b/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.func.ts @@ -1,5 +1,4 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { buildUseQuery } from "../../../react-query"; import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractInfoRequest.encode, @@ -9,10 +8,6 @@ export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuer clientResolver, deps: [QueryContractInfoRequest, QueryContractInfoResponse] }); -export const useGetContractInfo = buildUseQuery({ - builderQueryFn: createGetContractInfo, - queryKeyPrefix: "ContractInfoQuery" -}); export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractHistoryRequest.encode, decode: QueryContractHistoryResponse.decode, @@ -21,10 +16,6 @@ export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryContractHistoryRequest, QueryContractHistoryResponse] }); -export const useGetContractHistory = buildUseQuery({ - builderQueryFn: createGetContractHistory, - queryKeyPrefix: "ContractHistoryQuery" -}); export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractsByCodeRequest.encode, decode: QueryContractsByCodeResponse.decode, @@ -33,10 +24,6 @@ export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQ clientResolver, deps: [QueryContractsByCodeRequest, QueryContractsByCodeResponse] }); -export const useGetContractsByCode = buildUseQuery({ - builderQueryFn: createGetContractsByCode, - queryKeyPrefix: "ContractsByCodeQuery" -}); export const createGetAllContractState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryAllContractStateRequest.encode, decode: QueryAllContractStateResponse.decode, @@ -45,10 +32,6 @@ export const createGetAllContractState = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryAllContractStateRequest, QueryAllContractStateResponse] }); -export const useGetAllContractState = buildUseQuery({ - builderQueryFn: createGetAllContractState, - queryKeyPrefix: "AllContractStateQuery" -}); export const createGetRawContractState = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryRawContractStateRequest.encode, decode: QueryRawContractStateResponse.decode, @@ -57,10 +40,6 @@ export const createGetRawContractState = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryRawContractStateRequest, QueryRawContractStateResponse] }); -export const useGetRawContractState = buildUseQuery({ - builderQueryFn: createGetRawContractState, - queryKeyPrefix: "RawContractStateQuery" -}); export const createGetSmartContractState = (clientResolver?: RpcResolver) => buildQuery({ encode: QuerySmartContractStateRequest.encode, decode: QuerySmartContractStateResponse.decode, @@ -69,10 +48,6 @@ export const createGetSmartContractState = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QuerySmartContractStateRequest, QuerySmartContractStateResponse] }); -export const useGetSmartContractState = buildUseQuery({ - builderQueryFn: createGetSmartContractState, - queryKeyPrefix: "SmartContractStateQuery" -}); export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCodeRequest.encode, decode: QueryCodeResponse.decode, @@ -81,10 +56,6 @@ export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetCode, - queryKeyPrefix: "CodeQuery" -}); export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCodesRequest.encode, decode: QueryCodesResponse.decode, @@ -93,10 +64,6 @@ export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetCodes, - queryKeyPrefix: "CodesQuery" -}); export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryCodeInfoRequest.encode, decode: QueryCodeInfoResponse.decode, @@ -105,10 +72,6 @@ export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetCodeInfo, - queryKeyPrefix: "CodeInfoQuery" -}); export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPinnedCodesRequest.encode, decode: QueryPinnedCodesResponse.decode, @@ -117,10 +80,6 @@ export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery clientResolver, deps: [QueryPinnedCodesRequest, QueryPinnedCodesResponse] }); -export const useGetPinnedCodes = buildUseQuery({ - builderQueryFn: createGetPinnedCodes, - queryKeyPrefix: "PinnedCodesQuery" -}); export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryParamsRequest.encode, decode: QueryParamsResponse.decode, @@ -129,10 +88,6 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ - builderQueryFn: createGetParams, - queryKeyPrefix: "ParamsQuery" -}); export const createGetContractsByCreator = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractsByCreatorRequest.encode, decode: QueryContractsByCreatorResponse.decode, @@ -141,10 +96,6 @@ export const createGetContractsByCreator = (clientResolver?: RpcResolver) => bui clientResolver, deps: [QueryContractsByCreatorRequest, QueryContractsByCreatorResponse] }); -export const useGetContractsByCreator = buildUseQuery({ - builderQueryFn: createGetContractsByCreator, - queryKeyPrefix: "ContractsByCreatorQuery" -}); export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryWasmLimitsConfigRequest.encode, decode: QueryWasmLimitsConfigResponse.decode, @@ -153,10 +104,6 @@ export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => build clientResolver, deps: [QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse] }); -export const useGetWasmLimitsConfig = buildUseQuery({ - builderQueryFn: createGetWasmLimitsConfig, - queryKeyPrefix: "WasmLimitsConfigQuery" -}); export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBuildAddressRequest.encode, decode: QueryBuildAddressResponse.decode, @@ -164,8 +111,4 @@ export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuer method: "BuildAddress", clientResolver, deps: [QueryBuildAddressRequest, QueryBuildAddressResponse] -}); -export const useGetBuildAddress = buildUseQuery({ - builderQueryFn: createGetBuildAddress, - queryKeyPrefix: "BuildAddressQuery" }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts new file mode 100644 index 00000000..b71686d0 --- /dev/null +++ b/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts @@ -0,0 +1,59 @@ +import { buildUseQuery } from "../../../react-query"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +export const useGetContractInfo = buildUseQuery({ + builderQueryFn: createGetContractInfo, + queryKeyPrefix: "ContractInfoQuery" +}); +export const useGetContractHistory = buildUseQuery({ + builderQueryFn: createGetContractHistory, + queryKeyPrefix: "ContractHistoryQuery" +}); +export const useGetContractsByCode = buildUseQuery({ + builderQueryFn: createGetContractsByCode, + queryKeyPrefix: "ContractsByCodeQuery" +}); +export const useGetAllContractState = buildUseQuery({ + builderQueryFn: createGetAllContractState, + queryKeyPrefix: "AllContractStateQuery" +}); +export const useGetRawContractState = buildUseQuery({ + builderQueryFn: createGetRawContractState, + queryKeyPrefix: "RawContractStateQuery" +}); +export const useGetSmartContractState = buildUseQuery({ + builderQueryFn: createGetSmartContractState, + queryKeyPrefix: "SmartContractStateQuery" +}); +export const useGetCode = buildUseQuery({ + builderQueryFn: createGetCode, + queryKeyPrefix: "CodeQuery" +}); +export const useGetCodes = buildUseQuery({ + builderQueryFn: createGetCodes, + queryKeyPrefix: "CodesQuery" +}); +export const useGetCodeInfo = buildUseQuery({ + builderQueryFn: createGetCodeInfo, + queryKeyPrefix: "CodeInfoQuery" +}); +export const useGetPinnedCodes = buildUseQuery({ + builderQueryFn: createGetPinnedCodes, + queryKeyPrefix: "PinnedCodesQuery" +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetContractsByCreator = buildUseQuery({ + builderQueryFn: createGetContractsByCreator, + queryKeyPrefix: "ContractsByCreatorQuery" +}); +export const useGetWasmLimitsConfig = buildUseQuery({ + builderQueryFn: createGetWasmLimitsConfig, + queryKeyPrefix: "WasmLimitsConfigQuery" +}); +export const useGetBuildAddress = buildUseQuery({ + builderQueryFn: createGetBuildAddress, + queryKeyPrefix: "BuildAddressQuery" +}); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts b/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts index db479ca4..5c34fb61 100644 --- a/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../react-query"; import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; export const createStoreCode = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createStoreCode = (clientResolver?: SigningClientResolver) => build converters: toConverters(MsgStoreCode), deps: [MsgStoreCode] }); -export const useStoreCode = buildUseMutation({ - builderMutationFn: createStoreCode -}); export const createInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantiateContract.typeUrl, @@ -19,9 +15,6 @@ export const createInstantiateContract = (clientResolver?: SigningClientResolver converters: toConverters(MsgInstantiateContract), deps: [MsgInstantiateContract] }); -export const useInstantiateContract = buildUseMutation({ - builderMutationFn: createInstantiateContract -}); export const createInstantiateContract2 = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgInstantiateContract2.typeUrl, @@ -29,9 +22,6 @@ export const createInstantiateContract2 = (clientResolver?: SigningClientResolve converters: toConverters(MsgInstantiateContract2), deps: [MsgInstantiateContract2] }); -export const useInstantiateContract2 = buildUseMutation({ - builderMutationFn: createInstantiateContract2 -}); export const createExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgExecuteContract.typeUrl, @@ -39,9 +29,6 @@ export const createExecuteContract = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgExecuteContract), deps: [MsgExecuteContract] }); -export const useExecuteContract = buildUseMutation({ - builderMutationFn: createExecuteContract -}); export const createMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgMigrateContract.typeUrl, @@ -49,9 +36,6 @@ export const createMigrateContract = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgMigrateContract), deps: [MsgMigrateContract] }); -export const useMigrateContract = buildUseMutation({ - builderMutationFn: createMigrateContract -}); export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateAdmin.typeUrl, @@ -59,9 +43,6 @@ export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => bui converters: toConverters(MsgUpdateAdmin), deps: [MsgUpdateAdmin] }); -export const useUpdateAdmin = buildUseMutation({ - builderMutationFn: createUpdateAdmin -}); export const createClearAdmin = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgClearAdmin.typeUrl, @@ -69,9 +50,6 @@ export const createClearAdmin = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgClearAdmin), deps: [MsgClearAdmin] }); -export const useClearAdmin = buildUseMutation({ - builderMutationFn: createClearAdmin -}); export const createUpdateInstantiateConfig = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateInstantiateConfig.typeUrl, @@ -79,9 +57,6 @@ export const createUpdateInstantiateConfig = (clientResolver?: SigningClientReso converters: toConverters(MsgUpdateInstantiateConfig), deps: [MsgUpdateInstantiateConfig] }); -export const useUpdateInstantiateConfig = buildUseMutation({ - builderMutationFn: createUpdateInstantiateConfig -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -89,9 +64,6 @@ export const createUpdateParams = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams -}); export const createSudoContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSudoContract.typeUrl, @@ -99,9 +71,6 @@ export const createSudoContract = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgSudoContract), deps: [MsgSudoContract] }); -export const useSudoContract = buildUseMutation({ - builderMutationFn: createSudoContract -}); export const createPinCodes = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgPinCodes.typeUrl, @@ -109,9 +78,6 @@ export const createPinCodes = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgPinCodes), deps: [MsgPinCodes] }); -export const usePinCodes = buildUseMutation({ - builderMutationFn: createPinCodes -}); export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUnpinCodes.typeUrl, @@ -119,9 +85,6 @@ export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgUnpinCodes), deps: [MsgUnpinCodes] }); -export const useUnpinCodes = buildUseMutation({ - builderMutationFn: createUnpinCodes -}); export const createStoreAndInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgStoreAndInstantiateContract.typeUrl, @@ -129,9 +92,6 @@ export const createStoreAndInstantiateContract = (clientResolver?: SigningClient converters: toConverters(MsgStoreAndInstantiateContract), deps: [MsgStoreAndInstantiateContract] }); -export const useStoreAndInstantiateContract = buildUseMutation({ - builderMutationFn: createStoreAndInstantiateContract -}); export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRemoveCodeUploadParamsAddresses.typeUrl, @@ -139,9 +99,6 @@ export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningCl converters: toConverters(MsgRemoveCodeUploadParamsAddresses), deps: [MsgRemoveCodeUploadParamsAddresses] }); -export const useRemoveCodeUploadParamsAddresses = buildUseMutation({ - builderMutationFn: createRemoveCodeUploadParamsAddresses -}); export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgAddCodeUploadParamsAddresses.typeUrl, @@ -149,9 +106,6 @@ export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClien converters: toConverters(MsgAddCodeUploadParamsAddresses), deps: [MsgAddCodeUploadParamsAddresses] }); -export const useAddCodeUploadParamsAddresses = buildUseMutation({ - builderMutationFn: createAddCodeUploadParamsAddresses -}); export const createStoreAndMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgStoreAndMigrateContract.typeUrl, @@ -159,16 +113,10 @@ export const createStoreAndMigrateContract = (clientResolver?: SigningClientReso converters: toConverters(MsgStoreAndMigrateContract), deps: [MsgStoreAndMigrateContract] }); -export const useStoreAndMigrateContract = buildUseMutation({ - builderMutationFn: createStoreAndMigrateContract -}); export const createUpdateContractLabel = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateContractLabel.typeUrl, encoders: toEncoders(MsgUpdateContractLabel), converters: toConverters(MsgUpdateContractLabel), deps: [MsgUpdateContractLabel] -}); -export const useUpdateContractLabel = buildUseMutation({ - builderMutationFn: createUpdateContractLabel }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts new file mode 100644 index 00000000..602a0f30 --- /dev/null +++ b/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts @@ -0,0 +1,54 @@ +import { buildUseMutation } from "../../../react-query"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +export const useStoreCode = buildUseMutation({ + builderMutationFn: createStoreCode +}); +export const useInstantiateContract = buildUseMutation({ + builderMutationFn: createInstantiateContract +}); +export const useInstantiateContract2 = buildUseMutation({ + builderMutationFn: createInstantiateContract2 +}); +export const useExecuteContract = buildUseMutation({ + builderMutationFn: createExecuteContract +}); +export const useMigrateContract = buildUseMutation({ + builderMutationFn: createMigrateContract +}); +export const useUpdateAdmin = buildUseMutation({ + builderMutationFn: createUpdateAdmin +}); +export const useClearAdmin = buildUseMutation({ + builderMutationFn: createClearAdmin +}); +export const useUpdateInstantiateConfig = buildUseMutation({ + builderMutationFn: createUpdateInstantiateConfig +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const useSudoContract = buildUseMutation({ + builderMutationFn: createSudoContract +}); +export const usePinCodes = buildUseMutation({ + builderMutationFn: createPinCodes +}); +export const useUnpinCodes = buildUseMutation({ + builderMutationFn: createUnpinCodes +}); +export const useStoreAndInstantiateContract = buildUseMutation({ + builderMutationFn: createStoreAndInstantiateContract +}); +export const useRemoveCodeUploadParamsAddresses = buildUseMutation({ + builderMutationFn: createRemoveCodeUploadParamsAddresses +}); +export const useAddCodeUploadParamsAddresses = buildUseMutation({ + builderMutationFn: createAddCodeUploadParamsAddresses +}); +export const useStoreAndMigrateContract = buildUseMutation({ + builderMutationFn: createStoreAndMigrateContract +}); +export const useUpdateContractLabel = buildUseMutation({ + builderMutationFn: createUpdateContractLabel +}); \ No newline at end of file diff --git a/libs/interchain-react/src/extern.ts b/libs/interchain-react/src/extern.ts index 86edda83..eddf067e 100644 --- a/libs/interchain-react/src/extern.ts +++ b/libs/interchain-react/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/helper-func-types.ts b/libs/interchain-react/src/helper-func-types.ts index 7abfde29..7aeeb7bc 100644 --- a/libs/interchain-react/src/helper-func-types.ts +++ b/libs/interchain-react/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/helpers.ts b/libs/interchain-react/src/helpers.ts index 64d3444c..ba68bbdb 100644 --- a/libs/interchain-react/src/helpers.ts +++ b/libs/interchain-react/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts b/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts index cab032ea..c38aa495 100644 --- a/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgTransfer, MsgUpdateParams } from "./tx"; export const createTransfer = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,16 +8,10 @@ export const createTransfer = (clientResolver?: SigningClientResolver) => buildT converters: toConverters(MsgTransfer), deps: [MsgTransfer] }); -export const useTransfer = buildUseMutation({ - builderMutationFn: createTransfer -}); export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateParams = buildUseMutation({ - builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts new file mode 100644 index 00000000..7130abbd --- /dev/null +++ b/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts @@ -0,0 +1,9 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +export const useTransfer = buildUseMutation({ + builderMutationFn: createTransfer +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.func.ts b/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.func.ts index a47e53ee..10dad0fc 100644 --- a/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgChannelOpenInit), deps: [MsgChannelOpenInit] }); -export const useChannelOpenInit = buildUseMutation({ - builderMutationFn: createChannelOpenInit -}); export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelOpenTry.typeUrl, @@ -19,9 +15,6 @@ export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgChannelOpenTry), deps: [MsgChannelOpenTry] }); -export const useChannelOpenTry = buildUseMutation({ - builderMutationFn: createChannelOpenTry -}); export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelOpenAck.typeUrl, @@ -29,9 +22,6 @@ export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgChannelOpenAck), deps: [MsgChannelOpenAck] }); -export const useChannelOpenAck = buildUseMutation({ - builderMutationFn: createChannelOpenAck -}); export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelOpenConfirm.typeUrl, @@ -39,9 +29,6 @@ export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelOpenConfirm), deps: [MsgChannelOpenConfirm] }); -export const useChannelOpenConfirm = buildUseMutation({ - builderMutationFn: createChannelOpenConfirm -}); export const createChannelCloseInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelCloseInit.typeUrl, @@ -49,9 +36,6 @@ export const createChannelCloseInit = (clientResolver?: SigningClientResolver) = converters: toConverters(MsgChannelCloseInit), deps: [MsgChannelCloseInit] }); -export const useChannelCloseInit = buildUseMutation({ - builderMutationFn: createChannelCloseInit -}); export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelCloseConfirm.typeUrl, @@ -59,9 +43,6 @@ export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver converters: toConverters(MsgChannelCloseConfirm), deps: [MsgChannelCloseConfirm] }); -export const useChannelCloseConfirm = buildUseMutation({ - builderMutationFn: createChannelCloseConfirm -}); export const createRecvPacket = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRecvPacket.typeUrl, @@ -69,9 +50,6 @@ export const createRecvPacket = (clientResolver?: SigningClientResolver) => buil converters: toConverters(MsgRecvPacket), deps: [MsgRecvPacket] }); -export const useRecvPacket = buildUseMutation({ - builderMutationFn: createRecvPacket -}); export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgTimeout.typeUrl, @@ -79,9 +57,6 @@ export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx converters: toConverters(MsgTimeout), deps: [MsgTimeout] }); -export const useTimeout = buildUseMutation({ - builderMutationFn: createTimeout -}); export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgTimeoutOnClose.typeUrl, @@ -89,9 +64,6 @@ export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgTimeoutOnClose), deps: [MsgTimeoutOnClose] }); -export const useTimeoutOnClose = buildUseMutation({ - builderMutationFn: createTimeoutOnClose -}); export const createAcknowledgement = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgAcknowledgement.typeUrl, @@ -99,9 +71,6 @@ export const createAcknowledgement = (clientResolver?: SigningClientResolver) => converters: toConverters(MsgAcknowledgement), deps: [MsgAcknowledgement] }); -export const useAcknowledgement = buildUseMutation({ - builderMutationFn: createAcknowledgement -}); export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeInit.typeUrl, @@ -109,9 +78,6 @@ export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeInit), deps: [MsgChannelUpgradeInit] }); -export const useChannelUpgradeInit = buildUseMutation({ - builderMutationFn: createChannelUpgradeInit -}); export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeTry.typeUrl, @@ -119,9 +85,6 @@ export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeTry), deps: [MsgChannelUpgradeTry] }); -export const useChannelUpgradeTry = buildUseMutation({ - builderMutationFn: createChannelUpgradeTry -}); export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeAck.typeUrl, @@ -129,9 +92,6 @@ export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeAck), deps: [MsgChannelUpgradeAck] }); -export const useChannelUpgradeAck = buildUseMutation({ - builderMutationFn: createChannelUpgradeAck -}); export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeConfirm.typeUrl, @@ -139,9 +99,6 @@ export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolv converters: toConverters(MsgChannelUpgradeConfirm), deps: [MsgChannelUpgradeConfirm] }); -export const useChannelUpgradeConfirm = buildUseMutation({ - builderMutationFn: createChannelUpgradeConfirm -}); export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeOpen.typeUrl, @@ -149,9 +106,6 @@ export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) converters: toConverters(MsgChannelUpgradeOpen), deps: [MsgChannelUpgradeOpen] }); -export const useChannelUpgradeOpen = buildUseMutation({ - builderMutationFn: createChannelUpgradeOpen -}); export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeTimeout.typeUrl, @@ -159,9 +113,6 @@ export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolv converters: toConverters(MsgChannelUpgradeTimeout), deps: [MsgChannelUpgradeTimeout] }); -export const useChannelUpgradeTimeout = buildUseMutation({ - builderMutationFn: createChannelUpgradeTimeout -}); export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgChannelUpgradeCancel.typeUrl, @@ -169,9 +120,6 @@ export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolve converters: toConverters(MsgChannelUpgradeCancel), deps: [MsgChannelUpgradeCancel] }); -export const useChannelUpgradeCancel = buildUseMutation({ - builderMutationFn: createChannelUpgradeCancel -}); export const createUpdateChannelParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, @@ -179,16 +127,10 @@ export const createUpdateChannelParams = (clientResolver?: SigningClientResolver converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] }); -export const useUpdateChannelParams = buildUseMutation({ - builderMutationFn: createUpdateChannelParams -}); export const createPruneAcknowledgements = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgPruneAcknowledgements.typeUrl, encoders: toEncoders(MsgPruneAcknowledgements), converters: toConverters(MsgPruneAcknowledgements), deps: [MsgPruneAcknowledgements] -}); -export const usePruneAcknowledgements = buildUseMutation({ - builderMutationFn: createPruneAcknowledgements }); \ No newline at end of file diff --git a/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts new file mode 100644 index 00000000..a11760aa --- /dev/null +++ b/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts @@ -0,0 +1,60 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +export const useChannelOpenInit = buildUseMutation({ + builderMutationFn: createChannelOpenInit +}); +export const useChannelOpenTry = buildUseMutation({ + builderMutationFn: createChannelOpenTry +}); +export const useChannelOpenAck = buildUseMutation({ + builderMutationFn: createChannelOpenAck +}); +export const useChannelOpenConfirm = buildUseMutation({ + builderMutationFn: createChannelOpenConfirm +}); +export const useChannelCloseInit = buildUseMutation({ + builderMutationFn: createChannelCloseInit +}); +export const useChannelCloseConfirm = buildUseMutation({ + builderMutationFn: createChannelCloseConfirm +}); +export const useRecvPacket = buildUseMutation({ + builderMutationFn: createRecvPacket +}); +export const useTimeout = buildUseMutation({ + builderMutationFn: createTimeout +}); +export const useTimeoutOnClose = buildUseMutation({ + builderMutationFn: createTimeoutOnClose +}); +export const useAcknowledgement = buildUseMutation({ + builderMutationFn: createAcknowledgement +}); +export const useChannelUpgradeInit = buildUseMutation({ + builderMutationFn: createChannelUpgradeInit +}); +export const useChannelUpgradeTry = buildUseMutation({ + builderMutationFn: createChannelUpgradeTry +}); +export const useChannelUpgradeAck = buildUseMutation({ + builderMutationFn: createChannelUpgradeAck +}); +export const useChannelUpgradeConfirm = buildUseMutation({ + builderMutationFn: createChannelUpgradeConfirm +}); +export const useChannelUpgradeOpen = buildUseMutation({ + builderMutationFn: createChannelUpgradeOpen +}); +export const useChannelUpgradeTimeout = buildUseMutation({ + builderMutationFn: createChannelUpgradeTimeout +}); +export const useChannelUpgradeCancel = buildUseMutation({ + builderMutationFn: createChannelUpgradeCancel +}); +export const useUpdateChannelParams = buildUseMutation({ + builderMutationFn: createUpdateChannelParams +}); +export const usePruneAcknowledgements = buildUseMutation({ + builderMutationFn: createPruneAcknowledgements +}); \ No newline at end of file diff --git a/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.func.ts b/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.func.ts index 7a754add..456651dd 100644 --- a/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; export const createCreateClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createCreateClient = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgCreateClient), deps: [MsgCreateClient] }); -export const useCreateClient = buildUseMutation({ - builderMutationFn: createCreateClient -}); export const createUpdateClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateClient.typeUrl, @@ -19,9 +15,6 @@ export const createUpdateClient = (clientResolver?: SigningClientResolver) => bu converters: toConverters(MsgUpdateClient), deps: [MsgUpdateClient] }); -export const useUpdateClient = buildUseMutation({ - builderMutationFn: createUpdateClient -}); export const createUpgradeClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpgradeClient.typeUrl, @@ -29,9 +22,6 @@ export const createUpgradeClient = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgUpgradeClient), deps: [MsgUpgradeClient] }); -export const useUpgradeClient = buildUseMutation({ - builderMutationFn: createUpgradeClient -}); export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgSubmitMisbehaviour.typeUrl, @@ -39,9 +29,6 @@ export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) converters: toConverters(MsgSubmitMisbehaviour), deps: [MsgSubmitMisbehaviour] }); -export const useSubmitMisbehaviour = buildUseMutation({ - builderMutationFn: createSubmitMisbehaviour -}); export const createRecoverClient = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgRecoverClient.typeUrl, @@ -49,9 +36,6 @@ export const createRecoverClient = (clientResolver?: SigningClientResolver) => b converters: toConverters(MsgRecoverClient), deps: [MsgRecoverClient] }); -export const useRecoverClient = buildUseMutation({ - builderMutationFn: createRecoverClient -}); export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgIBCSoftwareUpgrade.typeUrl, @@ -59,16 +43,10 @@ export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) converters: toConverters(MsgIBCSoftwareUpgrade), deps: [MsgIBCSoftwareUpgrade] }); -export const useIBCSoftwareUpgrade = buildUseMutation({ - builderMutationFn: createIBCSoftwareUpgrade -}); export const createUpdateClientParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateClientParams = buildUseMutation({ - builderMutationFn: createUpdateClientParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts new file mode 100644 index 00000000..81bbd9ca --- /dev/null +++ b/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts @@ -0,0 +1,24 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +export const useCreateClient = buildUseMutation({ + builderMutationFn: createCreateClient +}); +export const useUpdateClient = buildUseMutation({ + builderMutationFn: createUpdateClient +}); +export const useUpgradeClient = buildUseMutation({ + builderMutationFn: createUpgradeClient +}); +export const useSubmitMisbehaviour = buildUseMutation({ + builderMutationFn: createSubmitMisbehaviour +}); +export const useRecoverClient = buildUseMutation({ + builderMutationFn: createRecoverClient +}); +export const useIBCSoftwareUpgrade = buildUseMutation({ + builderMutationFn: createIBCSoftwareUpgrade +}); +export const useUpdateClientParams = buildUseMutation({ + builderMutationFn: createUpdateClientParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.func.ts b/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.func.ts index 7d58334e..6ee23357 100644 --- a/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.func.ts +++ b/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.func.ts @@ -1,6 +1,5 @@ import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; -import { buildUseMutation } from "../../../../react-query"; import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, @@ -9,9 +8,6 @@ export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) converters: toConverters(MsgConnectionOpenInit), deps: [MsgConnectionOpenInit] }); -export const useConnectionOpenInit = buildUseMutation({ - builderMutationFn: createConnectionOpenInit -}); export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgConnectionOpenTry.typeUrl, @@ -19,9 +15,6 @@ export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) converters: toConverters(MsgConnectionOpenTry), deps: [MsgConnectionOpenTry] }); -export const useConnectionOpenTry = buildUseMutation({ - builderMutationFn: createConnectionOpenTry -}); export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgConnectionOpenAck.typeUrl, @@ -29,9 +22,6 @@ export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) converters: toConverters(MsgConnectionOpenAck), deps: [MsgConnectionOpenAck] }); -export const useConnectionOpenAck = buildUseMutation({ - builderMutationFn: createConnectionOpenAck -}); export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgConnectionOpenConfirm.typeUrl, @@ -39,16 +29,10 @@ export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolv converters: toConverters(MsgConnectionOpenConfirm), deps: [MsgConnectionOpenConfirm] }); -export const useConnectionOpenConfirm = buildUseMutation({ - builderMutationFn: createConnectionOpenConfirm -}); export const createUpdateConnectionParams = (clientResolver?: SigningClientResolver) => buildTx({ clientResolver, typeUrl: MsgUpdateParams.typeUrl, encoders: toEncoders(MsgUpdateParams), converters: toConverters(MsgUpdateParams), deps: [MsgUpdateParams] -}); -export const useUpdateConnectionParams = buildUseMutation({ - builderMutationFn: createUpdateConnectionParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts new file mode 100644 index 00000000..f4eefea2 --- /dev/null +++ b/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts @@ -0,0 +1,18 @@ +import { buildUseMutation } from "../../../../react-query"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +export const useConnectionOpenInit = buildUseMutation({ + builderMutationFn: createConnectionOpenInit +}); +export const useConnectionOpenTry = buildUseMutation({ + builderMutationFn: createConnectionOpenTry +}); +export const useConnectionOpenAck = buildUseMutation({ + builderMutationFn: createConnectionOpenAck +}); +export const useConnectionOpenConfirm = buildUseMutation({ + builderMutationFn: createConnectionOpenConfirm +}); +export const useUpdateConnectionParams = buildUseMutation({ + builderMutationFn: createUpdateConnectionParams +}); \ No newline at end of file diff --git a/libs/interchain-react/src/react-query.ts b/libs/interchain-react/src/react-query.ts index 587070c6..f26d1ce2 100644 --- a/libs/interchain-react/src/react-query.ts +++ b/libs/interchain-react/src/react-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/registry.ts b/libs/interchain-react/src/registry.ts index 7356722f..1581e912 100644 --- a/libs/interchain-react/src/registry.ts +++ b/libs/interchain-react/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/types.ts b/libs/interchain-react/src/types.ts index 2bace856..cdcfbdf9 100644 --- a/libs/interchain-react/src/types.ts +++ b/libs/interchain-react/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/utf8.ts b/libs/interchain-react/src/utf8.ts index c5dba8d6..c0f5c97c 100644 --- a/libs/interchain-react/src/utf8.ts +++ b/libs/interchain-react/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/varint.ts b/libs/interchain-react/src/varint.ts index 95ef3b55..70a851bd 100644 --- a/libs/interchain-react/src/varint.ts +++ b/libs/interchain-react/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/binary.ts b/libs/interchain-vue/src/binary.ts index 2eaa6cb6..e6922501 100644 --- a/libs/interchain-vue/src/binary.ts +++ b/libs/interchain-vue/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/cosmos/app/runtime/v1alpha1/module.ts b/libs/interchain-vue/src/cosmos/app/runtime/v1alpha1/module.ts index 6fb86211..0f91feb2 100644 --- a/libs/interchain-vue/src/cosmos/app/runtime/v1alpha1/module.ts +++ b/libs/interchain-vue/src/cosmos/app/runtime/v1alpha1/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object for the runtime module. */ export interface Module { /** app_name is the name of the app. */ @@ -54,17 +53,6 @@ export interface Module { */ prepareCheckStaters: string[]; } -export interface ReactiveModule { - appName: ComputedRef; - beginBlockers: ComputedRef; - endBlockers: ComputedRef; - initGenesis: ComputedRef; - exportGenesis: ComputedRef; - overrideStoreKeys: ComputedRef; - orderMigrations: ComputedRef; - precommiters: ComputedRef; - prepareCheckStaters: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.app.runtime.v1alpha1.Module"; value: Uint8Array; @@ -135,10 +123,6 @@ export interface StoreKeyConfig { /** the kv store key to use instead of the module name. */ kvStoreKey: string; } -export interface ReactiveStoreKeyConfig { - moduleName: ComputedRef; - kvStoreKey: ComputedRef; -} export interface StoreKeyConfigProtoMsg { typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/app/runtime/v2/module.ts b/libs/interchain-vue/src/cosmos/app/runtime/v2/module.ts index eb9db270..41c2431e 100644 --- a/libs/interchain-vue/src/cosmos/app/runtime/v2/module.ts +++ b/libs/interchain-vue/src/cosmos/app/runtime/v2/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** Module is the config object for the runtime module. */ export interface Module { /** app_name is the name of the app. */ @@ -60,19 +59,6 @@ export interface Module { */ skipStoreKeys: string[]; } -export interface ReactiveModule { - appName: ComputedRef; - preBlockers: ComputedRef; - beginBlockers: ComputedRef; - endBlockers: ComputedRef; - txValidators: ComputedRef; - initGenesis: ComputedRef; - exportGenesis: ComputedRef; - orderMigrations: ComputedRef; - gasConfig?: ComputedRef; - overrideStoreKeys: ComputedRef; - skipStoreKeys: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.app.runtime.v2.Module"; value: Uint8Array; @@ -148,11 +134,6 @@ export interface GasConfig { /** simulation_gas_limit is the gas limit for simulation. */ simulationGasLimit: bigint; } -export interface ReactiveGasConfig { - validateTxGasLimit: ComputedRef; - queryGasLimit: ComputedRef; - simulationGasLimit: ComputedRef; -} export interface GasConfigProtoMsg { typeUrl: "/cosmos.app.runtime.v2.GasConfig"; value: Uint8Array; @@ -180,10 +161,6 @@ export interface StoreKeyConfig { /** the kv store key to use instead of the module name. */ kvStoreKey: string; } -export interface ReactiveStoreKeyConfig { - moduleName: ComputedRef; - kvStoreKey: ComputedRef; -} export interface StoreKeyConfigProtoMsg { typeUrl: "/cosmos.app.runtime.v2.StoreKeyConfig"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/app/v1alpha1/config.ts b/libs/interchain-vue/src/cosmos/app/v1alpha1/config.ts index 0a209fff..140a4900 100644 --- a/libs/interchain-vue/src/cosmos/app/v1alpha1/config.ts +++ b/libs/interchain-vue/src/cosmos/app/v1alpha1/config.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * Config represents the configuration for a Cosmos SDK ABCI app. * It is intended that all state machine logic including the version of @@ -22,10 +21,6 @@ export interface Config { */ golangBindings: GolangBinding[]; } -export interface ReactiveConfig { - modules: ComputedRef; - golangBindings: ComputedRef; -} export interface ConfigProtoMsg { typeUrl: "/cosmos.app.v1alpha1.Config"; value: Uint8Array; @@ -80,11 +75,6 @@ export interface ModuleConfig { */ golangBindings: GolangBinding[]; } -export interface ReactiveModuleConfig { - name: ComputedRef; - config?: ComputedRef; - golangBindings: ComputedRef; -} export interface ModuleConfigProtoMsg { typeUrl: "/cosmos.app.v1alpha1.ModuleConfig"; value: Uint8Array; @@ -127,10 +117,6 @@ export interface GolangBinding { /** implementation is the implementing type which will be supplied when an input of type interface is requested */ implementation: string; } -export interface ReactiveGolangBinding { - interfaceType: ComputedRef; - implementation: ComputedRef; -} export interface GolangBindingProtoMsg { typeUrl: "/cosmos.app.v1alpha1.GolangBinding"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/app/v1alpha1/module.ts b/libs/interchain-vue/src/cosmos/app/v1alpha1/module.ts index 4d45f099..35112e54 100644 --- a/libs/interchain-vue/src/cosmos/app/v1alpha1/module.ts +++ b/libs/interchain-vue/src/cosmos/app/v1alpha1/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** ModuleDescriptor describes an app module. */ export interface ModuleDescriptor { /** @@ -28,11 +27,6 @@ export interface ModuleDescriptor { */ canMigrateFrom: MigrateFromInfo[]; } -export interface ReactiveModuleDescriptor { - goImport: ComputedRef; - usePackage: ComputedRef; - canMigrateFrom: ComputedRef; -} export interface ModuleDescriptorProtoMsg { typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor"; value: Uint8Array; @@ -110,10 +104,6 @@ export interface PackageReference { */ revision: number; } -export interface ReactivePackageReference { - name: ComputedRef; - revision: ComputedRef; -} export interface PackageReferenceProtoMsg { typeUrl: "/cosmos.app.v1alpha1.PackageReference"; value: Uint8Array; @@ -176,9 +166,6 @@ export interface MigrateFromInfo { */ module: string; } -export interface ReactiveMigrateFromInfo { - module: ComputedRef; -} export interface MigrateFromInfoProtoMsg { typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.Query.ts deleted file mode 100644 index 160c22bb..00000000 --- a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.Query.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryConfigRequest, QueryConfigResponse, ReactiveQueryConfigRequest } from "./query"; -/** Query is the app module query service. */ -export interface Query { - /** Config returns the current app config. */ - config(request?: QueryConfigRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Config returns the current app config. */ - config = async (request: QueryConfigRequest = {}): Promise => { - const data = QueryConfigRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.app.v1alpha1.Query", "Config", data); - return promise.then(data => QueryConfigResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - config(request?: QueryConfigRequest): Promise { - return queryService.config(request); - } - }; -}; -export interface UseConfigQuery extends VueQueryParams { - request?: ReactiveQueryConfigRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useConfig = ({ - request, - options - }: UseConfigQuery) => { - const queryKey = ["configQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.config(params); - }, - ...options - }); - }; - return { - /** Config returns the current app config. */useConfig - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.func.ts new file mode 100644 index 00000000..32b7aad1 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.func.ts @@ -0,0 +1,9 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryConfigRequest, QueryConfigResponse } from "./query"; +export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryConfigRequest.encode, + decode: QueryConfigResponse.decode, + service: "cosmos.app.v1alpha1.Query", + method: "Config", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts new file mode 100644 index 00000000..e40053f0 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts @@ -0,0 +1,7 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryConfigRequest, QueryConfigResponse } from "./query"; +import { createGetConfig } from "./query.rpc.func.ts"; +export const useGetConfig = buildUseVueQuery({ + builderQueryFn: createGetConfig, + queryKeyPrefix: "ConfigQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.ts b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.ts index 60336cd0..beafd002 100644 --- a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.ts +++ b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.ts @@ -2,10 +2,8 @@ import { Config, ConfigAmino } from "./config"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryConfigRequest is the Query/Config request type. */ export interface QueryConfigRequest {} -export interface ReactiveQueryConfigRequest {} export interface QueryConfigRequestProtoMsg { typeUrl: "/cosmos.app.v1alpha1.QueryConfigRequest"; value: Uint8Array; @@ -21,9 +19,6 @@ export interface QueryConfigResponse { /** config is the current app config. */ config?: Config; } -export interface ReactiveQueryConfigResponse { - config?: ComputedRef; -} export interface QueryConfigResponseProtoMsg { typeUrl: "/cosmos.app.v1alpha1.QueryConfigResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/auth/module/v1/module.ts b/libs/interchain-vue/src/cosmos/auth/module/v1/module.ts index d7c56a50..a9b520e7 100644 --- a/libs/interchain-vue/src/cosmos/auth/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/auth/module/v1/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object for the auth module. */ export interface Module { /** bech32_prefix is the bech32 account prefix for the app. */ @@ -11,11 +10,6 @@ export interface Module { /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - bech32Prefix: ComputedRef; - moduleAccountPermissions: ComputedRef; - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.auth.module.v1.Module"; value: Uint8Array; @@ -43,10 +37,6 @@ export interface ModuleAccountPermission { */ permissions: string[]; } -export interface ReactiveModuleAccountPermission { - account: ComputedRef; - permissions: ComputedRef; -} export interface ModuleAccountPermissionProtoMsg { typeUrl: "/cosmos.auth.module.v1.ModuleAccountPermission"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/accounts.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/accounts.ts index eaff904b..c20afff6 100644 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/accounts.ts +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/accounts.ts @@ -3,7 +3,6 @@ import { BaseAccount, BaseAccountAmino } from "./auth"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * QueryLegacyAccount defines a query that can be implemented by an x/account * to return an auth understandable representation of an account. @@ -11,7 +10,6 @@ import { ComputedRef } from "vue"; * level, the state machine must not make any assumptions around this. */ export interface QueryLegacyAccount {} -export interface ReactiveQueryLegacyAccount {} export interface QueryLegacyAccountProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryLegacyAccount"; value: Uint8Array; @@ -45,10 +43,6 @@ export interface QueryLegacyAccountResponse { */ base?: BaseAccount; } -export interface ReactiveQueryLegacyAccountResponse { - account?: ComputedRef; - base?: ComputedRef; -} export interface QueryLegacyAccountResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryLegacyAccountResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/auth.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/auth.ts index 236320b9..c05b4a94 100644 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/auth.ts +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/auth.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * BaseAccount defines a base account type. It contains all the necessary fields * for basic account functionality. Any custom account type should extend this @@ -14,12 +13,6 @@ export interface BaseAccount { accountNumber: bigint; sequence: bigint; } -export interface ReactiveBaseAccount { - address: ComputedRef; - pubKey?: ComputedRef; - accountNumber: ComputedRef; - sequence: ComputedRef; -} export interface BaseAccountProtoMsg { typeUrl: "/cosmos.auth.v1beta1.BaseAccount"; value: Uint8Array; @@ -45,11 +38,6 @@ export interface ModuleAccount { name: string; permissions: string[]; } -export interface ReactiveModuleAccount { - baseAccount?: ComputedRef; - name: ComputedRef; - permissions: ComputedRef; -} export interface ModuleAccountProtoMsg { typeUrl: "/cosmos.auth.v1beta1.ModuleAccount"; value: Uint8Array; @@ -78,10 +66,6 @@ export interface ModuleCredential { */ derivationKeys: Uint8Array[]; } -export interface ReactiveModuleCredential { - moduleName: ComputedRef; - derivationKeys: ComputedRef; -} export interface ModuleCredentialProtoMsg { typeUrl: "/cosmos.auth.v1beta1.ModuleCredential"; value: Uint8Array; @@ -112,13 +96,6 @@ export interface Params { sigVerifyCostEd25519: bigint; sigVerifyCostSecp256k1: bigint; } -export interface ReactiveParams { - maxMemoCharacters: ComputedRef; - txSigLimit: ComputedRef; - txSizeCostPerByte: ComputedRef; - sigVerifyCostEd25519: ComputedRef; - sigVerifyCostSecp256k1: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.auth.v1beta1.Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/genesis.ts index 2ad907e6..3fdae8c7 100644 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/genesis.ts @@ -3,7 +3,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { /** params defines all the parameters of the module. */ @@ -11,10 +10,6 @@ export interface GenesisState { /** accounts are the accounts present at genesis. */ accounts: Any[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - accounts: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.auth.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts deleted file mode 100644 index e2374dd6..00000000 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,528 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse, ReactiveQueryAccountsRequest, ReactiveQueryAccountRequest, ReactiveQueryAccountAddressByIDRequest, ReactiveQueryParamsRequest, ReactiveQueryModuleAccountsRequest, ReactiveQueryModuleAccountByNameRequest, ReactiveQueryAccountInfoRequest } from "./query"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* 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 = async (request: QueryAccountsRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* Account returns account details based on address. */ - account = async (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 BinaryReader(data))); - }; - /* AccountAddressByID returns account address based on account number. - - Since: cosmos-sdk 0.46.2 */ - accountAddressByID = async (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 BinaryReader(data))); - }; - /* Params queries all parameters. */ - params = async (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 BinaryReader(data))); - }; - /* ModuleAccounts returns all the existing module accounts. - - Since: cosmos-sdk 0.46 */ - moduleAccounts = async (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 BinaryReader(data))); - }; - /* ModuleAccountByName returns the module account info by module name */ - moduleAccountByName = async (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 BinaryReader(data))); - }; - /* Bech32Prefix queries bech32Prefix - - Since: cosmos-sdk 0.46 */ - bech32Prefix = async (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 BinaryReader(data))); - }; - /* AddressBytesToString converts Account Address bytes to string - - Since: cosmos-sdk 0.46 */ - addressBytesToString = async (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 BinaryReader(data))); - }; - /* AddressStringToBytes converts Address string to bytes - - Since: cosmos-sdk 0.46 */ - addressStringToBytes = async (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 BinaryReader(data))); - }; - /* AccountInfo queries account info which is common to all account types. - - Since: cosmos-sdk 0.47 */ - accountInfo = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - accounts(request?: QueryAccountsRequest): Promise { - return queryService.accounts(request); - }, - account(request: QueryAccountRequest): Promise { - return queryService.account(request); - }, - accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { - return queryService.accountAddressByID(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - moduleAccounts(request?: QueryModuleAccountsRequest): Promise { - return queryService.moduleAccounts(request); - }, - moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise { - return queryService.moduleAccountByName(request); - }, - bech32Prefix(request?: Bech32PrefixRequest): Promise { - return queryService.bech32Prefix(request); - }, - addressBytesToString(request: AddressBytesToStringRequest): Promise { - return queryService.addressBytesToString(request); - }, - addressStringToBytes(request: AddressStringToBytesRequest): Promise { - return queryService.addressStringToBytes(request); - }, - accountInfo(request: QueryAccountInfoRequest): Promise { - return queryService.accountInfo(request); - } - }; -}; -export interface UseAccountsQuery extends VueQueryParams { - request?: ReactiveQueryAccountsRequest; -} -export interface UseAccountQuery extends VueQueryParams { - request: ReactiveQueryAccountRequest; -} -export interface UseAccountAddressByIDQuery extends VueQueryParams { - request: ReactiveQueryAccountAddressByIDRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseModuleAccountsQuery extends VueQueryParams { - request?: ReactiveQueryModuleAccountsRequest; -} -export interface UseModuleAccountByNameQuery extends VueQueryParams { - request: ReactiveQueryModuleAccountByNameRequest; -} -export interface UseBech32PrefixQuery extends VueQueryParams { - request?: ReactiveBech32PrefixRequest; -} -export interface UseAddressBytesToStringQuery extends VueQueryParams { - request: ReactiveAddressBytesToStringRequest; -} -export interface UseAddressStringToBytesQuery extends VueQueryParams { - request: ReactiveAddressStringToBytesRequest; -} -export interface UseAccountInfoQuery extends VueQueryParams { - request: ReactiveQueryAccountInfoRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useAccounts = ({ - request, - options - }: UseAccountsQuery) => { - const queryKey = ["accountsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accounts(params); - }, - ...options - }); - }; - const useAccount = ({ - request, - options - }: UseAccountQuery) => { - const queryKey = ["accountQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.account(params); - }, - ...options - }); - }; - const useAccountAddressByID = ({ - request, - options - }: UseAccountAddressByIDQuery) => { - const queryKey = ["accountAddressByIDQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accountAddressByID(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useModuleAccounts = ({ - request, - options - }: UseModuleAccountsQuery) => { - const queryKey = ["moduleAccountsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.moduleAccounts(params); - }, - ...options - }); - }; - const useModuleAccountByName = ({ - request, - options - }: UseModuleAccountByNameQuery) => { - const queryKey = ["moduleAccountByNameQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.moduleAccountByName(params); - }, - ...options - }); - }; - const useBech32Prefix = ({ - request, - options - }: UseBech32PrefixQuery) => { - const queryKey = ["bech32PrefixQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.bech32Prefix(params); - }, - ...options - }); - }; - const useAddressBytesToString = ({ - request, - options - }: UseAddressBytesToStringQuery) => { - const queryKey = ["addressBytesToStringQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.addressBytesToString(params); - }, - ...options - }); - }; - const useAddressStringToBytes = ({ - request, - options - }: UseAddressStringToBytesQuery) => { - const queryKey = ["addressStringToBytesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.addressStringToBytes(params); - }, - ...options - }); - }; - const useAccountInfo = ({ - request, - options - }: UseAccountInfoQuery) => { - const queryKey = ["accountInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accountInfo(params); - }, - ...options - }); - }; - return { - /** - * 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 - */ - useAccounts, - /** Account returns account details based on address. */useAccount, - /** - * AccountAddressByID returns account address based on account number. - * - * Since: cosmos-sdk 0.46.2 - */ - useAccountAddressByID, - /** Params queries all parameters. */useParams, - /** - * ModuleAccounts returns all the existing module accounts. - * - * Since: cosmos-sdk 0.46 - */ - useModuleAccounts, - /** ModuleAccountByName returns the module account info by module name */useModuleAccountByName, - /** - * Bech32Prefix queries bech32Prefix - * - * Since: cosmos-sdk 0.46 - */ - useBech32Prefix, - /** - * AddressBytesToString converts Account Address bytes to string - * - * Since: cosmos-sdk 0.46 - */ - useAddressBytesToString, - /** - * AddressStringToBytes converts Address string to bytes - * - * Since: cosmos-sdk 0.46 - */ - useAddressStringToBytes, - /** - * AccountInfo queries account info which is common to all account types. - * - * Since: cosmos-sdk 0.47 - */ - useAccountInfo - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..9a6e4931 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.func.ts @@ -0,0 +1,72 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountsRequest.encode, + decode: QueryAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Accounts", + clientResolver +}); +export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountRequest.encode, + decode: QueryAccountResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Account", + clientResolver +}); +export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressByIDRequest.encode, + decode: QueryAccountAddressByIDResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountAddressByID", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountsRequest.encode, + decode: QueryModuleAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccounts", + clientResolver +}); +export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountByNameRequest.encode, + decode: QueryModuleAccountByNameResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccountByName", + clientResolver +}); +export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuery({ + encode: Bech32PrefixRequest.encode, + decode: Bech32PrefixResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Bech32Prefix", + clientResolver +}); +export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressBytesToStringRequest.encode, + decode: AddressBytesToStringResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressBytesToString", + clientResolver +}); +export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressStringToBytesRequest.encode, + decode: AddressStringToBytesResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressStringToBytes", + clientResolver +}); +export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountInfoRequest.encode, + decode: QueryAccountInfoResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountInfo", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..b09ee08f --- /dev/null +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts @@ -0,0 +1,43 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +export const useGetAccounts = buildUseVueQuery({ + builderQueryFn: createGetAccounts, + queryKeyPrefix: "AccountsQuery" +}); +export const useGetAccount = buildUseVueQuery({ + builderQueryFn: createGetAccount, + queryKeyPrefix: "AccountQuery" +}); +export const useGetAccountAddressByID = buildUseVueQuery({ + builderQueryFn: createGetAccountAddressByID, + queryKeyPrefix: "AccountAddressByIDQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetModuleAccounts = buildUseVueQuery({ + builderQueryFn: createGetModuleAccounts, + queryKeyPrefix: "ModuleAccountsQuery" +}); +export const useGetModuleAccountByName = buildUseVueQuery({ + builderQueryFn: createGetModuleAccountByName, + queryKeyPrefix: "ModuleAccountByNameQuery" +}); +export const useGetBech32Prefix = buildUseVueQuery({ + builderQueryFn: createGetBech32Prefix, + queryKeyPrefix: "Bech32PrefixQuery" +}); +export const useGetAddressBytesToString = buildUseVueQuery({ + builderQueryFn: createGetAddressBytesToString, + queryKeyPrefix: "AddressBytesToStringQuery" +}); +export const useGetAddressStringToBytes = buildUseVueQuery({ + builderQueryFn: createGetAddressStringToBytes, + queryKeyPrefix: "AddressStringToBytesQuery" +}); +export const useGetAccountInfo = buildUseVueQuery({ + builderQueryFn: createGetAccountInfo, + queryKeyPrefix: "AccountInfoQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.ts index 50544a50..7a1a3c1a 100644 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.ts @@ -5,7 +5,6 @@ import { EthAccount, EthAccountProtoMsg } from "../../../injective/types/v1beta1 import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. * @@ -15,9 +14,6 @@ export interface QueryAccountsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAccountsRequest { - pagination?: ComputedRef; -} export interface QueryAccountsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; value: Uint8Array; @@ -46,10 +42,6 @@ export interface QueryAccountsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAccountsResponse { - accounts: ComputedRef<(BaseAccount | EthAccount | Any)[] | Any[]>; - pagination?: ComputedRef; -} export interface QueryAccountsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; value: Uint8Array; @@ -77,9 +69,6 @@ export interface QueryAccountRequest { /** address defines the address to query for. */ address: string; } -export interface ReactiveQueryAccountRequest { - address: ComputedRef; -} export interface QueryAccountRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest"; value: Uint8Array; @@ -98,9 +87,6 @@ export interface QueryAccountResponse { /** account defines the account of the corresponding address. */ account?: BaseAccount | EthAccount | Any | undefined; } -export interface ReactiveQueryAccountResponse { - account?: ComputedRef; -} export interface QueryAccountResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse"; value: Uint8Array; @@ -119,7 +105,6 @@ export interface QueryAccountResponseAminoMsg { } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -135,9 +120,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -157,7 +139,6 @@ export interface QueryParamsResponseAminoMsg { * Since: cosmos-sdk 0.46 */ export interface QueryModuleAccountsRequest {} -export interface ReactiveQueryModuleAccountsRequest {} export interface QueryModuleAccountsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest"; value: Uint8Array; @@ -180,9 +161,6 @@ export interface QueryModuleAccountsRequestAminoMsg { export interface QueryModuleAccountsResponse { accounts: (ModuleAccount | Any)[] | Any[]; } -export interface ReactiveQueryModuleAccountsResponse { - accounts: ComputedRef<(ModuleAccount | Any)[] | Any[]>; -} export interface QueryModuleAccountsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse"; value: Uint8Array; @@ -206,9 +184,6 @@ export interface QueryModuleAccountsResponseAminoMsg { export interface QueryModuleAccountByNameRequest { name: string; } -export interface ReactiveQueryModuleAccountByNameRequest { - name: ComputedRef; -} export interface QueryModuleAccountByNameRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest"; value: Uint8Array; @@ -225,9 +200,6 @@ export interface QueryModuleAccountByNameRequestAminoMsg { export interface QueryModuleAccountByNameResponse { account?: ModuleAccount | Any | undefined; } -export interface ReactiveQueryModuleAccountByNameResponse { - account?: ComputedRef; -} export interface QueryModuleAccountByNameResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse"; value: Uint8Array; @@ -249,7 +221,6 @@ export interface QueryModuleAccountByNameResponseAminoMsg { * Since: cosmos-sdk 0.46 */ export interface Bech32PrefixRequest {} -export interface ReactiveBech32PrefixRequest {} export interface Bech32PrefixRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest"; value: Uint8Array; @@ -272,9 +243,6 @@ export interface Bech32PrefixRequestAminoMsg { export interface Bech32PrefixResponse { bech32Prefix: string; } -export interface ReactiveBech32PrefixResponse { - bech32Prefix: ComputedRef; -} export interface Bech32PrefixResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse"; value: Uint8Array; @@ -299,9 +267,6 @@ export interface Bech32PrefixResponseAminoMsg { export interface AddressBytesToStringRequest { addressBytes: Uint8Array; } -export interface ReactiveAddressBytesToStringRequest { - addressBytes: ComputedRef; -} export interface AddressBytesToStringRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest"; value: Uint8Array; @@ -326,9 +291,6 @@ export interface AddressBytesToStringRequestAminoMsg { export interface AddressBytesToStringResponse { addressString: string; } -export interface ReactiveAddressBytesToStringResponse { - addressString: ComputedRef; -} export interface AddressBytesToStringResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse"; value: Uint8Array; @@ -353,9 +315,6 @@ export interface AddressBytesToStringResponseAminoMsg { export interface AddressStringToBytesRequest { addressString: string; } -export interface ReactiveAddressStringToBytesRequest { - addressString: ComputedRef; -} export interface AddressStringToBytesRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest"; value: Uint8Array; @@ -380,9 +339,6 @@ export interface AddressStringToBytesRequestAminoMsg { export interface AddressStringToBytesResponse { addressBytes: Uint8Array; } -export interface ReactiveAddressStringToBytesResponse { - addressBytes: ComputedRef; -} export interface AddressStringToBytesResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse"; value: Uint8Array; @@ -421,10 +377,6 @@ export interface QueryAccountAddressByIDRequest { */ accountId: bigint; } -export interface ReactiveQueryAccountAddressByIDRequest { - id: ComputedRef; - accountId: ComputedRef; -} export interface QueryAccountAddressByIDRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest"; value: Uint8Array; @@ -463,9 +415,6 @@ export interface QueryAccountAddressByIDRequestAminoMsg { export interface QueryAccountAddressByIDResponse { accountAddress: string; } -export interface ReactiveQueryAccountAddressByIDResponse { - accountAddress: ComputedRef; -} export interface QueryAccountAddressByIDResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse"; value: Uint8Array; @@ -491,9 +440,6 @@ export interface QueryAccountInfoRequest { /** address is the account address string. */ address: string; } -export interface ReactiveQueryAccountInfoRequest { - address: ComputedRef; -} export interface QueryAccountInfoRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest"; value: Uint8Array; @@ -520,9 +466,6 @@ export interface QueryAccountInfoResponse { /** info is the account info which is represented by BaseAccount. */ info?: BaseAccount; } -export interface ReactiveQueryAccountInfoResponse { - info?: ComputedRef; -} export interface QueryAccountInfoResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.amino.ts deleted file mode 100644 index 7232eddd..00000000 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.amino.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/cosmos.auth.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/auth/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..d8aead51 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.func.ts @@ -0,0 +1,9 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateParams } from "./tx"; +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index bde89cf6..00000000 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..9b8d58b6 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,6 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgUpdateParams } from "./tx"; +import { createUpdateParams } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.ts index 9a9e3c8c..677eca13 100644 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino } from "./auth"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgUpdateParams is the Msg/UpdateParams request type. * @@ -18,10 +17,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -52,7 +47,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/authz/module/v1/module.ts b/libs/interchain-vue/src/cosmos/authz/module/v1/module.ts index 506e9800..d41a91b8 100644 --- a/libs/interchain-vue/src/cosmos/authz/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/authz/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object of the authz module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.authz.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/authz.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/authz.ts index 61f00561..55767e79 100644 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/authz.ts +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/authz.ts @@ -5,7 +5,6 @@ import { StakeAuthorization, StakeAuthorizationProtoMsg } from "../../staking/v1 import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * GenericAuthorization gives the grantee unrestricted permissions to execute * the provided method on behalf of the granter's account. @@ -14,9 +13,6 @@ export interface GenericAuthorization { /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ msg: string; } -export interface ReactiveGenericAuthorization { - msg: ComputedRef; -} export interface GenericAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization"; value: Uint8Array; @@ -46,10 +42,6 @@ export interface Grant { */ expiration?: Date; } -export interface ReactiveGrant { - authorization?: ComputedRef; - expiration?: ComputedRef; -} export interface GrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.Grant"; value: Uint8Array; @@ -84,12 +76,6 @@ export interface GrantAuthorization { authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | Any | undefined; expiration?: Date; } -export interface ReactiveGrantAuthorization { - granter: ComputedRef; - grantee: ComputedRef; - authorization?: ComputedRef; - expiration?: ComputedRef; -} export interface GrantAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; value: Uint8Array; @@ -116,9 +102,6 @@ export interface GrantQueueItem { /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ msgTypeUrls: string[]; } -export interface ReactiveGrantQueueItem { - msgTypeUrls: ComputedRef; -} export interface GrantQueueItemProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/event.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/event.ts index e0eaa4fc..68c3ccf9 100644 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/event.ts +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/event.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** EventGrant is emitted on Msg/Grant */ export interface EventGrant { /** Msg type URL for which an autorization is granted */ @@ -11,11 +10,6 @@ export interface EventGrant { /** Grantee account address */ grantee: string; } -export interface ReactiveEventGrant { - msgTypeUrl: ComputedRef; - granter: ComputedRef; - grantee: ComputedRef; -} export interface EventGrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.EventGrant"; value: Uint8Array; @@ -42,11 +36,6 @@ export interface EventRevoke { /** Grantee account address */ grantee: string; } -export interface ReactiveEventRevoke { - msgTypeUrl: ComputedRef; - granter: ComputedRef; - grantee: ComputedRef; -} export interface EventRevokeProtoMsg { typeUrl: "/cosmos.authz.v1beta1.EventRevoke"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/genesis.ts index b4a4ca1e..8d56f636 100644 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/genesis.ts @@ -2,14 +2,10 @@ import { GrantAuthorization, GrantAuthorizationAmino } from "./authz"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** GenesisState defines the authz module's genesis state. */ export interface GenesisState { authorization: GrantAuthorization[]; } -export interface ReactiveGenesisState { - authorization: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.Query.ts deleted file mode 100644 index b9ad60a2..00000000 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse, ReactiveQueryGrantsRequest, ReactiveQueryGranterGrantsRequest, ReactiveQueryGranteeGrantsRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Returns list of `Authorization`, granted to the grantee by the granter. */ - grants(request: QueryGrantsRequest): Promise; - /** - * GranterGrants returns list of `GrantAuthorization`, granted by granter. - * - * Since: cosmos-sdk 0.46 - */ - granterGrants(request: QueryGranterGrantsRequest): Promise; - /** - * GranteeGrants returns a list of `GrantAuthorization` by grantee. - * - * Since: cosmos-sdk 0.46 - */ - granteeGrants(request: QueryGranteeGrantsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Returns list of `Authorization`, granted to the grantee by the granter. */ - grants = async (request: QueryGrantsRequest): Promise => { - const data = QueryGrantsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "Grants", data); - return promise.then(data => QueryGrantsResponse.decode(new BinaryReader(data))); - }; - /* GranterGrants returns list of `GrantAuthorization`, granted by granter. - - Since: cosmos-sdk 0.46 */ - granterGrants = async (request: QueryGranterGrantsRequest): Promise => { - const data = QueryGranterGrantsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranterGrants", data); - return promise.then(data => QueryGranterGrantsResponse.decode(new BinaryReader(data))); - }; - /* GranteeGrants returns a list of `GrantAuthorization` by grantee. - - Since: cosmos-sdk 0.46 */ - granteeGrants = async (request: QueryGranteeGrantsRequest): Promise => { - const data = QueryGranteeGrantsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranteeGrants", data); - return promise.then(data => QueryGranteeGrantsResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - grants(request: QueryGrantsRequest): Promise { - return queryService.grants(request); - }, - granterGrants(request: QueryGranterGrantsRequest): Promise { - return queryService.granterGrants(request); - }, - granteeGrants(request: QueryGranteeGrantsRequest): Promise { - return queryService.granteeGrants(request); - } - }; -}; -export interface UseGrantsQuery extends VueQueryParams { - request: ReactiveQueryGrantsRequest; -} -export interface UseGranterGrantsQuery extends VueQueryParams { - request: ReactiveQueryGranterGrantsRequest; -} -export interface UseGranteeGrantsQuery extends VueQueryParams { - request: ReactiveQueryGranteeGrantsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useGrants = ({ - request, - options - }: UseGrantsQuery) => { - const queryKey = ["grantsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.grants(params); - }, - ...options - }); - }; - const useGranterGrants = ({ - request, - options - }: UseGranterGrantsQuery) => { - const queryKey = ["granterGrantsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.granterGrants(params); - }, - ...options - }); - }; - const useGranteeGrants = ({ - request, - options - }: UseGranteeGrantsQuery) => { - const queryKey = ["granteeGrantsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.granteeGrants(params); - }, - ...options - }); - }; - return { - /** Returns list of `Authorization`, granted to the grantee by the granter. */useGrants, - /** - * GranterGrants returns list of `GrantAuthorization`, granted by granter. - * - * Since: cosmos-sdk 0.46 - */ - useGranterGrants, - /** - * GranteeGrants returns a list of `GrantAuthorization` by grantee. - * - * Since: cosmos-sdk 0.46 - */ - useGranteeGrants - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..d06d8995 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.func.ts @@ -0,0 +1,23 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; +export const createGetGrants = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGrantsRequest.encode, + decode: QueryGrantsResponse.decode, + service: "cosmos.authz.v1beta1.Query", + method: "Grants", + clientResolver +}); +export const createGetGranterGrants = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGranterGrantsRequest.encode, + decode: QueryGranterGrantsResponse.decode, + service: "cosmos.authz.v1beta1.Query", + method: "GranterGrants", + clientResolver +}); +export const createGetGranteeGrants = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGranteeGrantsRequest.encode, + decode: QueryGranteeGrantsResponse.decode, + service: "cosmos.authz.v1beta1.Query", + method: "GranteeGrants", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..9cfcad77 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; +import { createGetGrants, createGetGranterGrants, createGetGranteeGrants } from "./query.rpc.func.ts"; +export const useGetGrants = buildUseVueQuery({ + builderQueryFn: createGetGrants, + queryKeyPrefix: "GrantsQuery" +}); +export const useGetGranterGrants = buildUseVueQuery({ + builderQueryFn: createGetGranterGrants, + queryKeyPrefix: "GranterGrantsQuery" +}); +export const useGetGranteeGrants = buildUseVueQuery({ + builderQueryFn: createGetGranteeGrants, + queryKeyPrefix: "GranteeGrantsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.ts index 9fb959e5..5d37d134 100644 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.ts @@ -3,7 +3,6 @@ import { Grant, GrantAmino, GrantAuthorization, GrantAuthorizationAmino } from " import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequest { granter: string; @@ -13,12 +12,6 @@ export interface QueryGrantsRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGrantsRequest { - granter: ComputedRef; - grantee: ComputedRef; - msgTypeUrl: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest"; value: Uint8Array; @@ -43,10 +36,6 @@ export interface QueryGrantsResponse { /** pagination defines an pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGrantsResponse { - grants: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse"; value: Uint8Array; @@ -68,10 +57,6 @@ export interface QueryGranterGrantsRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGranterGrantsRequest { - granter: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGranterGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest"; value: Uint8Array; @@ -93,10 +78,6 @@ export interface QueryGranterGrantsResponse { /** pagination defines an pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGranterGrantsResponse { - grants: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGranterGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse"; value: Uint8Array; @@ -118,10 +99,6 @@ export interface QueryGranteeGrantsRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGranteeGrantsRequest { - grantee: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGranteeGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest"; value: Uint8Array; @@ -143,10 +120,6 @@ export interface QueryGranteeGrantsResponse { /** pagination defines an pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGranteeGrantsResponse { - grants: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGranteeGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.amino.ts deleted file mode 100644 index 6fcf9fd4..00000000 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; -export const AminoConverter = { - "/cosmos.authz.v1beta1.MsgGrant": { - aminoType: "cosmos-sdk/MsgGrant", - toAmino: MsgGrant.toAmino, - fromAmino: MsgGrant.fromAmino - }, - "/cosmos.authz.v1beta1.MsgExec": { - aminoType: "cosmos-sdk/MsgExec", - toAmino: MsgExec.toAmino, - fromAmino: MsgExec.fromAmino - }, - "/cosmos.authz.v1beta1.MsgRevoke": { - aminoType: "cosmos-sdk/MsgRevoke", - toAmino: MsgRevoke.toAmino, - fromAmino: MsgRevoke.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..18006a6c --- /dev/null +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrant.typeUrl, + encoders: toEncoders(MsgGrant), + converters: toConverters(MsgGrant) +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const createRevoke = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevoke.typeUrl, + encoders: toEncoders(MsgRevoke), + converters: toConverters(MsgRevoke) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index e690d4f6..00000000 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgGrant, MsgGrantResponse, MsgExec, MsgExecResponse, MsgRevoke, MsgRevokeResponse } from "./tx"; -/** Msg defines the authz Msg service. */ -export interface Msg { - /** - * Grant grants the provided authorization to the grantee on the granter's - * account with the provided expiration time. If there is already a grant - * for the given (granter, grantee, Authorization) triple, then the grant - * will be overwritten. - */ - grant(request: MsgGrant): Promise; - /** - * Exec attempts to execute the provided messages using - * authorizations granted to the grantee. Each message should have only - * one signer corresponding to the granter of the authorization. - */ - exec(request: MsgExec): Promise; - /** - * Revoke revokes any authorization corresponding to the provided method name on the - * granter's account that has been granted to the grantee. - */ - revoke(request: MsgRevoke): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Grant grants the provided authorization to the grantee on the granter's - account with the provided expiration time. If there is already a grant - for the given (granter, grantee, Authorization) triple, then the grant - will be overwritten. */ - grant = async (request: MsgGrant): Promise => { - const data = MsgGrant.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Grant", data); - return promise.then(data => MsgGrantResponse.decode(new BinaryReader(data))); - }; - /* Exec attempts to execute the provided messages using - authorizations granted to the grantee. Each message should have only - one signer corresponding to the granter of the authorization. */ - exec = async (request: MsgExec): Promise => { - const data = MsgExec.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Exec", data); - return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); - }; - /* Revoke revokes any authorization corresponding to the provided method name on the - granter's account that has been granted to the grantee. */ - revoke = async (request: MsgRevoke): Promise => { - const data = MsgRevoke.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data); - return promise.then(data => MsgRevokeResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..214f14b1 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,12 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +export const useGrant = buildUseVueMutation({ + builderMutationFn: createGrant +}); +export const useExec = buildUseVueMutation({ + builderMutationFn: createExec +}); +export const useRevoke = buildUseVueMutation({ + builderMutationFn: createRevoke +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.ts index 375f7350..96acd25e 100644 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. @@ -13,11 +12,6 @@ export interface MsgGrant { grantee: string; grant: Grant; } -export interface ReactiveMsgGrant { - granter: ComputedRef; - grantee: ComputedRef; - grant: ComputedRef; -} export interface MsgGrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgGrant"; value: Uint8Array; @@ -37,7 +31,6 @@ export interface MsgGrantAminoMsg { } /** MsgGrantResponse defines the Msg/MsgGrant response type. */ export interface MsgGrantResponse {} -export interface ReactiveMsgGrantResponse {} export interface MsgGrantResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; value: Uint8Array; @@ -62,10 +55,6 @@ export interface MsgExec { */ msgs: (Any)[] | Any[]; } -export interface ReactiveMsgExec { - grantee: ComputedRef; - msgs: ComputedRef<(Any)[] | Any[]>; -} export interface MsgExecProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgExec"; value: Uint8Array; @@ -100,9 +89,6 @@ export interface MsgExecAminoMsg { export interface MsgExecResponse { results: Uint8Array[]; } -export interface ReactiveMsgExecResponse { - results: ComputedRef; -} export interface MsgExecResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; value: Uint8Array; @@ -124,11 +110,6 @@ export interface MsgRevoke { grantee: string; msgTypeUrl: string; } -export interface ReactiveMsgRevoke { - granter: ComputedRef; - grantee: ComputedRef; - msgTypeUrl: ComputedRef; -} export interface MsgRevokeProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke"; value: Uint8Array; @@ -148,7 +129,6 @@ export interface MsgRevokeAminoMsg { } /** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ export interface MsgRevokeResponse {} -export interface ReactiveMsgRevokeResponse {} export interface MsgRevokeResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/autocli/v1/options.ts b/libs/interchain-vue/src/cosmos/autocli/v1/options.ts index da3cf6a7..973db14a 100644 --- a/libs/interchain-vue/src/cosmos/autocli/v1/options.ts +++ b/libs/interchain-vue/src/cosmos/autocli/v1/options.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; /** ModuleOptions describes the CLI options for a Cosmos SDK module. */ export interface ModuleOptions { /** tx describes the tx commands for the module. */ @@ -9,10 +8,6 @@ export interface ModuleOptions { /** query describes the queries commands for the module. */ query?: ServiceCommandDescriptor; } -export interface ReactiveModuleOptions { - tx?: ComputedRef; - query?: ComputedRef; -} export interface ModuleOptionsProtoMsg { typeUrl: "/cosmos.autocli.v1.ModuleOptions"; value: Uint8Array; @@ -32,10 +27,6 @@ export interface ServiceCommandDescriptor_SubCommandsEntry { key: string; value?: ServiceCommandDescriptor; } -export interface ReactiveServiceCommandDescriptor_SubCommandsEntry { - key: ComputedRef; - value?: ComputedRef; -} export interface ServiceCommandDescriptor_SubCommandsEntryProtoMsg { typeUrl: string; value: Uint8Array; @@ -71,13 +62,6 @@ export interface ServiceCommandDescriptor { [key: string]: ServiceCommandDescriptor; }; } -export interface ReactiveServiceCommandDescriptor { - service: ComputedRef; - rpcCommandOptions: ComputedRef; - subCommands: ComputedRef<{ - [key: string]: ServiceCommandDescriptor; - }>; -} export interface ServiceCommandDescriptorProtoMsg { typeUrl: "/cosmos.autocli.v1.ServiceCommandDescriptor"; value: Uint8Array; @@ -113,10 +97,6 @@ export interface RpcCommandOptions_FlagOptionsEntry { key: string; value?: FlagOptions; } -export interface ReactiveRpcCommandOptions_FlagOptionsEntry { - key: ComputedRef; - value?: ComputedRef; -} export interface RpcCommandOptions_FlagOptionsEntryProtoMsg { typeUrl: string; value: Uint8Array; @@ -182,22 +162,6 @@ export interface RpcCommandOptions { /** skip specifies whether to skip this rpc method when generating commands. */ skip: boolean; } -export interface ReactiveRpcCommandOptions { - rpcMethod: ComputedRef; - use: ComputedRef; - long: ComputedRef; - short: ComputedRef; - example: ComputedRef; - alias: ComputedRef; - suggestFor: ComputedRef; - deprecated: ComputedRef; - version: ComputedRef; - flagOptions: ComputedRef<{ - [key: string]: FlagOptions; - }>; - positionalArgs: ComputedRef; - skip: ComputedRef; -} export interface RpcCommandOptionsProtoMsg { typeUrl: "/cosmos.autocli.v1.RpcCommandOptions"; value: Uint8Array; @@ -281,15 +245,6 @@ export interface FlagOptions { /** hidden hides the flag from help/usage text */ hidden: boolean; } -export interface ReactiveFlagOptions { - name: ComputedRef; - shorthand: ComputedRef; - usage: ComputedRef; - defaultValue: ComputedRef; - deprecated: ComputedRef; - shorthandDeprecated: ComputedRef; - hidden: ComputedRef; -} export interface FlagOptionsProtoMsg { typeUrl: "/cosmos.autocli.v1.FlagOptions"; value: Uint8Array; @@ -334,10 +289,6 @@ export interface PositionalArgDescriptor { */ varargs: boolean; } -export interface ReactivePositionalArgDescriptor { - protoField: ComputedRef; - varargs: ComputedRef; -} export interface PositionalArgDescriptorProtoMsg { typeUrl: "/cosmos.autocli.v1.PositionalArgDescriptor"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.Query.ts deleted file mode 100644 index 67307805..00000000 --- a/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.Query.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { AppOptionsRequest, AppOptionsResponse } from "./query"; -/** RemoteInfoService provides clients with the information they need - to build dynamically CLI clients for remote chains. */ -export interface Query { - /** AppOptions returns the autocli options for all of the modules in an app. */ - appOptions(request?: AppOptionsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* AppOptions returns the autocli options for all of the modules in an app. */ - appOptions = async (request: AppOptionsRequest = {}): Promise => { - const data = AppOptionsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.autocli.v1.Query", "AppOptions", data); - return promise.then(data => AppOptionsResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - appOptions(request?: AppOptionsRequest): Promise { - return queryService.appOptions(request); - } - }; -}; -export interface UseAppOptionsQuery extends VueQueryParams { - request?: ReactiveAppOptionsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useAppOptions = ({ - request, - options - }: UseAppOptionsQuery) => { - const queryKey = ["appOptionsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.appOptions(params); - }, - ...options - }); - }; - return { - /** AppOptions returns the autocli options for all of the modules in an app. */useAppOptions - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.func.ts new file mode 100644 index 00000000..7bafd177 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.func.ts @@ -0,0 +1,9 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { AppOptionsRequest, AppOptionsResponse } from "./query"; +export const createGetAppOptions = (clientResolver?: RpcResolver) => buildQuery({ + encode: AppOptionsRequest.encode, + decode: AppOptionsResponse.decode, + service: "cosmos.autocli.v1.Query", + method: "AppOptions", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts new file mode 100644 index 00000000..ec9ede15 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts @@ -0,0 +1,7 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { AppOptionsRequest, AppOptionsResponse } from "./query"; +import { createGetAppOptions } from "./query.rpc.func.ts"; +export const useGetAppOptions = buildUseVueQuery({ + builderQueryFn: createGetAppOptions, + queryKeyPrefix: "AppOptionsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/autocli/v1/query.ts b/libs/interchain-vue/src/cosmos/autocli/v1/query.ts index 23694755..1dca8911 100644 --- a/libs/interchain-vue/src/cosmos/autocli/v1/query.ts +++ b/libs/interchain-vue/src/cosmos/autocli/v1/query.ts @@ -2,10 +2,8 @@ import { ModuleOptions, ModuleOptionsAmino } from "./options"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** AppOptionsRequest is the RemoteInfoService/AppOptions request type. */ export interface AppOptionsRequest {} -export interface ReactiveAppOptionsRequest {} export interface AppOptionsRequestProtoMsg { typeUrl: "/cosmos.autocli.v1.AppOptionsRequest"; value: Uint8Array; @@ -20,10 +18,6 @@ export interface AppOptionsResponse_ModuleOptionsEntry { key: string; value?: ModuleOptions; } -export interface ReactiveAppOptionsResponse_ModuleOptionsEntry { - key: ComputedRef; - value?: ComputedRef; -} export interface AppOptionsResponse_ModuleOptionsEntryProtoMsg { typeUrl: string; value: Uint8Array; @@ -43,11 +37,6 @@ export interface AppOptionsResponse { [key: string]: ModuleOptions; }; } -export interface ReactiveAppOptionsResponse { - moduleOptions: ComputedRef<{ - [key: string]: ModuleOptions; - }>; -} export interface AppOptionsResponseProtoMsg { typeUrl: "/cosmos.autocli.v1.AppOptionsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/bank/module/v1/module.ts b/libs/interchain-vue/src/cosmos/bank/module/v1/module.ts index 53a89506..6a46a3b7 100644 --- a/libs/interchain-vue/src/cosmos/bank/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/bank/module/v1/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the bank module. */ export interface Module { /** @@ -20,11 +19,6 @@ export interface Module { */ restrictionsOrder: string[]; } -export interface ReactiveModule { - blockedModuleAccountsOverride: ComputedRef; - authority: ComputedRef; - restrictionsOrder: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.bank.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/authz.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/authz.ts index 94877082..1c719cf2 100644 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/authz.ts +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/authz.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * SendAuthorization allows the grantee to spend up to spend_limit coins from * the granter's account. @@ -19,10 +18,6 @@ export interface SendAuthorization { */ allowList: string[]; } -export interface ReactiveSendAuthorization { - spendLimit: ComputedRef; - allowList: ComputedRef; -} export interface SendAuthorizationProtoMsg { typeUrl: "/cosmos.bank.v1beta1.SendAuthorization"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/bank.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/bank.ts index 70e96f40..2c115ba3 100644 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/bank.ts +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/bank.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Params defines the parameters for the bank module. */ export interface Params { /** @@ -16,10 +15,6 @@ export interface Params { sendEnabled: SendEnabled[]; defaultSendEnabled: boolean; } -export interface ReactiveParams { - sendEnabled: ComputedRef; - defaultSendEnabled: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Params"; value: Uint8Array; @@ -49,10 +44,6 @@ export interface SendEnabled { denom: string; enabled: boolean; } -export interface ReactiveSendEnabled { - denom: ComputedRef; - enabled: ComputedRef; -} export interface SendEnabledProtoMsg { typeUrl: "/cosmos.bank.v1beta1.SendEnabled"; value: Uint8Array; @@ -74,10 +65,6 @@ export interface Input { address: string; coins: Coin[]; } -export interface ReactiveInput { - address: ComputedRef; - coins: ComputedRef; -} export interface InputProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Input"; value: Uint8Array; @@ -96,10 +83,6 @@ export interface Output { address: string; coins: Coin[]; } -export interface ReactiveOutput { - address: ComputedRef; - coins: ComputedRef; -} export interface OutputProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Output"; value: Uint8Array; @@ -122,9 +105,6 @@ export interface OutputAminoMsg { export interface Supply { total: Coin[]; } -export interface ReactiveSupply { - total: ComputedRef; -} export interface SupplyProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Supply"; value: Uint8Array; @@ -160,11 +140,6 @@ export interface DenomUnit { /** aliases is a list of string aliases for the given denom */ aliases: string[]; } -export interface ReactiveDenomUnit { - denom: ComputedRef; - exponent: ComputedRef; - aliases: ComputedRef; -} export interface DenomUnitProtoMsg { typeUrl: "/cosmos.bank.v1beta1.DenomUnit"; value: Uint8Array; @@ -233,16 +208,6 @@ export interface Metadata { */ uriHash: string; } -export interface ReactiveMetadata { - description: ComputedRef; - denomUnits: ComputedRef; - base: ComputedRef; - display: ComputedRef; - name: ComputedRef; - symbol: ComputedRef; - uri: ComputedRef; - uriHash: ComputedRef; -} export interface MetadataProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Metadata"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/genesis.ts index 1e9753f1..246deebf 100644 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/genesis.ts @@ -3,7 +3,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { /** params defines all the parameters of the module. */ @@ -24,13 +23,6 @@ export interface GenesisState { */ sendEnabled: SendEnabled[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - balances: ComputedRef; - supply: ComputedRef; - denomMetadata: ComputedRef; - sendEnabled: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.bank.v1beta1.GenesisState"; value: Uint8Array; @@ -69,10 +61,6 @@ export interface Balance { /** coins defines the different coins this balance holds. */ coins: Coin[]; } -export interface ReactiveBalance { - address: ComputedRef; - coins: ComputedRef; -} export interface BalanceProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Balance"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts deleted file mode 100644 index ff16a80c..00000000 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,720 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse, ReactiveQueryBalanceRequest, ReactiveQueryAllBalancesRequest, ReactiveQuerySpendableBalancesRequest, ReactiveQuerySpendableBalanceByDenomRequest, ReactiveQueryTotalSupplyRequest, ReactiveQuerySupplyOfRequest, ReactiveQueryParamsRequest, ReactiveQueryDenomMetadataRequest, ReactiveQueryDenomMetadataByQueryStringRequest, ReactiveQueryDenomsMetadataRequest, ReactiveQueryDenomOwnersRequest, ReactiveQueryDenomOwnersByQueryRequest, ReactiveQuerySendEnabledRequest } from "./query"; -/** Query defines the gRPC querier service. */ -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. - * - * 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. - */ - supplyOf(request: QuerySupplyOfRequest): Promise; - /** Params queries the parameters of x/bank module. */ - params(request?: QueryParamsRequest): Promise; - /** DenomMetadata queries the client metadata of a given coin denomination. */ - denomMetadata(request: QueryDenomMetadataRequest): Promise; - /** DenomMetadataByQueryString queries the client metadata of a given coin denomination. */ - denomMetadataByQueryString(request: QueryDenomMetadataByQueryStringRequest): 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; - /** - * DenomOwnersByQuery queries for all account addresses that own a particular token - * denomination. - * - * Since: cosmos-sdk 0.50.3 - */ - denomOwnersByQuery(request: QueryDenomOwnersByQueryRequest): 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Balance queries the balance of a single coin for a single account. */ - balance = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (request: QueryTotalSupplyRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* 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. */ - supplyOf = async (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 BinaryReader(data))); - }; - /* Params queries the parameters of x/bank module. */ - params = async (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 BinaryReader(data))); - }; - /* DenomMetadata queries the client metadata of a given coin denomination. */ - denomMetadata = async (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 BinaryReader(data))); - }; - /* DenomMetadataByQueryString queries the client metadata of a given coin denomination. */ - denomMetadataByQueryString = async (request: QueryDenomMetadataByQueryStringRequest): Promise => { - const data = QueryDenomMetadataByQueryStringRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadataByQueryString", data); - return promise.then(data => QueryDenomMetadataByQueryStringResponse.decode(new BinaryReader(data))); - }; - /* DenomsMetadata queries the client metadata for all registered coin - denominations. */ - denomsMetadata = async (request: QueryDenomsMetadataRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* DenomOwnersByQuery queries for all account addresses that own a particular token - denomination. - - Since: cosmos-sdk 0.50.3 */ - denomOwnersByQuery = async (request: QueryDenomOwnersByQueryRequest): Promise => { - const data = QueryDenomOwnersByQueryRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwnersByQuery", data); - return promise.then(data => QueryDenomOwnersByQueryResponse.decode(new BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - balance(request: QueryBalanceRequest): Promise { - return queryService.balance(request); - }, - allBalances(request: QueryAllBalancesRequest): Promise { - return queryService.allBalances(request); - }, - spendableBalances(request: QuerySpendableBalancesRequest): Promise { - return queryService.spendableBalances(request); - }, - spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { - return queryService.spendableBalanceByDenom(request); - }, - totalSupply(request?: QueryTotalSupplyRequest): Promise { - return queryService.totalSupply(request); - }, - supplyOf(request: QuerySupplyOfRequest): Promise { - return queryService.supplyOf(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - denomMetadata(request: QueryDenomMetadataRequest): Promise { - return queryService.denomMetadata(request); - }, - denomMetadataByQueryString(request: QueryDenomMetadataByQueryStringRequest): Promise { - return queryService.denomMetadataByQueryString(request); - }, - denomsMetadata(request?: QueryDenomsMetadataRequest): Promise { - return queryService.denomsMetadata(request); - }, - denomOwners(request: QueryDenomOwnersRequest): Promise { - return queryService.denomOwners(request); - }, - denomOwnersByQuery(request: QueryDenomOwnersByQueryRequest): Promise { - return queryService.denomOwnersByQuery(request); - }, - sendEnabled(request: QuerySendEnabledRequest): Promise { - return queryService.sendEnabled(request); - } - }; -}; -export interface UseBalanceQuery extends VueQueryParams { - request: ReactiveQueryBalanceRequest; -} -export interface UseAllBalancesQuery extends VueQueryParams { - request: ReactiveQueryAllBalancesRequest; -} -export interface UseSpendableBalancesQuery extends VueQueryParams { - request: ReactiveQuerySpendableBalancesRequest; -} -export interface UseSpendableBalanceByDenomQuery extends VueQueryParams { - request: ReactiveQuerySpendableBalanceByDenomRequest; -} -export interface UseTotalSupplyQuery extends VueQueryParams { - request?: ReactiveQueryTotalSupplyRequest; -} -export interface UseSupplyOfQuery extends VueQueryParams { - request: ReactiveQuerySupplyOfRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseDenomMetadataQuery extends VueQueryParams { - request: ReactiveQueryDenomMetadataRequest; -} -export interface UseDenomMetadataByQueryStringQuery extends VueQueryParams { - request: ReactiveQueryDenomMetadataByQueryStringRequest; -} -export interface UseDenomsMetadataQuery extends VueQueryParams { - request?: ReactiveQueryDenomsMetadataRequest; -} -export interface UseDenomOwnersQuery extends VueQueryParams { - request: ReactiveQueryDenomOwnersRequest; -} -export interface UseDenomOwnersByQueryQuery extends VueQueryParams { - request: ReactiveQueryDenomOwnersByQueryRequest; -} -export interface UseSendEnabledQuery extends VueQueryParams { - request: ReactiveQuerySendEnabledRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useBalance = ({ - request, - options - }: UseBalanceQuery) => { - const queryKey = ["balanceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.balance(params); - }, - ...options - }); - }; - const useAllBalances = ({ - request, - options - }: UseAllBalancesQuery) => { - const queryKey = ["allBalancesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allBalances(params); - }, - ...options - }); - }; - const useSpendableBalances = ({ - request, - options - }: UseSpendableBalancesQuery) => { - const queryKey = ["spendableBalancesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spendableBalances(params); - }, - ...options - }); - }; - const useSpendableBalanceByDenom = ({ - request, - options - }: UseSpendableBalanceByDenomQuery) => { - const queryKey = ["spendableBalanceByDenomQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.spendableBalanceByDenom(params); - }, - ...options - }); - }; - const useTotalSupply = ({ - request, - options - }: UseTotalSupplyQuery) => { - const queryKey = ["totalSupplyQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.totalSupply(params); - }, - ...options - }); - }; - const useSupplyOf = ({ - request, - options - }: UseSupplyOfQuery) => { - const queryKey = ["supplyOfQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.supplyOf(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useDenomMetadata = ({ - request, - options - }: UseDenomMetadataQuery) => { - const queryKey = ["denomMetadataQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomMetadata(params); - }, - ...options - }); - }; - const useDenomMetadataByQueryString = ({ - request, - options - }: UseDenomMetadataByQueryStringQuery) => { - const queryKey = ["denomMetadataByQueryStringQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomMetadataByQueryString(params); - }, - ...options - }); - }; - const useDenomsMetadata = ({ - request, - options - }: UseDenomsMetadataQuery) => { - const queryKey = ["denomsMetadataQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomsMetadata(params); - }, - ...options - }); - }; - const useDenomOwners = ({ - request, - options - }: UseDenomOwnersQuery) => { - const queryKey = ["denomOwnersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomOwners(params); - }, - ...options - }); - }; - const useDenomOwnersByQuery = ({ - request, - options - }: UseDenomOwnersByQueryQuery) => { - const queryKey = ["denomOwnersByQueryQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.denomOwnersByQuery(params); - }, - ...options - }); - }; - const useSendEnabled = ({ - request, - options - }: UseSendEnabledQuery) => { - const queryKey = ["sendEnabledQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.sendEnabled(params); - }, - ...options - }); - }; - return { - /** Balance queries the balance of a single coin for a single account. */useBalance, - /** - * 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. - */ - useAllBalances, - /** - * 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 - */ - useSpendableBalances, - /** - * 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 - */ - useSpendableBalanceByDenom, - /** - * 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. - */ - useTotalSupply, - /** - * 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. - */ - useSupplyOf, - /** Params queries the parameters of x/bank module. */useParams, - /** DenomMetadata queries the client metadata of a given coin denomination. */useDenomMetadata, - /** DenomMetadataByQueryString queries the client metadata of a given coin denomination. */useDenomMetadataByQueryString, - /** - * DenomsMetadata queries the client metadata for all registered coin - * denominations. - */ - useDenomsMetadata, - /** - * 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 - */ - useDenomOwners, - /** - * DenomOwnersByQuery queries for all account addresses that own a particular token - * denomination. - * - * Since: cosmos-sdk 0.50.3 - */ - useDenomOwnersByQuery, - /** - * 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 - */ - useSendEnabled - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..dc21baf8 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.func.ts @@ -0,0 +1,93 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; +export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceRequest.encode, + decode: QueryBalanceResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Balance", + clientResolver +}); +export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllBalancesRequest.encode, + decode: QueryAllBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "AllBalances", + clientResolver +}); +export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalancesRequest.encode, + decode: QuerySpendableBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalances", + clientResolver +}); +export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalanceByDenomRequest.encode, + decode: QuerySpendableBalanceByDenomResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalanceByDenom", + clientResolver +}); +export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTotalSupplyRequest.encode, + decode: QueryTotalSupplyResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "TotalSupply", + clientResolver +}); +export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySupplyOfRequest.encode, + decode: QuerySupplyOfResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SupplyOf", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataRequest.encode, + decode: QueryDenomMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadata", + clientResolver +}); +export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataByQueryStringRequest.encode, + decode: QueryDenomMetadataByQueryStringResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadataByQueryString", + clientResolver +}); +export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomsMetadataRequest.encode, + decode: QueryDenomsMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomsMetadata", + clientResolver +}); +export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersRequest.encode, + decode: QueryDenomOwnersResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwners", + clientResolver +}); +export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersByQueryRequest.encode, + decode: QueryDenomOwnersByQueryResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwnersByQuery", + clientResolver +}); +export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySendEnabledRequest.encode, + decode: QuerySendEnabledResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SendEnabled", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..fb0e2f44 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts @@ -0,0 +1,55 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +export const useGetBalance = buildUseVueQuery({ + builderQueryFn: createGetBalance, + queryKeyPrefix: "BalanceQuery" +}); +export const useGetAllBalances = buildUseVueQuery({ + builderQueryFn: createGetAllBalances, + queryKeyPrefix: "AllBalancesQuery" +}); +export const useGetSpendableBalances = buildUseVueQuery({ + builderQueryFn: createGetSpendableBalances, + queryKeyPrefix: "SpendableBalancesQuery" +}); +export const useGetSpendableBalanceByDenom = buildUseVueQuery({ + builderQueryFn: createGetSpendableBalanceByDenom, + queryKeyPrefix: "SpendableBalanceByDenomQuery" +}); +export const useGetTotalSupply = buildUseVueQuery({ + builderQueryFn: createGetTotalSupply, + queryKeyPrefix: "TotalSupplyQuery" +}); +export const useGetSupplyOf = buildUseVueQuery({ + builderQueryFn: createGetSupplyOf, + queryKeyPrefix: "SupplyOfQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDenomMetadata = buildUseVueQuery({ + builderQueryFn: createGetDenomMetadata, + queryKeyPrefix: "DenomMetadataQuery" +}); +export const useGetDenomMetadataByQueryString = buildUseVueQuery({ + builderQueryFn: createGetDenomMetadataByQueryString, + queryKeyPrefix: "DenomMetadataByQueryStringQuery" +}); +export const useGetDenomsMetadata = buildUseVueQuery({ + builderQueryFn: createGetDenomsMetadata, + queryKeyPrefix: "DenomsMetadataQuery" +}); +export const useGetDenomOwners = buildUseVueQuery({ + builderQueryFn: createGetDenomOwners, + queryKeyPrefix: "DenomOwnersQuery" +}); +export const useGetDenomOwnersByQuery = buildUseVueQuery({ + builderQueryFn: createGetDenomOwnersByQuery, + queryKeyPrefix: "DenomOwnersByQueryQuery" +}); +export const useGetSendEnabled = buildUseVueQuery({ + builderQueryFn: createGetSendEnabled, + queryKeyPrefix: "SendEnabledQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.ts index 5253c83a..45f3fa82 100644 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.ts @@ -4,7 +4,6 @@ import { Params, ParamsAmino, Metadata, MetadataAmino, SendEnabled, SendEnabledA import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { /** address is the address to query balances for. */ @@ -12,10 +11,6 @@ export interface QueryBalanceRequest { /** denom is the coin denom to query balances for. */ denom: string; } -export interface ReactiveQueryBalanceRequest { - address: ComputedRef; - denom: ComputedRef; -} export interface QueryBalanceRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest"; value: Uint8Array; @@ -36,9 +31,6 @@ export interface QueryBalanceResponse { /** balance is the balance of the coin. */ balance?: Coin; } -export interface ReactiveQueryBalanceResponse { - balance?: ComputedRef; -} export interface QueryBalanceResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; value: Uint8Array; @@ -65,11 +57,6 @@ export interface QueryAllBalancesRequest { */ resolveDenom: boolean; } -export interface ReactiveQueryAllBalancesRequest { - address: ComputedRef; - pagination?: ComputedRef; - resolveDenom: ComputedRef; -} export interface QueryAllBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest"; value: Uint8Array; @@ -101,10 +88,6 @@ export interface QueryAllBalancesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAllBalancesResponse { - balances: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; value: Uint8Array; @@ -135,10 +118,6 @@ export interface QuerySpendableBalancesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQuerySpendableBalancesRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySpendableBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; value: Uint8Array; @@ -171,10 +150,6 @@ export interface QuerySpendableBalancesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQuerySpendableBalancesResponse { - balances: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySpendableBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; value: Uint8Array; @@ -207,10 +182,6 @@ export interface QuerySpendableBalanceByDenomRequest { /** denom is the coin denom to query balances for. */ denom: string; } -export interface ReactiveQuerySpendableBalanceByDenomRequest { - address: ComputedRef; - denom: ComputedRef; -} export interface QuerySpendableBalanceByDenomRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest"; value: Uint8Array; @@ -241,9 +212,6 @@ export interface QuerySpendableBalanceByDenomResponse { /** balance is the balance of the coin. */ balance?: Coin; } -export interface ReactiveQuerySpendableBalanceByDenomResponse { - balance?: ComputedRef; -} export interface QuerySpendableBalanceByDenomResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse"; value: Uint8Array; @@ -274,9 +242,6 @@ export interface QueryTotalSupplyRequest { */ pagination?: PageRequest; } -export interface ReactiveQueryTotalSupplyRequest { - pagination?: ComputedRef; -} export interface QueryTotalSupplyRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; value: Uint8Array; @@ -311,10 +276,6 @@ export interface QueryTotalSupplyResponse { */ pagination?: PageResponse; } -export interface ReactiveQueryTotalSupplyResponse { - supply: ComputedRef; - pagination?: ComputedRef; -} export interface QueryTotalSupplyResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; value: Uint8Array; @@ -342,9 +303,6 @@ export interface QuerySupplyOfRequest { /** denom is the coin denom to query balances for. */ denom: string; } -export interface ReactiveQuerySupplyOfRequest { - denom: ComputedRef; -} export interface QuerySupplyOfRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest"; value: Uint8Array; @@ -363,9 +321,6 @@ export interface QuerySupplyOfResponse { /** amount is the supply of the coin. */ amount: Coin; } -export interface ReactiveQuerySupplyOfResponse { - amount: ComputedRef; -} export interface QuerySupplyOfResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse"; value: Uint8Array; @@ -381,7 +336,6 @@ export interface QuerySupplyOfResponseAminoMsg { } /** QueryParamsRequest defines the request type for querying x/bank parameters. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -397,9 +351,6 @@ export interface QueryParamsResponse { /** params provides the parameters of the bank module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -418,9 +369,6 @@ export interface QueryDenomsMetadataRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDenomsMetadataRequest { - pagination?: ComputedRef; -} export interface QueryDenomsMetadataRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; value: Uint8Array; @@ -444,10 +392,6 @@ export interface QueryDenomsMetadataResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDenomsMetadataResponse { - metadatas: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomsMetadataResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; value: Uint8Array; @@ -471,9 +415,6 @@ export interface QueryDenomMetadataRequest { /** denom is the coin denom to query the metadata for. */ denom: string; } -export interface ReactiveQueryDenomMetadataRequest { - denom: ComputedRef; -} export interface QueryDenomMetadataRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest"; value: Uint8Array; @@ -495,9 +436,6 @@ export interface QueryDenomMetadataResponse { /** metadata describes and provides all the client information for the requested token. */ metadata: Metadata; } -export interface ReactiveQueryDenomMetadataResponse { - metadata: ComputedRef; -} export interface QueryDenomMetadataResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse"; value: Uint8Array; @@ -522,9 +460,6 @@ export interface QueryDenomMetadataByQueryStringRequest { /** denom is the coin denom to query the metadata for. */ denom: string; } -export interface ReactiveQueryDenomMetadataByQueryStringRequest { - denom: ComputedRef; -} export interface QueryDenomMetadataByQueryStringRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest"; value: Uint8Array; @@ -549,9 +484,6 @@ export interface QueryDenomMetadataByQueryStringResponse { /** metadata describes and provides all the client information for the requested token. */ metadata: Metadata; } -export interface ReactiveQueryDenomMetadataByQueryStringResponse { - metadata: ComputedRef; -} export interface QueryDenomMetadataByQueryStringResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse"; value: Uint8Array; @@ -579,10 +511,6 @@ export interface QueryDenomOwnersRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDenomOwnersRequest { - denom: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest"; value: Uint8Array; @@ -615,10 +543,6 @@ export interface DenomOwner { /** balance is the balance of the denominated coin for an account. */ balance: Coin; } -export interface ReactiveDenomOwner { - address: ComputedRef; - balance: ComputedRef; -} export interface DenomOwnerProtoMsg { typeUrl: "/cosmos.bank.v1beta1.DenomOwner"; value: Uint8Array; @@ -650,10 +574,6 @@ export interface QueryDenomOwnersResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDenomOwnersResponse { - denomOwners: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse"; value: Uint8Array; @@ -685,10 +605,6 @@ export interface QueryDenomOwnersByQueryRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDenomOwnersByQueryRequest { - denom: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersByQueryRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest"; value: Uint8Array; @@ -720,10 +636,6 @@ export interface QueryDenomOwnersByQueryResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDenomOwnersByQueryResponse { - denomOwners: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDenomOwnersByQueryResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse"; value: Uint8Array; @@ -756,10 +668,6 @@ export interface QuerySendEnabledRequest { */ pagination?: PageRequest; } -export interface ReactiveQuerySendEnabledRequest { - denoms: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySendEnabledRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest"; value: Uint8Array; @@ -795,10 +703,6 @@ export interface QuerySendEnabledResponse { */ pagination?: PageResponse; } -export interface ReactiveQuerySendEnabledResponse { - sendEnabled: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySendEnabledResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.amino.ts deleted file mode 100644 index f146051f..00000000 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.amino.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; -export const AminoConverter = { - "/cosmos.bank.v1beta1.MsgSend": { - aminoType: "cosmos-sdk/MsgSend", - toAmino: MsgSend.toAmino, - fromAmino: MsgSend.fromAmino - }, - "/cosmos.bank.v1beta1.MsgMultiSend": { - aminoType: "cosmos-sdk/MsgMultiSend", - toAmino: MsgMultiSend.toAmino, - fromAmino: MsgMultiSend.fromAmino - }, - "/cosmos.bank.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmos.bank.v1beta1.MsgSetSendEnabled": { - aminoType: "cosmos-sdk/MsgSetSendEnabled", - toAmino: MsgSetSendEnabled.toAmino, - fromAmino: MsgSetSendEnabled.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..fa81e316 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSend.typeUrl, + encoders: toEncoders(MsgSend), + converters: toConverters(MsgSend) +}); +export const createMultiSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMultiSend.typeUrl, + encoders: toEncoders(MsgMultiSend), + converters: toConverters(MsgMultiSend) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createSetSendEnabled = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetSendEnabled.typeUrl, + encoders: toEncoders(MsgSetSendEnabled), + converters: toConverters(MsgSetSendEnabled) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 46f85b3d..00000000 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSetSendEnabled, MsgSetSendEnabledResponse } from "./tx"; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** Send defines a method for sending coins from one account to another account. */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Send defines a method for sending coins from one account to another account. */ - send = async (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 BinaryReader(data))); - }; - /* MultiSend defines a method for sending coins from some accounts to other accounts. */ - multiSend = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..654e3c48 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +export const useSend = buildUseVueMutation({ + builderMutationFn: createSend +}); +export const useMultiSend = buildUseVueMutation({ + builderMutationFn: createMultiSend +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useSetSendEnabled = buildUseVueMutation({ + builderMutationFn: createSetSendEnabled +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.ts index dd89a158..afc67365 100644 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.ts @@ -3,18 +3,12 @@ import { Input, InputAmino, Output, OutputAmino, Params, ParamsAmino, SendEnable import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { fromAddress: string; toAddress: string; amount: Coin[]; } -export interface ReactiveMsgSend { - fromAddress: ComputedRef; - toAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgSendProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSend"; value: Uint8Array; @@ -31,7 +25,6 @@ export interface MsgSendAminoMsg { } /** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponse {} -export interface ReactiveMsgSendResponse {} export interface MsgSendResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse"; value: Uint8Array; @@ -51,10 +44,6 @@ export interface MsgMultiSend { inputs: Input[]; outputs: Output[]; } -export interface ReactiveMsgMultiSend { - inputs: ComputedRef; - outputs: ComputedRef; -} export interface MsgMultiSendProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend"; value: Uint8Array; @@ -74,7 +63,6 @@ export interface MsgMultiSendAminoMsg { } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ export interface MsgMultiSendResponse {} -export interface ReactiveMsgMultiSendResponse {} export interface MsgMultiSendResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse"; value: Uint8Array; @@ -100,10 +88,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -134,7 +118,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -172,11 +155,6 @@ export interface MsgSetSendEnabled { */ useDefaultFor: string[]; } -export interface ReactiveMsgSetSendEnabled { - authority: ComputedRef; - sendEnabled: ComputedRef; - useDefaultFor: ComputedRef; -} export interface MsgSetSendEnabledProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled"; value: Uint8Array; @@ -213,7 +191,6 @@ export interface MsgSetSendEnabledAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgSetSendEnabledResponse {} -export interface ReactiveMsgSetSendEnabledResponse {} export interface MsgSetSendEnabledResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/abci/v1beta1/abci.ts b/libs/interchain-vue/src/cosmos/base/abci/v1beta1/abci.ts index 4477c71f..2a000dfb 100644 --- a/libs/interchain-vue/src/cosmos/base/abci/v1beta1/abci.ts +++ b/libs/interchain-vue/src/cosmos/base/abci/v1beta1/abci.ts @@ -4,7 +4,6 @@ import { Block, BlockAmino } from "../../../../tendermint/types/block"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * TxResponse defines a structure containing relevant tx data and metadata. The * tags are stringified and the log is JSON decoded. @@ -51,21 +50,6 @@ export interface TxResponse { */ events: Event[]; } -export interface ReactiveTxResponse { - height: ComputedRef; - txhash: ComputedRef; - codespace: ComputedRef; - code: ComputedRef; - data: ComputedRef; - rawLog: ComputedRef; - logs: ComputedRef; - info: ComputedRef; - gasWanted: ComputedRef; - gasUsed: ComputedRef; - tx?: ComputedRef; - timestamp: ComputedRef; - events: ComputedRef; -} export interface TxResponseProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.TxResponse"; value: Uint8Array; @@ -130,11 +114,6 @@ export interface ABCIMessageLog { */ events: StringEvent[]; } -export interface ReactiveABCIMessageLog { - msgIndex: ComputedRef; - log: ComputedRef; - events: ComputedRef; -} export interface ABCIMessageLogProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog"; value: Uint8Array; @@ -161,10 +140,6 @@ export interface StringEvent { type: string; attributes: Attribute[]; } -export interface ReactiveStringEvent { - type: ComputedRef; - attributes: ComputedRef; -} export interface StringEventProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.StringEvent"; value: Uint8Array; @@ -189,10 +164,6 @@ export interface Attribute { key: string; value: string; } -export interface ReactiveAttribute { - key: ComputedRef; - value: ComputedRef; -} export interface AttributeProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.Attribute"; value: Uint8Array; @@ -216,10 +187,6 @@ export interface GasInfo { /** GasUsed is the amount of gas actually consumed. */ gasUsed: bigint; } -export interface ReactiveGasInfo { - gasWanted: ComputedRef; - gasUsed: ComputedRef; -} export interface GasInfoProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.GasInfo"; value: Uint8Array; @@ -259,12 +226,6 @@ export interface Result { */ msgResponses: Any[]; } -export interface ReactiveResult { - data: ComputedRef; - log: ComputedRef; - events: ComputedRef; - msgResponses: ComputedRef; -} export interface ResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.Result"; value: Uint8Array; @@ -305,10 +266,6 @@ export interface SimulationResponse { gasInfo: GasInfo; result?: Result; } -export interface ReactiveSimulationResponse { - gasInfo: ComputedRef; - result?: ComputedRef; -} export interface SimulationResponseProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; value: Uint8Array; @@ -334,10 +291,6 @@ export interface MsgData { msgType: string; data: Uint8Array; } -export interface ReactiveMsgData { - msgType: ComputedRef; - data: ComputedRef; -} export interface MsgDataProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.MsgData"; value: Uint8Array; @@ -370,10 +323,6 @@ export interface TxMsgData { */ msgResponses: Any[]; } -export interface ReactiveTxMsgData { - data: ComputedRef; - msgResponses: ComputedRef; -} export interface TxMsgDataProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData"; value: Uint8Array; @@ -412,14 +361,6 @@ export interface SearchTxsResult { /** List of txs in current page */ txs: TxResponse[]; } -export interface ReactiveSearchTxsResult { - totalCount: ComputedRef; - count: ComputedRef; - pageNumber: ComputedRef; - pageTotal: ComputedRef; - limit: ComputedRef; - txs: ComputedRef; -} export interface SearchTxsResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult"; value: Uint8Array; @@ -458,14 +399,6 @@ export interface SearchBlocksResult { /** List of blocks in current page */ blocks: Block[]; } -export interface ReactiveSearchBlocksResult { - totalCount: ComputedRef; - count: ComputedRef; - pageNumber: ComputedRef; - pageTotal: ComputedRef; - limit: ComputedRef; - blocks: ComputedRef; -} export interface SearchBlocksResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SearchBlocksResult"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.Service.ts b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.Service.ts deleted file mode 100644 index 09363cb2..00000000 --- a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.Service.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { QueryRequest, QueryResponse, ListQueryHandlersRequest, ListQueryHandlersResponse } from "./service"; -/** Service defines the gRPC service for query server for v2 */ -export interface Service { - /** Query queries the server with a request, the request can be any sdk Msg. */ - query(request: QueryRequest): Promise; - /** ListQueryHandlers lists all the available query handlers. */ - listQueryHandlers(request?: ListQueryHandlersRequest): Promise; -} -export class ServiceClientImpl implements Service { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Query queries the server with a request, the request can be any sdk Msg. */ - query = async (request: QueryRequest): Promise => { - const data = QueryRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.grpc.v2.Service", "Query", data); - return promise.then(data => QueryResponse.decode(new BinaryReader(data))); - }; - /* ListQueryHandlers lists all the available query handlers. */ - listQueryHandlers = async (request: ListQueryHandlersRequest = {}): Promise => { - const data = ListQueryHandlersRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.grpc.v2.Service", "ListQueryHandlers", data); - return promise.then(data => ListQueryHandlersResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new ServiceClientImpl(rpc); - return { - query(request: QueryRequest): Promise { - return queryService.query(request); - }, - listQueryHandlers(request?: ListQueryHandlersRequest): Promise { - return queryService.listQueryHandlers(request); - } - }; -}; -export interface UseQueryQuery extends VueQueryParams { - request: ReactiveQueryRequest; -} -export interface UseListQueryHandlersQuery extends VueQueryParams { - request?: ReactiveListQueryHandlersRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new ServiceClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useQuery = ({ - request, - options - }: UseQueryQuery) => { - const queryKey = ["queryQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.query(params); - }, - ...options - }); - }; - const useListQueryHandlers = ({ - request, - options - }: UseListQueryHandlersQuery) => { - const queryKey = ["listQueryHandlersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.listQueryHandlers(params); - }, - ...options - }); - }; - return { - /** Query queries the server with a request, the request can be any sdk Msg. */useQuery, - /** ListQueryHandlers lists all the available query handlers. */useListQueryHandlers - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.func.ts b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.func.ts new file mode 100644 index 00000000..474c83ce --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.func.ts @@ -0,0 +1,16 @@ +import { RpcResolver, buildQuery } from "../../../../helper-func-types"; +import { QueryRequest, QueryResponse, ListQueryHandlersRequest, ListQueryHandlersResponse } from "./service"; +export const createGetQuery = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRequest.encode, + decode: QueryResponse.decode, + service: "cosmos.base.grpc.v2.Service", + method: "Query", + clientResolver +}); +export const createGetListQueryHandlers = (clientResolver?: RpcResolver) => buildQuery({ + encode: ListQueryHandlersRequest.encode, + decode: ListQueryHandlersResponse.decode, + service: "cosmos.base.grpc.v2.Service", + method: "ListQueryHandlers", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts new file mode 100644 index 00000000..520677c3 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts @@ -0,0 +1,11 @@ +import { buildUseVueQuery } from "../../../../vue-query"; +import { QueryRequest, QueryResponse, ListQueryHandlersRequest, ListQueryHandlersResponse } from "./service"; +import { createGetQuery, createGetListQueryHandlers } from "./service.rpc.func.ts"; +export const useGetQuery = buildUseVueQuery({ + builderQueryFn: createGetQuery, + queryKeyPrefix: "QueryQuery" +}); +export const useGetListQueryHandlers = buildUseVueQuery({ + builderQueryFn: createGetListQueryHandlers, + queryKeyPrefix: "ListQueryHandlersQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.ts b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.ts index 0e0d95b4..04b93230 100644 --- a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.ts +++ b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.ts @@ -2,14 +2,10 @@ import { Any, AnyAmino } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** QueryRequest is the request for the Query method */ export interface QueryRequest { request?: Any; } -export interface ReactiveQueryRequest { - request?: ComputedRef; -} export interface QueryRequestProtoMsg { typeUrl: "/cosmos.base.grpc.v2.QueryRequest"; value: Uint8Array; @@ -26,9 +22,6 @@ export interface QueryRequestAminoMsg { export interface QueryResponse { response?: Any; } -export interface ReactiveQueryResponse { - response?: ComputedRef; -} export interface QueryResponseProtoMsg { typeUrl: "/cosmos.base.grpc.v2.QueryResponse"; value: Uint8Array; @@ -43,7 +36,6 @@ export interface QueryResponseAminoMsg { } /** ListQueryHandlersRequest is the request for the ListQueryHandlers method */ export interface ListQueryHandlersRequest {} -export interface ReactiveListQueryHandlersRequest {} export interface ListQueryHandlersRequestProtoMsg { typeUrl: "/cosmos.base.grpc.v2.ListQueryHandlersRequest"; value: Uint8Array; @@ -58,9 +50,6 @@ export interface ListQueryHandlersRequestAminoMsg { export interface ListQueryHandlersResponse { handlers: Handler[]; } -export interface ReactiveListQueryHandlersResponse { - handlers: ComputedRef; -} export interface ListQueryHandlersResponseProtoMsg { typeUrl: "/cosmos.base.grpc.v2.ListQueryHandlersResponse"; value: Uint8Array; @@ -78,10 +67,6 @@ export interface Handler { requestName: string; responseName: string; } -export interface ReactiveHandler { - requestName: ComputedRef; - responseName: ComputedRef; -} export interface HandlerProtoMsg { typeUrl: "/cosmos.base.grpc.v2.Handler"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.Service.ts b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.Service.ts deleted file mode 100644 index 84069b7b..00000000 --- a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.Service.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; -/** Service defines the gRPC querier service for node related queries. */ -export interface Service { - /** Config queries for the operator configuration. */ - config(request?: ConfigRequest): Promise; - /** Status queries for the node status. */ - status(request?: StatusRequest): Promise; -} -export class ServiceClientImpl implements Service { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Config queries for the operator configuration. */ - config = async (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 BinaryReader(data))); - }; - /* Status queries for the node status. */ - status = async (request: StatusRequest = {}): Promise => { - const data = StatusRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Status", data); - return promise.then(data => StatusResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new ServiceClientImpl(rpc); - return { - config(request?: ConfigRequest): Promise { - return queryService.config(request); - }, - status(request?: StatusRequest): Promise { - return queryService.status(request); - } - }; -}; -export interface UseConfigQuery extends VueQueryParams { - request?: ReactiveConfigRequest; -} -export interface UseStatusQuery extends VueQueryParams { - request?: ReactiveStatusRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new ServiceClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useConfig = ({ - request, - options - }: UseConfigQuery) => { - const queryKey = ["configQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.config(params); - }, - ...options - }); - }; - const useStatus = ({ - request, - options - }: UseStatusQuery) => { - const queryKey = ["statusQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.status(params); - }, - ...options - }); - }; - return { - /** Config queries for the operator configuration. */useConfig, - /** Status queries for the node status. */useStatus - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..13b4a540 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.func.ts @@ -0,0 +1,16 @@ +import { RpcResolver, buildQuery } from "../../../../helper-func-types"; +import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; +export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: ConfigRequest.encode, + decode: ConfigResponse.decode, + service: "cosmos.base.node.v1beta1.Service", + method: "Config", + clientResolver +}); +export const createGetStatus = (clientResolver?: RpcResolver) => buildQuery({ + encode: StatusRequest.encode, + decode: StatusResponse.decode, + service: "cosmos.base.node.v1beta1.Service", + method: "Status", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..a8b14c30 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts @@ -0,0 +1,11 @@ +import { buildUseVueQuery } from "../../../../vue-query"; +import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; +import { createGetConfig, createGetStatus } from "./query.rpc.func.ts"; +export const useGetConfig = buildUseVueQuery({ + builderQueryFn: createGetConfig, + queryKeyPrefix: "ConfigQuery" +}); +export const useGetStatus = buildUseVueQuery({ + builderQueryFn: createGetStatus, + queryKeyPrefix: "StatusQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.ts index 409a5d51..f578eb6e 100644 --- a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.ts @@ -2,10 +2,8 @@ import { Timestamp } from "../../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** ConfigRequest defines the request structure for the Config gRPC query. */ export interface ConfigRequest {} -export interface ReactiveConfigRequest {} export interface ConfigRequestProtoMsg { typeUrl: "/cosmos.base.node.v1beta1.ConfigRequest"; value: Uint8Array; @@ -23,12 +21,6 @@ export interface ConfigResponse { pruningInterval: string; haltHeight: bigint; } -export interface ReactiveConfigResponse { - minimumGasPrice: ComputedRef; - pruningKeepRecent: ComputedRef; - pruningInterval: ComputedRef; - haltHeight: ComputedRef; -} export interface ConfigResponseProtoMsg { typeUrl: "/cosmos.base.node.v1beta1.ConfigResponse"; value: Uint8Array; @@ -46,7 +38,6 @@ export interface ConfigResponseAminoMsg { } /** StateRequest defines the request structure for the status of a node. */ export interface StatusRequest {} -export interface ReactiveStatusRequest {} export interface StatusRequestProtoMsg { typeUrl: "/cosmos.base.node.v1beta1.StatusRequest"; value: Uint8Array; @@ -70,13 +61,6 @@ export interface StatusResponse { /** validator hash provided by the consensus header */ validatorHash: Uint8Array; } -export interface ReactiveStatusResponse { - earliestStoreHeight: ComputedRef; - height: ComputedRef; - timestamp?: ComputedRef; - appHash: ComputedRef; - validatorHash: ComputedRef; -} export interface StatusResponseProtoMsg { typeUrl: "/cosmos.base.node.v1beta1.StatusResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.Service.ts b/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.Service.ts deleted file mode 100644 index f544aa7c..00000000 --- a/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.Service.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { ConfigRequest, ConfigResponse } from "./query"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Config queries for the operator configuration. */ - config = async (request: ConfigRequest = {}): Promise => { - const data = ConfigRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.node.v2.Service", "Config", data); - return promise.then(data => ConfigResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new ServiceClientImpl(rpc); - return { - config(request?: ConfigRequest): Promise { - return queryService.config(request); - } - }; -}; -export interface UseConfigQuery extends VueQueryParams { - request?: ReactiveConfigRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new ServiceClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useConfig = ({ - request, - options - }: UseConfigQuery) => { - const queryKey = ["configQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.config(params); - }, - ...options - }); - }; - return { - /** Config queries for the operator configuration. */useConfig - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.func.ts new file mode 100644 index 00000000..7ec0d670 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.func.ts @@ -0,0 +1,9 @@ +import { RpcResolver, buildQuery } from "../../../../helper-func-types"; +import { ConfigRequest, ConfigResponse } from "./query"; +export const createGetConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: ConfigRequest.encode, + decode: ConfigResponse.decode, + service: "cosmos.base.node.v2.Service", + method: "Config", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts new file mode 100644 index 00000000..c019de62 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts @@ -0,0 +1,7 @@ +import { buildUseVueQuery } from "../../../../vue-query"; +import { ConfigRequest, ConfigResponse } from "./query"; +import { createGetConfig } from "./query.rpc.func.ts"; +export const useGetConfig = buildUseVueQuery({ + builderQueryFn: createGetConfig, + queryKeyPrefix: "ConfigQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/node/v2/query.ts b/libs/interchain-vue/src/cosmos/base/node/v2/query.ts index 75fe34d4..f4568aa3 100644 --- a/libs/interchain-vue/src/cosmos/base/node/v2/query.ts +++ b/libs/interchain-vue/src/cosmos/base/node/v2/query.ts @@ -1,10 +1,8 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** ConfigRequest defines the request structure for the Config gRPC query. */ export interface ConfigRequest {} -export interface ReactiveConfigRequest {} export interface ConfigRequestProtoMsg { typeUrl: "/cosmos.base.node.v2.ConfigRequest"; value: Uint8Array; @@ -19,9 +17,6 @@ export interface ConfigRequestAminoMsg { export interface ConfigResponse { minimumGasPrice: string; } -export interface ReactiveConfigResponse { - minimumGasPrice: ComputedRef; -} export interface ConfigResponseProtoMsg { typeUrl: "/cosmos.base.node.v2.ConfigResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/query/v1beta1/pagination.ts b/libs/interchain-vue/src/cosmos/base/query/v1beta1/pagination.ts index 4d084237..35272ec2 100644 --- a/libs/interchain-vue/src/cosmos/base/query/v1beta1/pagination.ts +++ b/libs/interchain-vue/src/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * PageRequest is to be embedded in gRPC request messages for efficient * pagination. Ex: @@ -43,13 +42,6 @@ export interface PageRequest { */ reverse: boolean; } -export interface ReactivePageRequest { - key: ComputedRef; - offset: ComputedRef; - limit: ComputedRef; - countTotal: ComputedRef; - reverse: ComputedRef; -} export interface PageRequestProtoMsg { typeUrl: "/cosmos.base.query.v1beta1.PageRequest"; value: Uint8Array; @@ -121,10 +113,6 @@ export interface PageResponse { */ total: bigint; } -export interface ReactivePageResponse { - nextKey: ComputedRef; - total: ComputedRef; -} export interface PageResponseProtoMsg { typeUrl: "/cosmos.base.query.v1beta1.PageResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts new file mode 100644 index 00000000..ed6199cd --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts @@ -0,0 +1,16 @@ +import { RpcResolver, buildQuery } from "../../../../helper-func-types"; +import { ListAllInterfacesRequest, ListAllInterfacesResponse, ListImplementationsRequest, ListImplementationsResponse } from "./reflection"; +export const createGetListAllInterfaces = (clientResolver?: RpcResolver) => buildQuery({ + encode: ListAllInterfacesRequest.encode, + decode: ListAllInterfacesResponse.decode, + service: "cosmos.base.reflection.v1beta1.ReflectionService", + method: "ListAllInterfaces", + clientResolver +}); +export const createGetListImplementations = (clientResolver?: RpcResolver) => buildQuery({ + encode: ListImplementationsRequest.encode, + decode: ListImplementationsResponse.decode, + service: "cosmos.base.reflection.v1beta1.ReflectionService", + method: "ListImplementations", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts new file mode 100644 index 00000000..377fdb31 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts @@ -0,0 +1,11 @@ +import { buildUseVueQuery } from "../../../../vue-query"; +import { ListAllInterfacesRequest, ListAllInterfacesResponse, ListImplementationsRequest, ListImplementationsResponse } from "./reflection"; +import { createGetListAllInterfaces, createGetListImplementations } from "./reflection.rpc.func.ts"; +export const useGetListAllInterfaces = buildUseVueQuery({ + builderQueryFn: createGetListAllInterfaces, + queryKeyPrefix: "ListAllInterfacesQuery" +}); +export const useGetListImplementations = buildUseVueQuery({ + builderQueryFn: createGetListImplementations, + queryKeyPrefix: "ListImplementationsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.ts b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.ts index 2179a6f4..302e24ec 100644 --- a/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.ts +++ b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.ts @@ -1,10 +1,8 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ export interface ListAllInterfacesRequest {} -export interface ReactiveListAllInterfacesRequest {} export interface ListAllInterfacesRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest"; value: Uint8Array; @@ -20,9 +18,6 @@ export interface ListAllInterfacesResponse { /** interface_names is an array of all the registered interfaces. */ interfaceNames: string[]; } -export interface ReactiveListAllInterfacesResponse { - interfaceNames: ComputedRef; -} export interface ListAllInterfacesResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse"; value: Uint8Array; @@ -44,9 +39,6 @@ export interface ListImplementationsRequest { /** interface_name defines the interface to query the implementations for. */ interfaceName: string; } -export interface ReactiveListImplementationsRequest { - interfaceName: ComputedRef; -} export interface ListImplementationsRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsRequest"; value: Uint8Array; @@ -70,9 +62,6 @@ export interface ListImplementationsRequestAminoMsg { export interface ListImplementationsResponse { implementationMessageNames: string[]; } -export interface ReactiveListImplementationsResponse { - implementationMessageNames: ComputedRef; -} export interface ListImplementationsResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts new file mode 100644 index 00000000..4f975b5e --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts @@ -0,0 +1,44 @@ +import { RpcResolver, buildQuery } from "../../../../helper-func-types"; +import { GetAuthnDescriptorRequest, GetAuthnDescriptorResponse, GetChainDescriptorRequest, GetChainDescriptorResponse, GetCodecDescriptorRequest, GetCodecDescriptorResponse, GetConfigurationDescriptorRequest, GetConfigurationDescriptorResponse, GetQueryServicesDescriptorRequest, GetQueryServicesDescriptorResponse, GetTxDescriptorRequest, GetTxDescriptorResponse } from "./reflection"; +export const createGetGetAuthnDescriptor = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetAuthnDescriptorRequest.encode, + decode: GetAuthnDescriptorResponse.decode, + service: "cosmos.base.reflection.v2alpha1.ReflectionService", + method: "GetAuthnDescriptor", + clientResolver +}); +export const createGetGetChainDescriptor = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetChainDescriptorRequest.encode, + decode: GetChainDescriptorResponse.decode, + service: "cosmos.base.reflection.v2alpha1.ReflectionService", + method: "GetChainDescriptor", + clientResolver +}); +export const createGetGetCodecDescriptor = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetCodecDescriptorRequest.encode, + decode: GetCodecDescriptorResponse.decode, + service: "cosmos.base.reflection.v2alpha1.ReflectionService", + method: "GetCodecDescriptor", + clientResolver +}); +export const createGetGetConfigurationDescriptor = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetConfigurationDescriptorRequest.encode, + decode: GetConfigurationDescriptorResponse.decode, + service: "cosmos.base.reflection.v2alpha1.ReflectionService", + method: "GetConfigurationDescriptor", + clientResolver +}); +export const createGetGetQueryServicesDescriptor = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetQueryServicesDescriptorRequest.encode, + decode: GetQueryServicesDescriptorResponse.decode, + service: "cosmos.base.reflection.v2alpha1.ReflectionService", + method: "GetQueryServicesDescriptor", + clientResolver +}); +export const createGetGetTxDescriptor = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxDescriptorRequest.encode, + decode: GetTxDescriptorResponse.decode, + service: "cosmos.base.reflection.v2alpha1.ReflectionService", + method: "GetTxDescriptor", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts new file mode 100644 index 00000000..342d01a6 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts @@ -0,0 +1,27 @@ +import { buildUseVueQuery } from "../../../../vue-query"; +import { GetAuthnDescriptorRequest, GetAuthnDescriptorResponse, GetChainDescriptorRequest, GetChainDescriptorResponse, GetCodecDescriptorRequest, GetCodecDescriptorResponse, GetConfigurationDescriptorRequest, GetConfigurationDescriptorResponse, GetQueryServicesDescriptorRequest, GetQueryServicesDescriptorResponse, GetTxDescriptorRequest, GetTxDescriptorResponse } from "./reflection"; +import { createGetGetAuthnDescriptor, createGetGetChainDescriptor, createGetGetCodecDescriptor, createGetGetConfigurationDescriptor, createGetGetQueryServicesDescriptor, createGetGetTxDescriptor } from "./reflection.rpc.func.ts"; +export const useGetGetAuthnDescriptor = buildUseVueQuery({ + builderQueryFn: createGetGetAuthnDescriptor, + queryKeyPrefix: "GetAuthnDescriptorQuery" +}); +export const useGetGetChainDescriptor = buildUseVueQuery({ + builderQueryFn: createGetGetChainDescriptor, + queryKeyPrefix: "GetChainDescriptorQuery" +}); +export const useGetGetCodecDescriptor = buildUseVueQuery({ + builderQueryFn: createGetGetCodecDescriptor, + queryKeyPrefix: "GetCodecDescriptorQuery" +}); +export const useGetGetConfigurationDescriptor = buildUseVueQuery({ + builderQueryFn: createGetGetConfigurationDescriptor, + queryKeyPrefix: "GetConfigurationDescriptorQuery" +}); +export const useGetGetQueryServicesDescriptor = buildUseVueQuery({ + builderQueryFn: createGetGetQueryServicesDescriptor, + queryKeyPrefix: "GetQueryServicesDescriptorQuery" +}); +export const useGetGetTxDescriptor = buildUseVueQuery({ + builderQueryFn: createGetGetTxDescriptor, + queryKeyPrefix: "GetTxDescriptorQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.ts b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.ts index 23d146e6..1373cb50 100644 --- a/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.ts +++ b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** AppDescriptor describes a cosmos-sdk based application */ export interface AppDescriptor { /** @@ -20,14 +19,6 @@ export interface AppDescriptor { /** tx provides metadata information regarding how to send transactions to the given application */ tx?: TxDescriptor; } -export interface ReactiveAppDescriptor { - authn?: ComputedRef; - chain?: ComputedRef; - codec?: ComputedRef; - configuration?: ComputedRef; - queryServices?: ComputedRef; - tx?: ComputedRef; -} export interface AppDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor"; value: Uint8Array; @@ -65,10 +56,6 @@ export interface TxDescriptor { /** msgs lists the accepted application messages (sdk.Msg) */ msgs: MsgDescriptor[]; } -export interface ReactiveTxDescriptor { - fullname: ComputedRef; - msgs: ComputedRef; -} export interface TxDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.TxDescriptor"; value: Uint8Array; @@ -96,9 +83,6 @@ export interface AuthnDescriptor { /** sign_modes defines the supported signature algorithm */ signModes: SigningModeDescriptor[]; } -export interface ReactiveAuthnDescriptor { - signModes: ComputedRef; -} export interface AuthnDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.AuthnDescriptor"; value: Uint8Array; @@ -132,11 +116,6 @@ export interface SigningModeDescriptor { */ authnInfoProviderMethodFullname: string; } -export interface ReactiveSigningModeDescriptor { - name: ComputedRef; - number: ComputedRef; - authnInfoProviderMethodFullname: ComputedRef; -} export interface SigningModeDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor"; value: Uint8Array; @@ -167,9 +146,6 @@ export interface ChainDescriptor { /** id is the chain id */ id: string; } -export interface ReactiveChainDescriptor { - id: ComputedRef; -} export interface ChainDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.ChainDescriptor"; value: Uint8Array; @@ -188,9 +164,6 @@ export interface CodecDescriptor { /** interfaces is a list of the registerted interfaces descriptors */ interfaces: InterfaceDescriptor[]; } -export interface ReactiveCodecDescriptor { - interfaces: ComputedRef; -} export interface CodecDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.CodecDescriptor"; value: Uint8Array; @@ -216,11 +189,6 @@ export interface InterfaceDescriptor { /** interface_implementers is a list of the descriptors of the interface implementers */ interfaceImplementers: InterfaceImplementerDescriptor[]; } -export interface ReactiveInterfaceDescriptor { - fullname: ComputedRef; - interfaceAcceptingMessages: ComputedRef; - interfaceImplementers: ComputedRef; -} export interface InterfaceDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor"; value: Uint8Array; @@ -253,10 +221,6 @@ export interface InterfaceImplementerDescriptor { */ typeUrl: string; } -export interface ReactiveInterfaceImplementerDescriptor { - fullname: ComputedRef; - typeUrl: ComputedRef; -} export interface InterfaceImplementerDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor"; value: Uint8Array; @@ -291,10 +255,6 @@ export interface InterfaceAcceptingMessageDescriptor { */ fieldDescriptorNames: string[]; } -export interface ReactiveInterfaceAcceptingMessageDescriptor { - fullname: ComputedRef; - fieldDescriptorNames: ComputedRef; -} export interface InterfaceAcceptingMessageDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor"; value: Uint8Array; @@ -322,9 +282,6 @@ export interface ConfigurationDescriptor { /** bech32_account_address_prefix is the account address prefix */ bech32AccountAddressPrefix: string; } -export interface ReactiveConfigurationDescriptor { - bech32AccountAddressPrefix: ComputedRef; -} export interface ConfigurationDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor"; value: Uint8Array; @@ -343,9 +300,6 @@ export interface MsgDescriptor { /** msg_type_url contains the TypeURL of a sdk.Msg. */ msgTypeUrl: string; } -export interface ReactiveMsgDescriptor { - msgTypeUrl: ComputedRef; -} export interface MsgDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.MsgDescriptor"; value: Uint8Array; @@ -361,7 +315,6 @@ export interface MsgDescriptorAminoMsg { } /** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorRequest {} -export interface ReactiveGetAuthnDescriptorRequest {} export interface GetAuthnDescriptorRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest"; value: Uint8Array; @@ -377,9 +330,6 @@ export interface GetAuthnDescriptorResponse { /** authn describes how to authenticate to the application when sending transactions */ authn?: AuthnDescriptor; } -export interface ReactiveGetAuthnDescriptorResponse { - authn?: ComputedRef; -} export interface GetAuthnDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse"; value: Uint8Array; @@ -395,7 +345,6 @@ export interface GetAuthnDescriptorResponseAminoMsg { } /** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ export interface GetChainDescriptorRequest {} -export interface ReactiveGetChainDescriptorRequest {} export interface GetChainDescriptorRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest"; value: Uint8Array; @@ -411,9 +360,6 @@ export interface GetChainDescriptorResponse { /** chain describes application chain information */ chain?: ChainDescriptor; } -export interface ReactiveGetChainDescriptorResponse { - chain?: ComputedRef; -} export interface GetChainDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse"; value: Uint8Array; @@ -429,7 +375,6 @@ export interface GetChainDescriptorResponseAminoMsg { } /** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ export interface GetCodecDescriptorRequest {} -export interface ReactiveGetCodecDescriptorRequest {} export interface GetCodecDescriptorRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest"; value: Uint8Array; @@ -445,9 +390,6 @@ export interface GetCodecDescriptorResponse { /** codec describes the application codec such as registered interfaces and implementations */ codec?: CodecDescriptor; } -export interface ReactiveGetCodecDescriptorResponse { - codec?: ComputedRef; -} export interface GetCodecDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse"; value: Uint8Array; @@ -463,7 +405,6 @@ export interface GetCodecDescriptorResponseAminoMsg { } /** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorRequest {} -export interface ReactiveGetConfigurationDescriptorRequest {} export interface GetConfigurationDescriptorRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest"; value: Uint8Array; @@ -479,9 +420,6 @@ export interface GetConfigurationDescriptorResponse { /** config describes the application's sdk.Config */ config?: ConfigurationDescriptor; } -export interface ReactiveGetConfigurationDescriptorResponse { - config?: ComputedRef; -} export interface GetConfigurationDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse"; value: Uint8Array; @@ -497,7 +435,6 @@ export interface GetConfigurationDescriptorResponseAminoMsg { } /** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorRequest {} -export interface ReactiveGetQueryServicesDescriptorRequest {} export interface GetQueryServicesDescriptorRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest"; value: Uint8Array; @@ -513,9 +450,6 @@ export interface GetQueryServicesDescriptorResponse { /** queries provides information on the available queryable services */ queries?: QueryServicesDescriptor; } -export interface ReactiveGetQueryServicesDescriptorResponse { - queries?: ComputedRef; -} export interface GetQueryServicesDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse"; value: Uint8Array; @@ -531,7 +465,6 @@ export interface GetQueryServicesDescriptorResponseAminoMsg { } /** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ export interface GetTxDescriptorRequest {} -export interface ReactiveGetTxDescriptorRequest {} export interface GetTxDescriptorRequestProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest"; value: Uint8Array; @@ -550,9 +483,6 @@ export interface GetTxDescriptorResponse { */ tx?: TxDescriptor; } -export interface ReactiveGetTxDescriptorResponse { - tx?: ComputedRef; -} export interface GetTxDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse"; value: Uint8Array; @@ -574,9 +504,6 @@ export interface QueryServicesDescriptor { /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ queryServices: QueryServiceDescriptor[]; } -export interface ReactiveQueryServicesDescriptor { - queryServices: ComputedRef; -} export interface QueryServicesDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor"; value: Uint8Array; @@ -599,11 +526,6 @@ export interface QueryServiceDescriptor { /** methods provides a list of query service methods */ methods: QueryMethodDescriptor[]; } -export interface ReactiveQueryServiceDescriptor { - fullname: ComputedRef; - isModule: ComputedRef; - methods: ComputedRef; -} export interface QueryServiceDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor"; value: Uint8Array; @@ -635,10 +557,6 @@ export interface QueryMethodDescriptor { */ fullQueryPath: string; } -export interface ReactiveQueryMethodDescriptor { - name: ComputedRef; - fullQueryPath: ComputedRef; -} export interface QueryMethodDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts deleted file mode 100644 index 1051317d..00000000 --- a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts +++ /dev/null @@ -1,339 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; -/** Service defines the gRPC querier service for tendermint queries. */ -export interface Service { - /** GetNodeInfo queries the current node info. */ - getNodeInfo(request?: GetNodeInfoRequest): Promise; - /** GetSyncing queries node syncing. */ - getSyncing(request?: GetSyncingRequest): Promise; - /** GetLatestBlock returns the latest block. */ - getLatestBlock(request?: GetLatestBlockRequest): Promise; - /** GetBlockByHeight queries block for given height. */ - getBlockByHeight(request: GetBlockByHeightRequest): Promise; - /** GetLatestValidatorSet queries latest validator-set. */ - getLatestValidatorSet(request?: GetLatestValidatorSetRequest): Promise; - /** GetValidatorSetByHeight queries validator-set at a given height. */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* GetNodeInfo queries the current node info. */ - getNodeInfo = async (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 BinaryReader(data))); - }; - /* GetSyncing queries node syncing. */ - getSyncing = async (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 BinaryReader(data))); - }; - /* GetLatestBlock returns the latest block. */ - getLatestBlock = async (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 BinaryReader(data))); - }; - /* GetBlockByHeight queries block for given height. */ - getBlockByHeight = async (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 BinaryReader(data))); - }; - /* GetLatestValidatorSet queries latest validator-set. */ - getLatestValidatorSet = async (request: GetLatestValidatorSetRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* GetValidatorSetByHeight queries validator-set at a given height. */ - getValidatorSetByHeight = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new ServiceClientImpl(rpc); - return { - getNodeInfo(request?: GetNodeInfoRequest): Promise { - return queryService.getNodeInfo(request); - }, - getSyncing(request?: GetSyncingRequest): Promise { - return queryService.getSyncing(request); - }, - getLatestBlock(request?: GetLatestBlockRequest): Promise { - return queryService.getLatestBlock(request); - }, - getBlockByHeight(request: GetBlockByHeightRequest): Promise { - return queryService.getBlockByHeight(request); - }, - getLatestValidatorSet(request?: GetLatestValidatorSetRequest): Promise { - return queryService.getLatestValidatorSet(request); - }, - getValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { - return queryService.getValidatorSetByHeight(request); - }, - aBCIQuery(request: ABCIQueryRequest): Promise { - return queryService.aBCIQuery(request); - } - }; -}; -export interface UseGetNodeInfoQuery extends VueQueryParams { - request?: ReactiveGetNodeInfoRequest; -} -export interface UseGetSyncingQuery extends VueQueryParams { - request?: ReactiveGetSyncingRequest; -} -export interface UseGetLatestBlockQuery extends VueQueryParams { - request?: ReactiveGetLatestBlockRequest; -} -export interface UseGetBlockByHeightQuery extends VueQueryParams { - request: ReactiveGetBlockByHeightRequest; -} -export interface UseGetLatestValidatorSetQuery extends VueQueryParams { - request?: ReactiveGetLatestValidatorSetRequest; -} -export interface UseGetValidatorSetByHeightQuery extends VueQueryParams { - request: ReactiveGetValidatorSetByHeightRequest; -} -export interface UseABCIQueryQuery extends VueQueryParams { - request: ReactiveABCIQueryRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new ServiceClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useGetNodeInfo = ({ - request, - options - }: UseGetNodeInfoQuery) => { - const queryKey = ["getNodeInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getNodeInfo(params); - }, - ...options - }); - }; - const useGetSyncing = ({ - request, - options - }: UseGetSyncingQuery) => { - const queryKey = ["getSyncingQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getSyncing(params); - }, - ...options - }); - }; - const useGetLatestBlock = ({ - request, - options - }: UseGetLatestBlockQuery) => { - const queryKey = ["getLatestBlockQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getLatestBlock(params); - }, - ...options - }); - }; - const useGetBlockByHeight = ({ - request, - options - }: UseGetBlockByHeightQuery) => { - const queryKey = ["getBlockByHeightQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getBlockByHeight(params); - }, - ...options - }); - }; - const useGetLatestValidatorSet = ({ - request, - options - }: UseGetLatestValidatorSetQuery) => { - const queryKey = ["getLatestValidatorSetQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getLatestValidatorSet(params); - }, - ...options - }); - }; - const useGetValidatorSetByHeight = ({ - request, - options - }: UseGetValidatorSetByHeightQuery) => { - const queryKey = ["getValidatorSetByHeightQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getValidatorSetByHeight(params); - }, - ...options - }); - }; - const useABCIQuery = ({ - request, - options - }: UseABCIQueryQuery) => { - const queryKey = ["aBCIQueryQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.aBCIQuery(params); - }, - ...options - }); - }; - return { - /** GetNodeInfo queries the current node info. */useGetNodeInfo, - /** GetSyncing queries node syncing. */useGetSyncing, - /** GetLatestBlock returns the latest block. */useGetLatestBlock, - /** GetBlockByHeight queries block for given height. */useGetBlockByHeight, - /** GetLatestValidatorSet queries latest validator-set. */useGetLatestValidatorSet, - /** GetValidatorSetByHeight queries validator-set at a given height. */useGetValidatorSetByHeight, - /** - * 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 - */ - useABCIQuery - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..779a0232 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts @@ -0,0 +1,51 @@ +import { RpcResolver, buildQuery } from "../../../../helper-func-types"; +import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; +export const createGetGetNodeInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetNodeInfoRequest.encode, + decode: GetNodeInfoResponse.decode, + service: "cosmos.base.tendermint.v1beta1.Service", + method: "GetNodeInfo", + clientResolver +}); +export const createGetGetSyncing = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetSyncingRequest.encode, + decode: GetSyncingResponse.decode, + service: "cosmos.base.tendermint.v1beta1.Service", + method: "GetSyncing", + clientResolver +}); +export const createGetGetLatestBlock = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetLatestBlockRequest.encode, + decode: GetLatestBlockResponse.decode, + service: "cosmos.base.tendermint.v1beta1.Service", + method: "GetLatestBlock", + clientResolver +}); +export const createGetGetBlockByHeight = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetBlockByHeightRequest.encode, + decode: GetBlockByHeightResponse.decode, + service: "cosmos.base.tendermint.v1beta1.Service", + method: "GetBlockByHeight", + clientResolver +}); +export const createGetGetLatestValidatorSet = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetLatestValidatorSetRequest.encode, + decode: GetLatestValidatorSetResponse.decode, + service: "cosmos.base.tendermint.v1beta1.Service", + method: "GetLatestValidatorSet", + clientResolver +}); +export const createGetGetValidatorSetByHeight = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetValidatorSetByHeightRequest.encode, + decode: GetValidatorSetByHeightResponse.decode, + service: "cosmos.base.tendermint.v1beta1.Service", + method: "GetValidatorSetByHeight", + clientResolver +}); +export const createGetABCIQuery = (clientResolver?: RpcResolver) => buildQuery({ + encode: ABCIQueryRequest.encode, + decode: ABCIQueryResponse.decode, + service: "cosmos.base.tendermint.v1beta1.Service", + method: "ABCIQuery", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..102bf297 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts @@ -0,0 +1,31 @@ +import { buildUseVueQuery } from "../../../../vue-query"; +import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; +import { createGetGetNodeInfo, createGetGetSyncing, createGetGetLatestBlock, createGetGetBlockByHeight, createGetGetLatestValidatorSet, createGetGetValidatorSetByHeight, createGetABCIQuery } from "./query.rpc.func.ts"; +export const useGetGetNodeInfo = buildUseVueQuery({ + builderQueryFn: createGetGetNodeInfo, + queryKeyPrefix: "GetNodeInfoQuery" +}); +export const useGetGetSyncing = buildUseVueQuery({ + builderQueryFn: createGetGetSyncing, + queryKeyPrefix: "GetSyncingQuery" +}); +export const useGetGetLatestBlock = buildUseVueQuery({ + builderQueryFn: createGetGetLatestBlock, + queryKeyPrefix: "GetLatestBlockQuery" +}); +export const useGetGetBlockByHeight = buildUseVueQuery({ + builderQueryFn: createGetGetBlockByHeight, + queryKeyPrefix: "GetBlockByHeightQuery" +}); +export const useGetGetLatestValidatorSet = buildUseVueQuery({ + builderQueryFn: createGetGetLatestValidatorSet, + queryKeyPrefix: "GetLatestValidatorSetQuery" +}); +export const useGetGetValidatorSetByHeight = buildUseVueQuery({ + builderQueryFn: createGetGetValidatorSetByHeight, + queryKeyPrefix: "GetValidatorSetByHeightQuery" +}); +export const useGetABCIQuery = buildUseVueQuery({ + builderQueryFn: createGetABCIQuery, + queryKeyPrefix: "ABCIQueryQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.ts index 11647d40..6b661eed 100644 --- a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.ts @@ -9,17 +9,12 @@ import { DefaultNodeInfo, DefaultNodeInfoAmino } from "../../../../tendermint/p2 import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequest { height: bigint; /** pagination defines an pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveGetValidatorSetByHeightRequest { - height: ComputedRef; - pagination?: ComputedRef; -} export interface GetValidatorSetByHeightRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest"; value: Uint8Array; @@ -41,11 +36,6 @@ export interface GetValidatorSetByHeightResponse { /** pagination defines an pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveGetValidatorSetByHeightResponse { - blockHeight: ComputedRef; - validators: ComputedRef; - pagination?: ComputedRef; -} export interface GetValidatorSetByHeightResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse"; value: Uint8Array; @@ -66,9 +56,6 @@ export interface GetLatestValidatorSetRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveGetLatestValidatorSetRequest { - pagination?: ComputedRef; -} export interface GetLatestValidatorSetRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest"; value: Uint8Array; @@ -89,11 +76,6 @@ export interface GetLatestValidatorSetResponse { /** pagination defines an pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveGetLatestValidatorSetResponse { - blockHeight: ComputedRef; - validators: ComputedRef; - pagination?: ComputedRef; -} export interface GetLatestValidatorSetResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse"; value: Uint8Array; @@ -116,12 +98,6 @@ export interface Validator { votingPower: bigint; proposerPriority: bigint; } -export interface ReactiveValidator { - address: ComputedRef; - pubKey?: ComputedRef; - votingPower: ComputedRef; - proposerPriority: ComputedRef; -} export interface ValidatorProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Validator"; value: Uint8Array; @@ -141,9 +117,6 @@ export interface ValidatorAminoMsg { export interface GetBlockByHeightRequest { height: bigint; } -export interface ReactiveGetBlockByHeightRequest { - height: ComputedRef; -} export interface GetBlockByHeightRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest"; value: Uint8Array; @@ -164,11 +137,6 @@ export interface GetBlockByHeightResponse { /** Since: cosmos-sdk 0.47 */ sdkBlock?: Block2; } -export interface ReactiveGetBlockByHeightResponse { - blockId?: ComputedRef; - block?: ComputedRef; - sdkBlock?: ComputedRef; -} export interface GetBlockByHeightResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse"; value: Uint8Array; @@ -187,7 +155,6 @@ export interface GetBlockByHeightResponseAminoMsg { } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockRequest {} -export interface ReactiveGetLatestBlockRequest {} export interface GetLatestBlockRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest"; value: Uint8Array; @@ -206,11 +173,6 @@ export interface GetLatestBlockResponse { /** Since: cosmos-sdk 0.47 */ sdkBlock?: Block2; } -export interface ReactiveGetLatestBlockResponse { - blockId?: ComputedRef; - block?: ComputedRef; - sdkBlock?: ComputedRef; -} export interface GetLatestBlockResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse"; value: Uint8Array; @@ -229,7 +191,6 @@ export interface GetLatestBlockResponseAminoMsg { } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ export interface GetSyncingRequest {} -export interface ReactiveGetSyncingRequest {} export interface GetSyncingRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest"; value: Uint8Array; @@ -244,9 +205,6 @@ export interface GetSyncingRequestAminoMsg { export interface GetSyncingResponse { syncing: boolean; } -export interface ReactiveGetSyncingResponse { - syncing: ComputedRef; -} export interface GetSyncingResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse"; value: Uint8Array; @@ -261,7 +219,6 @@ export interface GetSyncingResponseAminoMsg { } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoRequest {} -export interface ReactiveGetNodeInfoRequest {} export interface GetNodeInfoRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest"; value: Uint8Array; @@ -277,10 +234,6 @@ export interface GetNodeInfoResponse { defaultNodeInfo?: DefaultNodeInfo; applicationVersion?: VersionInfo; } -export interface ReactiveGetNodeInfoResponse { - defaultNodeInfo?: ComputedRef; - applicationVersion?: ComputedRef; -} export interface GetNodeInfoResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse"; value: Uint8Array; @@ -306,16 +259,6 @@ export interface VersionInfo { /** Since: cosmos-sdk 0.43 */ cosmosSdkVersion: string; } -export interface ReactiveVersionInfo { - name: ComputedRef; - appName: ComputedRef; - version: ComputedRef; - gitCommit: ComputedRef; - buildTags: ComputedRef; - goVersion: ComputedRef; - buildDeps: ComputedRef; - cosmosSdkVersion: ComputedRef; -} export interface VersionInfoProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.VersionInfo"; value: Uint8Array; @@ -345,11 +288,6 @@ export interface Module { /** checksum */ sum: string; } -export interface ReactiveModule { - path: ComputedRef; - version: ComputedRef; - sum: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Module"; value: Uint8Array; @@ -374,12 +312,6 @@ export interface ABCIQueryRequest { height: bigint; prove: boolean; } -export interface ReactiveABCIQueryRequest { - data: ComputedRef; - path: ComputedRef; - height: ComputedRef; - prove: ComputedRef; -} export interface ABCIQueryRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest"; value: Uint8Array; @@ -414,17 +346,6 @@ export interface ABCIQueryResponse { height: bigint; codespace: string; } -export interface ReactiveABCIQueryResponse { - code: ComputedRef; - log: ComputedRef; - info: ComputedRef; - index: ComputedRef; - key: ComputedRef; - value: ComputedRef; - proofOps?: ComputedRef; - height: ComputedRef; - codespace: ComputedRef; -} export interface ABCIQueryResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse"; value: Uint8Array; @@ -464,11 +385,6 @@ export interface ProofOp { key: Uint8Array; data: Uint8Array; } -export interface ReactiveProofOp { - type: ComputedRef; - key: ComputedRef; - data: ComputedRef; -} export interface ProofOpProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp"; value: Uint8Array; @@ -497,9 +413,6 @@ export interface ProofOpAminoMsg { export interface ProofOps { ops: ProofOp[]; } -export interface ReactiveProofOps { - ops: ComputedRef; -} export interface ProofOpsProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/types.ts b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/types.ts index c536fbc0..179ed9b6 100644 --- a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/types.ts +++ b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/types.ts @@ -5,7 +5,6 @@ import { Timestamp } from "../../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * Block is tendermint type Block, with the Header proposer address * field converted to bech32 string. @@ -16,12 +15,6 @@ export interface Block { evidence: EvidenceList; lastCommit?: Commit; } -export interface ReactiveBlock { - header: ComputedRef
; - data: ComputedRef; - evidence: ComputedRef; - lastCommit?: ComputedRef; -} export interface BlockProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Block"; value: Uint8Array; @@ -72,22 +65,6 @@ export interface Header { */ proposerAddress: string; } -export interface ReactiveHeader { - version: ComputedRef; - chainId: ComputedRef; - height: ComputedRef; - time: ComputedRef; - lastBlockId: ComputedRef; - lastCommitHash: ComputedRef; - dataHash: ComputedRef; - validatorsHash: ComputedRef; - nextValidatorsHash: ComputedRef; - consensusHash: ComputedRef; - appHash: ComputedRef; - lastResultsHash: ComputedRef; - evidenceHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface HeaderProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Header"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/base/v1beta1/coin.ts b/libs/interchain-vue/src/cosmos/base/v1beta1/coin.ts index 7405d5a9..155e8009 100644 --- a/libs/interchain-vue/src/cosmos/base/v1beta1/coin.ts +++ b/libs/interchain-vue/src/cosmos/base/v1beta1/coin.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * Coin defines a token with a denomination and an amount. * @@ -12,10 +11,6 @@ export interface Coin { denom: string; amount: string; } -export interface ReactiveCoin { - denom: ComputedRef; - amount: ComputedRef; -} export interface CoinProtoMsg { typeUrl: "/cosmos.base.v1beta1.Coin"; value: Uint8Array; @@ -44,10 +39,6 @@ export interface DecCoin { denom: string; amount: string; } -export interface ReactiveDecCoin { - denom: ComputedRef; - amount: ComputedRef; -} export interface DecCoinProtoMsg { typeUrl: "/cosmos.base.v1beta1.DecCoin"; value: Uint8Array; @@ -73,9 +64,6 @@ export interface DecCoinAminoMsg { export interface IntProto { int: string; } -export interface ReactiveIntProto { - int: ComputedRef; -} export interface IntProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.IntProto"; value: Uint8Array; @@ -98,9 +86,6 @@ export interface IntProtoAminoMsg { export interface DecProto { dec: string; } -export interface ReactiveDecProto { - dec: ComputedRef; -} export interface DecProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.DecProto"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/circuit/module/v1/module.ts b/libs/interchain-vue/src/cosmos/circuit/module/v1/module.ts index 00bfad78..82b14626 100644 --- a/libs/interchain-vue/src/cosmos/circuit/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/circuit/module/v1/module.ts @@ -1,15 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the circuit module. */ export interface Module { /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.circuit.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.Query.ts deleted file mode 100644 index c7b66f94..00000000 --- a/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.Query.ts +++ /dev/null @@ -1,162 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse, ReactiveQueryAccountRequest, ReactiveQueryAccountsRequest, ReactiveQueryDisabledListRequest } from "./query"; -/** Query defines the circuit gRPC querier service. */ -export interface Query { - /** Account returns account permissions. */ - account(request: QueryAccountRequest): Promise; - /** Account returns account permissions. */ - accounts(request?: QueryAccountsRequest): Promise; - /** DisabledList returns a list of disabled message urls */ - disabledList(request?: QueryDisabledListRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Account returns account permissions. */ - account = async (request: QueryAccountRequest): Promise => { - const data = QueryAccountRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.circuit.v1.Query", "Account", data); - return promise.then(data => AccountResponse.decode(new BinaryReader(data))); - }; - /* Account returns account permissions. */ - accounts = async (request: QueryAccountsRequest = { - pagination: undefined - }): Promise => { - const data = QueryAccountsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.circuit.v1.Query", "Accounts", data); - return promise.then(data => AccountsResponse.decode(new BinaryReader(data))); - }; - /* DisabledList returns a list of disabled message urls */ - disabledList = async (request: QueryDisabledListRequest = {}): Promise => { - const data = QueryDisabledListRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.circuit.v1.Query", "DisabledList", data); - return promise.then(data => DisabledListResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - account(request: QueryAccountRequest): Promise { - return queryService.account(request); - }, - accounts(request?: QueryAccountsRequest): Promise { - return queryService.accounts(request); - }, - disabledList(request?: QueryDisabledListRequest): Promise { - return queryService.disabledList(request); - } - }; -}; -export interface UseAccountQuery extends VueQueryParams { - request: ReactiveQueryAccountRequest; -} -export interface UseAccountsQuery extends VueQueryParams { - request?: ReactiveQueryAccountsRequest; -} -export interface UseDisabledListQuery extends VueQueryParams { - request?: ReactiveQueryDisabledListRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useAccount = ({ - request, - options - }: UseAccountQuery) => { - const queryKey = ["accountQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.account(params); - }, - ...options - }); - }; - const useAccounts = ({ - request, - options - }: UseAccountsQuery) => { - const queryKey = ["accountsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.accounts(params); - }, - ...options - }); - }; - const useDisabledList = ({ - request, - options - }: UseDisabledListQuery) => { - const queryKey = ["disabledListQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.disabledList(params); - }, - ...options - }); - }; - return { - /** Account returns account permissions. */useAccount, - /** Account returns account permissions. */useAccounts, - /** DisabledList returns a list of disabled message urls */useDisabledList - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.func.ts new file mode 100644 index 00000000..f752e8a5 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.func.ts @@ -0,0 +1,23 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse } from "./query"; +export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountRequest.encode, + decode: AccountResponse.decode, + service: "cosmos.circuit.v1.Query", + method: "Account", + clientResolver +}); +export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountsRequest.encode, + decode: AccountsResponse.decode, + service: "cosmos.circuit.v1.Query", + method: "Accounts", + clientResolver +}); +export const createGetDisabledList = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDisabledListRequest.encode, + decode: DisabledListResponse.decode, + service: "cosmos.circuit.v1.Query", + method: "DisabledList", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts new file mode 100644 index 00000000..2b18b347 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse } from "./query"; +import { createGetAccount, createGetAccounts, createGetDisabledList } from "./query.rpc.func.ts"; +export const useGetAccount = buildUseVueQuery({ + builderQueryFn: createGetAccount, + queryKeyPrefix: "AccountQuery" +}); +export const useGetAccounts = buildUseVueQuery({ + builderQueryFn: createGetAccounts, + queryKeyPrefix: "AccountsQuery" +}); +export const useGetDisabledList = buildUseVueQuery({ + builderQueryFn: createGetDisabledList, + queryKeyPrefix: "DisabledListQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/query.ts b/libs/interchain-vue/src/cosmos/circuit/v1/query.ts index 9ddd96be..f66b5399 100644 --- a/libs/interchain-vue/src/cosmos/circuit/v1/query.ts +++ b/libs/interchain-vue/src/cosmos/circuit/v1/query.ts @@ -3,14 +3,10 @@ import { Permissions, PermissionsAmino, GenesisAccountPermissions, GenesisAccoun import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryAccountRequest is the request type for the Query/Account RPC method. */ export interface QueryAccountRequest { address: string; } -export interface ReactiveQueryAccountRequest { - address: ComputedRef; -} export interface QueryAccountRequestProtoMsg { typeUrl: "/cosmos.circuit.v1.QueryAccountRequest"; value: Uint8Array; @@ -27,9 +23,6 @@ export interface QueryAccountRequestAminoMsg { export interface AccountResponse { permission?: Permissions; } -export interface ReactiveAccountResponse { - permission?: ComputedRef; -} export interface AccountResponseProtoMsg { typeUrl: "/cosmos.circuit.v1.AccountResponse"; value: Uint8Array; @@ -47,9 +40,6 @@ export interface QueryAccountsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAccountsRequest { - pagination?: ComputedRef; -} export interface QueryAccountsRequestProtoMsg { typeUrl: "/cosmos.circuit.v1.QueryAccountsRequest"; value: Uint8Array; @@ -69,10 +59,6 @@ export interface AccountsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveAccountsResponse { - accounts: ComputedRef; - pagination?: ComputedRef; -} export interface AccountsResponseProtoMsg { typeUrl: "/cosmos.circuit.v1.AccountsResponse"; value: Uint8Array; @@ -89,7 +75,6 @@ export interface AccountsResponseAminoMsg { } /** QueryDisableListRequest is the request type for the Query/DisabledList RPC method. */ export interface QueryDisabledListRequest {} -export interface ReactiveQueryDisabledListRequest {} export interface QueryDisabledListRequestProtoMsg { typeUrl: "/cosmos.circuit.v1.QueryDisabledListRequest"; value: Uint8Array; @@ -104,9 +89,6 @@ export interface QueryDisabledListRequestAminoMsg { export interface DisabledListResponse { disabledList: string[]; } -export interface ReactiveDisabledListResponse { - disabledList: ComputedRef; -} export interface DisabledListResponseProtoMsg { typeUrl: "/cosmos.circuit.v1.DisabledListResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/tx.amino.ts b/libs/interchain-vue/src/cosmos/circuit/v1/tx.amino.ts deleted file mode 100644 index 9204d446..00000000 --- a/libs/interchain-vue/src/cosmos/circuit/v1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; -export const AminoConverter = { - "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker": { - aminoType: "cosmos-sdk/MsgAuthorizeCircuitBreaker", - toAmino: MsgAuthorizeCircuitBreaker.toAmino, - fromAmino: MsgAuthorizeCircuitBreaker.fromAmino - }, - "/cosmos.circuit.v1.MsgTripCircuitBreaker": { - aminoType: "cosmos-sdk/MsgTripCircuitBreaker", - toAmino: MsgTripCircuitBreaker.toAmino, - fromAmino: MsgTripCircuitBreaker.fromAmino - }, - "/cosmos.circuit.v1.MsgResetCircuitBreaker": { - aminoType: "cosmos-sdk/MsgResetCircuitBreaker", - toAmino: MsgResetCircuitBreaker.toAmino, - fromAmino: MsgResetCircuitBreaker.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.func.ts new file mode 100644 index 00000000..38454de3 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; +export const createAuthorizeCircuitBreaker = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAuthorizeCircuitBreaker.typeUrl, + encoders: toEncoders(MsgAuthorizeCircuitBreaker), + converters: toConverters(MsgAuthorizeCircuitBreaker) +}); +export const createTripCircuitBreaker = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTripCircuitBreaker.typeUrl, + encoders: toEncoders(MsgTripCircuitBreaker), + converters: toConverters(MsgTripCircuitBreaker) +}); +export const createResetCircuitBreaker = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgResetCircuitBreaker.typeUrl, + encoders: toEncoders(MsgResetCircuitBreaker), + converters: toConverters(MsgResetCircuitBreaker) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.msg.ts deleted file mode 100644 index 40717460..00000000 --- a/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgAuthorizeCircuitBreaker, MsgAuthorizeCircuitBreakerResponse, MsgTripCircuitBreaker, MsgTripCircuitBreakerResponse, MsgResetCircuitBreaker, MsgResetCircuitBreakerResponse } from "./tx"; -/** Msg defines the circuit Msg service. */ -export interface Msg { - /** - * AuthorizeCircuitBreaker allows a super-admin to grant (or revoke) another - * account's circuit breaker permissions. - */ - authorizeCircuitBreaker(request: MsgAuthorizeCircuitBreaker): Promise; - /** TripCircuitBreaker pauses processing of Msg's in the state machine. */ - tripCircuitBreaker(request: MsgTripCircuitBreaker): Promise; - /** - * ResetCircuitBreaker resumes processing of Msg's in the state machine that - * have been been paused using TripCircuitBreaker. - */ - resetCircuitBreaker(request: MsgResetCircuitBreaker): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* AuthorizeCircuitBreaker allows a super-admin to grant (or revoke) another - account's circuit breaker permissions. */ - authorizeCircuitBreaker = async (request: MsgAuthorizeCircuitBreaker): Promise => { - const data = MsgAuthorizeCircuitBreaker.encode(request).finish(); - const promise = this.rpc.request("cosmos.circuit.v1.Msg", "AuthorizeCircuitBreaker", data); - return promise.then(data => MsgAuthorizeCircuitBreakerResponse.decode(new BinaryReader(data))); - }; - /* TripCircuitBreaker pauses processing of Msg's in the state machine. */ - tripCircuitBreaker = async (request: MsgTripCircuitBreaker): Promise => { - const data = MsgTripCircuitBreaker.encode(request).finish(); - const promise = this.rpc.request("cosmos.circuit.v1.Msg", "TripCircuitBreaker", data); - return promise.then(data => MsgTripCircuitBreakerResponse.decode(new BinaryReader(data))); - }; - /* ResetCircuitBreaker resumes processing of Msg's in the state machine that - have been been paused using TripCircuitBreaker. */ - resetCircuitBreaker = async (request: MsgResetCircuitBreaker): Promise => { - const data = MsgResetCircuitBreaker.encode(request).finish(); - const promise = this.rpc.request("cosmos.circuit.v1.Msg", "ResetCircuitBreaker", data); - return promise.then(data => MsgResetCircuitBreakerResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..705f1cff --- /dev/null +++ b/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts @@ -0,0 +1,12 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; +import { createAuthorizeCircuitBreaker, createTripCircuitBreaker, createResetCircuitBreaker } from "./tx.rpc.func.ts"; +export const useAuthorizeCircuitBreaker = buildUseVueMutation({ + builderMutationFn: createAuthorizeCircuitBreaker +}); +export const useTripCircuitBreaker = buildUseVueMutation({ + builderMutationFn: createTripCircuitBreaker +}); +export const useResetCircuitBreaker = buildUseVueMutation({ + builderMutationFn: createResetCircuitBreaker +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/tx.ts b/libs/interchain-vue/src/cosmos/circuit/v1/tx.ts index d96fbea3..76271550 100644 --- a/libs/interchain-vue/src/cosmos/circuit/v1/tx.ts +++ b/libs/interchain-vue/src/cosmos/circuit/v1/tx.ts @@ -2,7 +2,6 @@ import { Permissions, PermissionsAmino } from "./types"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. */ export interface MsgAuthorizeCircuitBreaker { /** @@ -19,11 +18,6 @@ export interface MsgAuthorizeCircuitBreaker { */ permissions?: Permissions; } -export interface ReactiveMsgAuthorizeCircuitBreaker { - granter: ComputedRef; - grantee: ComputedRef; - permissions?: ComputedRef; -} export interface MsgAuthorizeCircuitBreakerProtoMsg { typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker"; value: Uint8Array; @@ -52,9 +46,6 @@ export interface MsgAuthorizeCircuitBreakerAminoMsg { export interface MsgAuthorizeCircuitBreakerResponse { success: boolean; } -export interface ReactiveMsgAuthorizeCircuitBreakerResponse { - success: ComputedRef; -} export interface MsgAuthorizeCircuitBreakerResponseProtoMsg { typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse"; value: Uint8Array; @@ -80,10 +71,6 @@ export interface MsgTripCircuitBreaker { */ msgTypeUrls: string[]; } -export interface ReactiveMsgTripCircuitBreaker { - authority: ComputedRef; - msgTypeUrls: ComputedRef; -} export interface MsgTripCircuitBreakerProtoMsg { typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreaker"; value: Uint8Array; @@ -109,9 +96,6 @@ export interface MsgTripCircuitBreakerAminoMsg { export interface MsgTripCircuitBreakerResponse { success: boolean; } -export interface ReactiveMsgTripCircuitBreakerResponse { - success: ComputedRef; -} export interface MsgTripCircuitBreakerResponseProtoMsg { typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreakerResponse"; value: Uint8Array; @@ -135,10 +119,6 @@ export interface MsgResetCircuitBreaker { */ msgTypeUrls: string[]; } -export interface ReactiveMsgResetCircuitBreaker { - authority: ComputedRef; - msgTypeUrls: ComputedRef; -} export interface MsgResetCircuitBreakerProtoMsg { typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreaker"; value: Uint8Array; @@ -162,9 +142,6 @@ export interface MsgResetCircuitBreakerAminoMsg { export interface MsgResetCircuitBreakerResponse { success: boolean; } -export interface ReactiveMsgResetCircuitBreakerResponse { - success: ComputedRef; -} export interface MsgResetCircuitBreakerResponseProtoMsg { typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreakerResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/types.ts b/libs/interchain-vue/src/cosmos/circuit/v1/types.ts index 883b317b..0bd45a82 100644 --- a/libs/interchain-vue/src/cosmos/circuit/v1/types.ts +++ b/libs/interchain-vue/src/cosmos/circuit/v1/types.ts @@ -1,7 +1,6 @@ import { isSet, DeepPartial } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Level is the permission level. */ export enum Permissions_Level { /** @@ -78,10 +77,6 @@ export interface Permissions { */ limitTypeUrls: string[]; } -export interface ReactivePermissions { - level: ComputedRef; - limitTypeUrls: ComputedRef; -} export interface PermissionsProtoMsg { typeUrl: "/cosmos.circuit.v1.Permissions"; value: Uint8Array; @@ -109,10 +104,6 @@ export interface GenesisAccountPermissions { address: string; permissions?: Permissions; } -export interface ReactiveGenesisAccountPermissions { - address: ComputedRef; - permissions?: ComputedRef; -} export interface GenesisAccountPermissionsProtoMsg { typeUrl: "/cosmos.circuit.v1.GenesisAccountPermissions"; value: Uint8Array; @@ -131,10 +122,6 @@ export interface GenesisState { accountPermissions: GenesisAccountPermissions[]; disabledTypeUrls: string[]; } -export interface ReactiveGenesisState { - accountPermissions: ComputedRef; - disabledTypeUrls: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.circuit.v1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/consensus/module/v1/module.ts b/libs/interchain-vue/src/cosmos/consensus/module/v1/module.ts index 0d14c265..ff03cafd 100644 --- a/libs/interchain-vue/src/cosmos/consensus/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/consensus/module/v1/module.ts @@ -1,15 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the consensus module. */ export interface Module { /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.consensus.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.Query.ts deleted file mode 100644 index 54d94f94..00000000 --- a/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.Query.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, ReactiveQueryParamsRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Params queries the parameters of x/consensus module. */ - params(request?: QueryParamsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params queries the parameters of x/consensus module. */ - params = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - return { - /** Params queries the parameters of x/consensus module. */useParams - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.func.ts new file mode 100644 index 00000000..489bf0b0 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.func.ts @@ -0,0 +1,9 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.consensus.v1.Query", + method: "Params", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts new file mode 100644 index 00000000..ccdb727b --- /dev/null +++ b/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts @@ -0,0 +1,7 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +import { createGetParams } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/query.ts b/libs/interchain-vue/src/cosmos/consensus/v1/query.ts index 6c92304f..d8afd0b0 100644 --- a/libs/interchain-vue/src/cosmos/consensus/v1/query.ts +++ b/libs/interchain-vue/src/cosmos/consensus/v1/query.ts @@ -2,10 +2,8 @@ import { ConsensusParams, ConsensusParamsAmino } from "../../../tendermint/types import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryParamsRequest defines the request type for querying x/consensus parameters. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.consensus.v1.QueryParamsRequest"; value: Uint8Array; @@ -25,9 +23,6 @@ export interface QueryParamsResponse { */ params?: ConsensusParams; } -export interface ReactiveQueryParamsResponse { - params?: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.consensus.v1.QueryParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/tx.amino.ts b/libs/interchain-vue/src/cosmos/consensus/v1/tx.amino.ts deleted file mode 100644 index 127a1388..00000000 --- a/libs/interchain-vue/src/cosmos/consensus/v1/tx.amino.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/cosmos.consensus.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/consensus/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.func.ts new file mode 100644 index 00000000..d8aead51 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.func.ts @@ -0,0 +1,9 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateParams } from "./tx"; +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.msg.ts deleted file mode 100644 index 49b67849..00000000 --- a/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the consensus Msg service. */ -export interface Msg { - /** - * UpdateParams defines a governance operation for updating the x/consensus 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* UpdateParams defines a governance operation for updating the x/consensus module parameters. - The authority is defined in the keeper. - - Since: cosmos-sdk 0.47 */ - updateParams = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..9b8d58b6 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts @@ -0,0 +1,6 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgUpdateParams } from "./tx"; +import { createUpdateParams } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/tx.ts b/libs/interchain-vue/src/cosmos/consensus/v1/tx.ts index bfba46dc..1126a948 100644 --- a/libs/interchain-vue/src/cosmos/consensus/v1/tx.ts +++ b/libs/interchain-vue/src/cosmos/consensus/v1/tx.ts @@ -2,7 +2,6 @@ import { BlockParams, BlockParamsAmino, EvidenceParams, EvidenceParamsAmino, Val import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** MsgUpdateParams is the Msg/UpdateParams request type. */ export interface MsgUpdateParams { /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ @@ -20,13 +19,6 @@ export interface MsgUpdateParams { /** Since: cosmos-sdk 0.50 */ abci?: ABCIParams; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - block?: ComputedRef; - evidence?: ComputedRef; - validator?: ComputedRef; - abci?: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.consensus.v1.MsgUpdateParams"; value: Uint8Array; @@ -57,7 +49,6 @@ export interface MsgUpdateParamsAminoMsg { * MsgUpdateParams message. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crisis/module/v1/module.ts b/libs/interchain-vue/src/cosmos/crisis/module/v1/module.ts index 51fc511f..8073e2d0 100644 --- a/libs/interchain-vue/src/cosmos/crisis/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/crisis/module/v1/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the crisis module. */ export interface Module { /** fee_collector_name is the name of the FeeCollector ModuleAccount. */ @@ -9,10 +8,6 @@ export interface Module { /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - feeCollectorName: ComputedRef; - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.crisis.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crisis/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/crisis/v1beta1/genesis.ts index a63949ce..39940ee7 100644 --- a/libs/interchain-vue/src/cosmos/crisis/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/crisis/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the crisis module's genesis state. */ export interface GenesisState { /** @@ -11,9 +10,6 @@ export interface GenesisState { */ constantFee: Coin; } -export interface ReactiveGenesisState { - constantFee: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.crisis.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.amino.ts deleted file mode 100644 index 569a9f83..00000000 --- a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.amino.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/cosmos.crisis.v1beta1.MsgVerifyInvariant": { - aminoType: "cosmos-sdk/MsgVerifyInvariant", - toAmino: MsgVerifyInvariant.toAmino, - fromAmino: MsgVerifyInvariant.fromAmino - }, - "/cosmos.crisis.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/crisis/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..bdf8d07c --- /dev/null +++ b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; +export const createVerifyInvariant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVerifyInvariant.typeUrl, + encoders: toEncoders(MsgVerifyInvariant), + converters: toConverters(MsgVerifyInvariant) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index ebffee18..00000000 --- a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgVerifyInvariant, MsgVerifyInvariantResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* VerifyInvariant defines a method to verify a particular invariant. */ - verifyInvariant = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..58a72d6a --- /dev/null +++ b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,9 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; +import { createVerifyInvariant, createUpdateParams } from "./tx.rpc.func.ts"; +export const useVerifyInvariant = buildUseVueMutation({ + builderMutationFn: createVerifyInvariant +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.ts index db5a2009..ff42e775 100644 --- a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** 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. */ @@ -12,11 +11,6 @@ export interface MsgVerifyInvariant { /** invariant_route is the msg's invariant route. */ invariantRoute: string; } -export interface ReactiveMsgVerifyInvariant { - sender: ComputedRef; - invariantModuleName: ComputedRef; - invariantRoute: ComputedRef; -} export interface MsgVerifyInvariantProtoMsg { typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant"; value: Uint8Array; @@ -36,7 +30,6 @@ export interface MsgVerifyInvariantAminoMsg { } /** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ export interface MsgVerifyInvariantResponse {} -export interface ReactiveMsgVerifyInvariantResponse {} export interface MsgVerifyInvariantResponseProtoMsg { typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariantResponse"; value: Uint8Array; @@ -58,10 +51,6 @@ export interface MsgUpdateParams { /** constant_fee defines the x/crisis parameter. */ constantFee: Coin; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - constantFee: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -88,7 +77,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crypto/ed25519/keys.ts b/libs/interchain-vue/src/cosmos/crypto/ed25519/keys.ts index 70c93f6c..6f544d77 100644 --- a/libs/interchain-vue/src/cosmos/crypto/ed25519/keys.ts +++ b/libs/interchain-vue/src/cosmos/crypto/ed25519/keys.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. * It's needed for Any serialization and SDK compatibility. @@ -12,9 +11,6 @@ import { ComputedRef } from "vue"; export interface PubKey { key: Uint8Array; } -export interface ReactivePubKey { - key: ComputedRef; -} export interface PubKeyProtoMsg { typeUrl: "/cosmos.crypto.ed25519.PubKey"; value: Uint8Array; @@ -40,9 +36,6 @@ export interface PubKeyAminoMsg { export interface PrivKey { key: Uint8Array; } -export interface ReactivePrivKey { - key: ComputedRef; -} export interface PrivKeyProtoMsg { typeUrl: "/cosmos.crypto.ed25519.PrivKey"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crypto/hd/v1/hd.ts b/libs/interchain-vue/src/cosmos/crypto/hd/v1/hd.ts index 473d7f93..77769f0c 100644 --- a/libs/interchain-vue/src/cosmos/crypto/hd/v1/hd.ts +++ b/libs/interchain-vue/src/cosmos/crypto/hd/v1/hd.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** BIP44Params is used as path field in ledger item in Record. */ export interface BIP44Params { /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ @@ -18,13 +17,6 @@ export interface BIP44Params { /** address_index is used as child index in BIP32 derivation */ addressIndex: number; } -export interface ReactiveBIP44Params { - purpose: ComputedRef; - coinType: ComputedRef; - account: ComputedRef; - change: ComputedRef; - addressIndex: ComputedRef; -} export interface BIP44ParamsProtoMsg { typeUrl: "/cosmos.crypto.hd.v1.BIP44Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crypto/keyring/v1/record.ts b/libs/interchain-vue/src/cosmos/crypto/keyring/v1/record.ts index db345bbc..70dfba17 100644 --- a/libs/interchain-vue/src/cosmos/crypto/keyring/v1/record.ts +++ b/libs/interchain-vue/src/cosmos/crypto/keyring/v1/record.ts @@ -3,7 +3,6 @@ import { BIP44Params, BIP44ParamsAmino } from "../../hd/v1/hd"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** Record is used for representing a key in the keyring. */ export interface Record { /** name represents a name of Record */ @@ -19,14 +18,6 @@ export interface Record { /** Offline does not store any other information. */ offline?: Record_Offline; } -export interface ReactiveRecord { - name: ComputedRef; - pubKey?: ComputedRef; - local?: ComputedRef; - ledger?: ComputedRef; - multi?: ComputedRef; - offline?: ComputedRef; -} export interface RecordProtoMsg { typeUrl: "/cosmos.crypto.keyring.v1.Record"; value: Uint8Array; @@ -57,9 +48,6 @@ export interface RecordAminoMsg { export interface Record_Local { privKey?: Any; } -export interface ReactiveRecord_Local { - privKey?: ComputedRef; -} export interface Record_LocalProtoMsg { typeUrl: "/cosmos.crypto.keyring.v1.Local"; value: Uint8Array; @@ -79,9 +67,6 @@ export interface Record_LocalAminoMsg { export interface Record_Ledger { path?: BIP44Params; } -export interface ReactiveRecord_Ledger { - path?: ComputedRef; -} export interface Record_LedgerProtoMsg { typeUrl: "/cosmos.crypto.keyring.v1.Ledger"; value: Uint8Array; @@ -96,7 +81,6 @@ export interface Record_LedgerAminoMsg { } /** Multi item */ export interface Record_Multi {} -export interface ReactiveRecord_Multi {} export interface Record_MultiProtoMsg { typeUrl: "/cosmos.crypto.keyring.v1.Multi"; value: Uint8Array; @@ -109,7 +93,6 @@ export interface Record_MultiAminoMsg { } /** Offline item */ export interface Record_Offline {} -export interface ReactiveRecord_Offline {} export interface Record_OfflineProtoMsg { typeUrl: "/cosmos.crypto.keyring.v1.Offline"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crypto/multisig/keys.ts b/libs/interchain-vue/src/cosmos/crypto/multisig/keys.ts index 46aeca5e..b6faedd3 100644 --- a/libs/interchain-vue/src/cosmos/crypto/multisig/keys.ts +++ b/libs/interchain-vue/src/cosmos/crypto/multisig/keys.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * LegacyAminoPubKey specifies a public key type * which nests multiple public keys and a threshold, @@ -12,10 +11,6 @@ export interface LegacyAminoPubKey { threshold: number; publicKeys: Any[]; } -export interface ReactiveLegacyAminoPubKey { - threshold: ComputedRef; - publicKeys: ComputedRef; -} export interface LegacyAminoPubKeyProtoMsg { typeUrl: "/cosmos.crypto.multisig.LegacyAminoPubKey"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/libs/interchain-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts index b6a78558..1d46639b 100644 --- a/libs/interchain-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/libs/interchain-vue/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers @@ -10,9 +9,6 @@ import { ComputedRef } from "vue"; export interface MultiSignature { signatures: Uint8Array[]; } -export interface ReactiveMultiSignature { - signatures: ComputedRef; -} export interface MultiSignatureProtoMsg { typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature"; value: Uint8Array; @@ -39,10 +35,6 @@ export interface CompactBitArray { extraBitsStored: number; elems: Uint8Array; } -export interface ReactiveCompactBitArray { - extraBitsStored: ComputedRef; - elems: ComputedRef; -} export interface CompactBitArrayProtoMsg { typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crypto/secp256k1/keys.ts b/libs/interchain-vue/src/cosmos/crypto/secp256k1/keys.ts index 6e19f0c9..c0fdd0ac 100644 --- a/libs/interchain-vue/src/cosmos/crypto/secp256k1/keys.ts +++ b/libs/interchain-vue/src/cosmos/crypto/secp256k1/keys.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * PubKey defines a secp256k1 public key * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte @@ -12,9 +11,6 @@ import { ComputedRef } from "vue"; export interface PubKey { key: Uint8Array; } -export interface ReactivePubKey { - key: ComputedRef; -} export interface PubKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256k1.PubKey"; value: Uint8Array; @@ -37,9 +33,6 @@ export interface PubKeyAminoMsg { export interface PrivKey { key: Uint8Array; } -export interface ReactivePrivKey { - key: ComputedRef; -} export interface PrivKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256k1.PrivKey"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/crypto/secp256r1/keys.ts b/libs/interchain-vue/src/cosmos/crypto/secp256r1/keys.ts index 664aac01..6b1edf68 100644 --- a/libs/interchain-vue/src/cosmos/crypto/secp256r1/keys.ts +++ b/libs/interchain-vue/src/cosmos/crypto/secp256r1/keys.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** PubKey defines a secp256r1 ECDSA public key. */ export interface PubKey { /** @@ -10,9 +9,6 @@ export interface PubKey { */ key: Uint8Array; } -export interface ReactivePubKey { - key: ComputedRef; -} export interface PubKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256r1.PubKey"; value: Uint8Array; @@ -34,9 +30,6 @@ export interface PrivKey { /** secret number serialized using big-endian encoding */ secret: Uint8Array; } -export interface ReactivePrivKey { - secret: ComputedRef; -} export interface PrivKeyProtoMsg { typeUrl: "/cosmos.crypto.secp256r1.PrivKey"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/distribution/module/v1/module.ts b/libs/interchain-vue/src/cosmos/distribution/module/v1/module.ts index f7dba10c..d92a99cb 100644 --- a/libs/interchain-vue/src/cosmos/distribution/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/distribution/module/v1/module.ts @@ -1,17 +1,12 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the distribution module. */ export interface Module { feeCollectorName: string; /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - feeCollectorName: ComputedRef; - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.distribution.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/distribution.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/distribution.ts index 53b3e942..fdf747a5 100644 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/distribution.ts +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/distribution.ts @@ -2,7 +2,6 @@ import { DecCoin, DecCoinAmino, Coin, CoinAmino } from "../../base/v1beta1/coin" import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Params defines the set of params for the distribution module. */ export interface Params { communityTax: string; @@ -20,12 +19,6 @@ export interface Params { bonusProposerReward: string; withdrawAddrEnabled: boolean; } -export interface ReactiveParams { - communityTax: ComputedRef; - baseProposerReward: ComputedRef; - bonusProposerReward: ComputedRef; - withdrawAddrEnabled: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.Params"; value: Uint8Array; @@ -69,10 +62,6 @@ export interface ValidatorHistoricalRewards { cumulativeRewardRatio: DecCoin[]; referenceCount: number; } -export interface ReactiveValidatorHistoricalRewards { - cumulativeRewardRatio: ComputedRef; - referenceCount: ComputedRef; -} export interface ValidatorHistoricalRewardsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards"; value: Uint8Array; @@ -108,10 +97,6 @@ export interface ValidatorCurrentRewards { rewards: DecCoin[]; period: bigint; } -export interface ReactiveValidatorCurrentRewards { - rewards: ComputedRef; - period: ComputedRef; -} export interface ValidatorCurrentRewardsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards"; value: Uint8Array; @@ -136,9 +121,6 @@ export interface ValidatorCurrentRewardsAminoMsg { export interface ValidatorAccumulatedCommission { commission: DecCoin[]; } -export interface ReactiveValidatorAccumulatedCommission { - commission: ComputedRef; -} export interface ValidatorAccumulatedCommissionProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"; value: Uint8Array; @@ -161,9 +143,6 @@ export interface ValidatorAccumulatedCommissionAminoMsg { export interface ValidatorOutstandingRewards { rewards: DecCoin[]; } -export interface ReactiveValidatorOutstandingRewards { - rewards: ComputedRef; -} export interface ValidatorOutstandingRewardsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards"; value: Uint8Array; @@ -189,10 +168,6 @@ export interface ValidatorSlashEvent { validatorPeriod: bigint; fraction: string; } -export interface ReactiveValidatorSlashEvent { - validatorPeriod: ComputedRef; - fraction: ComputedRef; -} export interface ValidatorSlashEventProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent"; value: Uint8Array; @@ -215,9 +190,6 @@ export interface ValidatorSlashEventAminoMsg { export interface ValidatorSlashEvents { validatorSlashEvents: ValidatorSlashEvent[]; } -export interface ReactiveValidatorSlashEvents { - validatorSlashEvents: ComputedRef; -} export interface ValidatorSlashEventsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents"; value: Uint8Array; @@ -234,9 +206,6 @@ export interface ValidatorSlashEventsAminoMsg { export interface FeePool { communityPool: DecCoin[]; } -export interface ReactiveFeePool { - communityPool: ComputedRef; -} export interface FeePoolProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.FeePool"; value: Uint8Array; @@ -266,12 +235,6 @@ export interface CommunityPoolSpendProposal { recipient: string; amount: Coin[]; } -export interface ReactiveCommunityPoolSpendProposal { - title: ComputedRef; - description: ComputedRef; - recipient: ComputedRef; - amount: ComputedRef; -} export interface CommunityPoolSpendProposalProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; value: Uint8Array; @@ -310,11 +273,6 @@ export interface DelegatorStartingInfo { stake: string; height: bigint; } -export interface ReactiveDelegatorStartingInfo { - previousPeriod: ComputedRef; - stake: ComputedRef; - height: ComputedRef; -} export interface DelegatorStartingInfoProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo"; value: Uint8Array; @@ -344,10 +302,6 @@ export interface DelegationDelegatorReward { validatorAddress: string; reward: DecCoin[]; } -export interface ReactiveDelegationDelegatorReward { - validatorAddress: ComputedRef; - reward: ComputedRef; -} export interface DelegationDelegatorRewardProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward"; value: Uint8Array; @@ -375,13 +329,6 @@ export interface CommunityPoolSpendProposalWithDeposit { amount: string; deposit: string; } -export interface ReactiveCommunityPoolSpendProposalWithDeposit { - title: ComputedRef; - description: ComputedRef; - recipient: ComputedRef; - amount: ComputedRef; - deposit: ComputedRef; -} export interface CommunityPoolSpendProposalWithDepositProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/genesis.ts index d2e56ee2..fe01c29b 100644 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/genesis.ts @@ -3,7 +3,6 @@ import { ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, Va import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * DelegatorWithdrawInfo is the address for where distributions rewards are * withdrawn to by default this struct is only used at genesis to feed in @@ -15,10 +14,6 @@ export interface DelegatorWithdrawInfo { /** withdraw_address is the address to withdraw the delegation rewards to. */ withdrawAddress: string; } -export interface ReactiveDelegatorWithdrawInfo { - delegatorAddress: ComputedRef; - withdrawAddress: ComputedRef; -} export interface DelegatorWithdrawInfoProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.DelegatorWithdrawInfo"; value: Uint8Array; @@ -45,10 +40,6 @@ export interface ValidatorOutstandingRewardsRecord { /** outstanding_rewards represents the outstanding rewards of a validator. */ outstandingRewards: DecCoin[]; } -export interface ReactiveValidatorOutstandingRewardsRecord { - validatorAddress: ComputedRef; - outstandingRewards: ComputedRef; -} export interface ValidatorOutstandingRewardsRecordProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord"; value: Uint8Array; @@ -74,10 +65,6 @@ export interface ValidatorAccumulatedCommissionRecord { /** accumulated is the accumulated commission of a validator. */ accumulated: ValidatorAccumulatedCommission; } -export interface ReactiveValidatorAccumulatedCommissionRecord { - validatorAddress: ComputedRef; - accumulated: ComputedRef; -} export interface ValidatorAccumulatedCommissionRecordProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord"; value: Uint8Array; @@ -108,11 +95,6 @@ export interface ValidatorHistoricalRewardsRecord { /** rewards defines the historical rewards of a validator. */ rewards: ValidatorHistoricalRewards; } -export interface ReactiveValidatorHistoricalRewardsRecord { - validatorAddress: ComputedRef; - period: ComputedRef; - rewards: ComputedRef; -} export interface ValidatorHistoricalRewardsRecordProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord"; value: Uint8Array; @@ -140,10 +122,6 @@ export interface ValidatorCurrentRewardsRecord { /** rewards defines the current rewards of a validator. */ rewards: ValidatorCurrentRewards; } -export interface ReactiveValidatorCurrentRewardsRecord { - validatorAddress: ComputedRef; - rewards: ComputedRef; -} export interface ValidatorCurrentRewardsRecordProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord"; value: Uint8Array; @@ -168,11 +146,6 @@ export interface DelegatorStartingInfoRecord { /** starting_info defines the starting info of a delegator. */ startingInfo: DelegatorStartingInfo; } -export interface ReactiveDelegatorStartingInfoRecord { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - startingInfo: ComputedRef; -} export interface DelegatorStartingInfoRecordProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfoRecord"; value: Uint8Array; @@ -201,12 +174,6 @@ export interface ValidatorSlashEventRecord { /** validator_slash_event describes the slash event. */ validatorSlashEvent: ValidatorSlashEvent; } -export interface ReactiveValidatorSlashEventRecord { - validatorAddress: ComputedRef; - height: ComputedRef; - period: ComputedRef; - validatorSlashEvent: ComputedRef; -} export interface ValidatorSlashEventRecordProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEventRecord"; value: Uint8Array; @@ -249,18 +216,6 @@ export interface GenesisState { /** fee_pool defines the validator slash events at genesis. */ validatorSlashEvents: ValidatorSlashEventRecord[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - feePool: ComputedRef; - delegatorWithdrawInfos: ComputedRef; - previousProposer: ComputedRef; - outstandingRewards: ComputedRef; - validatorAccumulatedCommissions: ComputedRef; - validatorHistoricalRewards: ComputedRef; - validatorCurrentRewards: ComputedRef; - delegatorStartingInfos: ComputedRef; - validatorSlashEvents: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 4053c305..00000000 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,448 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse, ReactiveQueryParamsRequest, ReactiveQueryValidatorDistributionInfoRequest, ReactiveQueryValidatorOutstandingRewardsRequest, ReactiveQueryValidatorCommissionRequest, ReactiveQueryValidatorSlashesRequest, ReactiveQueryDelegationRewardsRequest, ReactiveQueryDelegationTotalRewardsRequest, ReactiveQueryDelegatorValidatorsRequest, ReactiveQueryDelegatorWithdrawAddressRequest, ReactiveQueryCommunityPoolRequest } from "./query"; -/** Query defines the gRPC querier service for distribution module. */ -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): Promise; - /** ValidatorCommission queries accumulated commission for a validator. */ - validatorCommission(request: QueryValidatorCommissionRequest): Promise; - /** ValidatorSlashes queries slash events of a validator. */ - validatorSlashes(request: QueryValidatorSlashesRequest): Promise; - /** DelegationRewards queries the total rewards accrued by a delegation. */ - delegationRewards(request: QueryDelegationRewardsRequest): Promise; - /** - * DelegationTotalRewards queries the total rewards accrued by each - * validator. - */ - delegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise; - /** DelegatorValidators queries the validators of a delegator. */ - delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; - /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ - delegatorWithdrawAddress(request: QueryDelegatorWithdrawAddressRequest): Promise; - /** CommunityPool queries the community pool coins. */ - communityPool(request?: QueryCommunityPoolRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params queries params of the distribution module. */ - params = async (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 BinaryReader(data))); - }; - /* ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ - validatorDistributionInfo = async (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 BinaryReader(data))); - }; - /* ValidatorOutstandingRewards queries rewards of a validator address. */ - validatorOutstandingRewards = async (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 BinaryReader(data))); - }; - /* ValidatorCommission queries accumulated commission for a validator. */ - validatorCommission = async (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 BinaryReader(data))); - }; - /* ValidatorSlashes queries slash events of a validator. */ - validatorSlashes = async (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 BinaryReader(data))); - }; - /* DelegationRewards queries the total rewards accrued by a delegation. */ - delegationRewards = async (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 BinaryReader(data))); - }; - /* DelegationTotalRewards queries the total rewards accrued by each - validator. */ - delegationTotalRewards = async (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 BinaryReader(data))); - }; - /* DelegatorValidators queries the validators of a delegator. */ - delegatorValidators = async (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 BinaryReader(data))); - }; - /* DelegatorWithdrawAddress queries withdraw address of a delegator. */ - delegatorWithdrawAddress = async (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 BinaryReader(data))); - }; - /* CommunityPool queries the community pool coins. */ - communityPool = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise { - return queryService.validatorDistributionInfo(request); - }, - validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { - return queryService.validatorOutstandingRewards(request); - }, - validatorCommission(request: QueryValidatorCommissionRequest): Promise { - return queryService.validatorCommission(request); - }, - validatorSlashes(request: QueryValidatorSlashesRequest): Promise { - return queryService.validatorSlashes(request); - }, - delegationRewards(request: QueryDelegationRewardsRequest): Promise { - return queryService.delegationRewards(request); - }, - delegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise { - return queryService.delegationTotalRewards(request); - }, - delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { - return queryService.delegatorValidators(request); - }, - delegatorWithdrawAddress(request: QueryDelegatorWithdrawAddressRequest): Promise { - return queryService.delegatorWithdrawAddress(request); - }, - communityPool(request?: QueryCommunityPoolRequest): Promise { - return queryService.communityPool(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseValidatorDistributionInfoQuery extends VueQueryParams { - request: ReactiveQueryValidatorDistributionInfoRequest; -} -export interface UseValidatorOutstandingRewardsQuery extends VueQueryParams { - request: ReactiveQueryValidatorOutstandingRewardsRequest; -} -export interface UseValidatorCommissionQuery extends VueQueryParams { - request: ReactiveQueryValidatorCommissionRequest; -} -export interface UseValidatorSlashesQuery extends VueQueryParams { - request: ReactiveQueryValidatorSlashesRequest; -} -export interface UseDelegationRewardsQuery extends VueQueryParams { - request: ReactiveQueryDelegationRewardsRequest; -} -export interface UseDelegationTotalRewardsQuery extends VueQueryParams { - request: ReactiveQueryDelegationTotalRewardsRequest; -} -export interface UseDelegatorValidatorsQuery extends VueQueryParams { - request: ReactiveQueryDelegatorValidatorsRequest; -} -export interface UseDelegatorWithdrawAddressQuery extends VueQueryParams { - request: ReactiveQueryDelegatorWithdrawAddressRequest; -} -export interface UseCommunityPoolQuery extends VueQueryParams { - request?: ReactiveQueryCommunityPoolRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useValidatorDistributionInfo = ({ - request, - options - }: UseValidatorDistributionInfoQuery) => { - const queryKey = ["validatorDistributionInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorDistributionInfo(params); - }, - ...options - }); - }; - const useValidatorOutstandingRewards = ({ - request, - options - }: UseValidatorOutstandingRewardsQuery) => { - const queryKey = ["validatorOutstandingRewardsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorOutstandingRewards(params); - }, - ...options - }); - }; - const useValidatorCommission = ({ - request, - options - }: UseValidatorCommissionQuery) => { - const queryKey = ["validatorCommissionQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorCommission(params); - }, - ...options - }); - }; - const useValidatorSlashes = ({ - request, - options - }: UseValidatorSlashesQuery) => { - const queryKey = ["validatorSlashesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorSlashes(params); - }, - ...options - }); - }; - const useDelegationRewards = ({ - request, - options - }: UseDelegationRewardsQuery) => { - const queryKey = ["delegationRewardsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegationRewards(params); - }, - ...options - }); - }; - const useDelegationTotalRewards = ({ - request, - options - }: UseDelegationTotalRewardsQuery) => { - const queryKey = ["delegationTotalRewardsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegationTotalRewards(params); - }, - ...options - }); - }; - const useDelegatorValidators = ({ - request, - options - }: UseDelegatorValidatorsQuery) => { - const queryKey = ["delegatorValidatorsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorValidators(params); - }, - ...options - }); - }; - const useDelegatorWithdrawAddress = ({ - request, - options - }: UseDelegatorWithdrawAddressQuery) => { - const queryKey = ["delegatorWithdrawAddressQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorWithdrawAddress(params); - }, - ...options - }); - }; - const useCommunityPool = ({ - request, - options - }: UseCommunityPoolQuery) => { - const queryKey = ["communityPoolQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.communityPool(params); - }, - ...options - }); - }; - return { - /** Params queries params of the distribution module. */useParams, - /** ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */useValidatorDistributionInfo, - /** ValidatorOutstandingRewards queries rewards of a validator address. */useValidatorOutstandingRewards, - /** ValidatorCommission queries accumulated commission for a validator. */useValidatorCommission, - /** ValidatorSlashes queries slash events of a validator. */useValidatorSlashes, - /** DelegationRewards queries the total rewards accrued by a delegation. */useDelegationRewards, - /** - * DelegationTotalRewards queries the total rewards accrued by each - * validator. - */ - useDelegationTotalRewards, - /** DelegatorValidators queries the validators of a delegator. */useDelegatorValidators, - /** DelegatorWithdrawAddress queries withdraw address of a delegator. */useDelegatorWithdrawAddress, - /** CommunityPool queries the community pool coins. */useCommunityPool - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..68ef44b5 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.func.ts @@ -0,0 +1,72 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetValidatorDistributionInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorDistributionInfoRequest.encode, + decode: QueryValidatorDistributionInfoResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "ValidatorDistributionInfo", + clientResolver +}); +export const createGetValidatorOutstandingRewards = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorOutstandingRewardsRequest.encode, + decode: QueryValidatorOutstandingRewardsResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "ValidatorOutstandingRewards", + clientResolver +}); +export const createGetValidatorCommission = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorCommissionRequest.encode, + decode: QueryValidatorCommissionResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "ValidatorCommission", + clientResolver +}); +export const createGetValidatorSlashes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorSlashesRequest.encode, + decode: QueryValidatorSlashesResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "ValidatorSlashes", + clientResolver +}); +export const createGetDelegationRewards = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegationRewardsRequest.encode, + decode: QueryDelegationRewardsResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "DelegationRewards", + clientResolver +}); +export const createGetDelegationTotalRewards = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegationTotalRewardsRequest.encode, + decode: QueryDelegationTotalRewardsResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "DelegationTotalRewards", + clientResolver +}); +export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorsRequest.encode, + decode: QueryDelegatorValidatorsResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "DelegatorValidators", + clientResolver +}); +export const createGetDelegatorWithdrawAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorWithdrawAddressRequest.encode, + decode: QueryDelegatorWithdrawAddressResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "DelegatorWithdrawAddress", + clientResolver +}); +export const createGetCommunityPool = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCommunityPoolRequest.encode, + decode: QueryCommunityPoolResponse.decode, + service: "cosmos.distribution.v1beta1.Query", + method: "CommunityPool", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..5c8f9a60 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts @@ -0,0 +1,43 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; +import { createGetParams, createGetValidatorDistributionInfo, createGetValidatorOutstandingRewards, createGetValidatorCommission, createGetValidatorSlashes, createGetDelegationRewards, createGetDelegationTotalRewards, createGetDelegatorValidators, createGetDelegatorWithdrawAddress, createGetCommunityPool } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetValidatorDistributionInfo = buildUseVueQuery({ + builderQueryFn: createGetValidatorDistributionInfo, + queryKeyPrefix: "ValidatorDistributionInfoQuery" +}); +export const useGetValidatorOutstandingRewards = buildUseVueQuery({ + builderQueryFn: createGetValidatorOutstandingRewards, + queryKeyPrefix: "ValidatorOutstandingRewardsQuery" +}); +export const useGetValidatorCommission = buildUseVueQuery({ + builderQueryFn: createGetValidatorCommission, + queryKeyPrefix: "ValidatorCommissionQuery" +}); +export const useGetValidatorSlashes = buildUseVueQuery({ + builderQueryFn: createGetValidatorSlashes, + queryKeyPrefix: "ValidatorSlashesQuery" +}); +export const useGetDelegationRewards = buildUseVueQuery({ + builderQueryFn: createGetDelegationRewards, + queryKeyPrefix: "DelegationRewardsQuery" +}); +export const useGetDelegationTotalRewards = buildUseVueQuery({ + builderQueryFn: createGetDelegationTotalRewards, + queryKeyPrefix: "DelegationTotalRewardsQuery" +}); +export const useGetDelegatorValidators = buildUseVueQuery({ + builderQueryFn: createGetDelegatorValidators, + queryKeyPrefix: "DelegatorValidatorsQuery" +}); +export const useGetDelegatorWithdrawAddress = buildUseVueQuery({ + builderQueryFn: createGetDelegatorWithdrawAddress, + queryKeyPrefix: "DelegatorWithdrawAddressQuery" +}); +export const useGetCommunityPool = buildUseVueQuery({ + builderQueryFn: createGetCommunityPool, + queryKeyPrefix: "CommunityPoolQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.ts index fce0b219..0136cfd4 100644 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.ts @@ -4,10 +4,8 @@ import { DecCoin, DecCoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -23,9 +21,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -44,9 +39,6 @@ export interface QueryValidatorDistributionInfoRequest { /** validator_address defines the validator address to query for. */ validatorAddress: string; } -export interface ReactiveQueryValidatorDistributionInfoRequest { - validatorAddress: ComputedRef; -} export interface QueryValidatorDistributionInfoRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest"; value: Uint8Array; @@ -69,11 +61,6 @@ export interface QueryValidatorDistributionInfoResponse { /** commission defines the commission the validator received. */ commission: DecCoin[]; } -export interface ReactiveQueryValidatorDistributionInfoResponse { - operatorAddress: ComputedRef; - selfBondRewards: ComputedRef; - commission: ComputedRef; -} export interface QueryValidatorDistributionInfoResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse"; value: Uint8Array; @@ -99,9 +86,6 @@ export interface QueryValidatorOutstandingRewardsRequest { /** validator_address defines the validator address to query for. */ validatorAddress: string; } -export interface ReactiveQueryValidatorOutstandingRewardsRequest { - validatorAddress: ComputedRef; -} export interface QueryValidatorOutstandingRewardsRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest"; value: Uint8Array; @@ -125,9 +109,6 @@ export interface QueryValidatorOutstandingRewardsRequestAminoMsg { export interface QueryValidatorOutstandingRewardsResponse { rewards: ValidatorOutstandingRewards; } -export interface ReactiveQueryValidatorOutstandingRewardsResponse { - rewards: ComputedRef; -} export interface QueryValidatorOutstandingRewardsResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse"; value: Uint8Array; @@ -151,9 +132,6 @@ export interface QueryValidatorCommissionRequest { /** validator_address defines the validator address to query for. */ validatorAddress: string; } -export interface ReactiveQueryValidatorCommissionRequest { - validatorAddress: ComputedRef; -} export interface QueryValidatorCommissionRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest"; value: Uint8Array; @@ -178,9 +156,6 @@ export interface QueryValidatorCommissionResponse { /** commission defines the commission the validator received. */ commission: ValidatorAccumulatedCommission; } -export interface ReactiveQueryValidatorCommissionResponse { - commission: ComputedRef; -} export interface QueryValidatorCommissionResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse"; value: Uint8Array; @@ -211,12 +186,6 @@ export interface QueryValidatorSlashesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryValidatorSlashesRequest { - validatorAddress: ComputedRef; - startingHeight: ComputedRef; - endingHeight: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorSlashesRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest"; value: Uint8Array; @@ -249,10 +218,6 @@ export interface QueryValidatorSlashesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryValidatorSlashesResponse { - slashes: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorSlashesResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse"; value: Uint8Array; @@ -281,10 +246,6 @@ export interface QueryDelegationRewardsRequest { /** validator_address defines the validator address to query for. */ validatorAddress: string; } -export interface ReactiveQueryDelegationRewardsRequest { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; -} export interface QueryDelegationRewardsRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest"; value: Uint8Array; @@ -311,9 +272,6 @@ export interface QueryDelegationRewardsResponse { /** rewards defines the rewards accrued by a delegation. */ rewards: DecCoin[]; } -export interface ReactiveQueryDelegationRewardsResponse { - rewards: ComputedRef; -} export interface QueryDelegationRewardsResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse"; value: Uint8Array; @@ -338,9 +296,6 @@ export interface QueryDelegationTotalRewardsRequest { /** delegator_address defines the delegator address to query for. */ delegatorAddress: string; } -export interface ReactiveQueryDelegationTotalRewardsRequest { - delegatorAddress: ComputedRef; -} export interface QueryDelegationTotalRewardsRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest"; value: Uint8Array; @@ -367,10 +322,6 @@ export interface QueryDelegationTotalRewardsResponse { /** total defines the sum of all the rewards. */ total: DecCoin[]; } -export interface ReactiveQueryDelegationTotalRewardsResponse { - rewards: ComputedRef; - total: ComputedRef; -} export interface QueryDelegationTotalRewardsResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse"; value: Uint8Array; @@ -397,9 +348,6 @@ export interface QueryDelegatorValidatorsRequest { /** delegator_address defines the delegator address to query for. */ delegatorAddress: string; } -export interface ReactiveQueryDelegatorValidatorsRequest { - delegatorAddress: ComputedRef; -} export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest"; value: Uint8Array; @@ -424,9 +372,6 @@ export interface QueryDelegatorValidatorsResponse { /** validators defines the validators a delegator is delegating for. */ validators: string[]; } -export interface ReactiveQueryDelegatorValidatorsResponse { - validators: ComputedRef; -} export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse"; value: Uint8Array; @@ -451,9 +396,6 @@ export interface QueryDelegatorWithdrawAddressRequest { /** delegator_address defines the delegator address to query for. */ delegatorAddress: string; } -export interface ReactiveQueryDelegatorWithdrawAddressRequest { - delegatorAddress: ComputedRef; -} export interface QueryDelegatorWithdrawAddressRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest"; value: Uint8Array; @@ -478,9 +420,6 @@ export interface QueryDelegatorWithdrawAddressResponse { /** withdraw_address defines the delegator address to query for. */ withdrawAddress: string; } -export interface ReactiveQueryDelegatorWithdrawAddressResponse { - withdrawAddress: ComputedRef; -} export interface QueryDelegatorWithdrawAddressResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse"; value: Uint8Array; @@ -502,7 +441,6 @@ export interface QueryDelegatorWithdrawAddressResponseAminoMsg { * method. */ export interface QueryCommunityPoolRequest {} -export interface ReactiveQueryCommunityPoolRequest {} export interface QueryCommunityPoolRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolRequest"; value: Uint8Array; @@ -524,9 +462,6 @@ export interface QueryCommunityPoolResponse { /** pool defines community pool's coins. */ pool: DecCoin[]; } -export interface ReactiveQueryCommunityPoolResponse { - pool: ComputedRef; -} export interface QueryCommunityPoolResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.amino.ts deleted file mode 100644 index 34f6bac6..00000000 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; -export const AminoConverter = { - "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { - aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", - toAmino: MsgSetWithdrawAddress.toAmino, - fromAmino: MsgSetWithdrawAddress.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": { - aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", - toAmino: MsgWithdrawDelegatorReward.toAmino, - fromAmino: MsgWithdrawDelegatorReward.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": { - aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", - toAmino: MsgWithdrawValidatorCommission.toAmino, - fromAmino: MsgWithdrawValidatorCommission.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgFundCommunityPool": { - aminoType: "cosmos-sdk/MsgFundCommunityPool", - toAmino: MsgFundCommunityPool.toAmino, - fromAmino: MsgFundCommunityPool.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/distribution/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend": { - aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", - toAmino: MsgCommunityPoolSpend.toAmino, - fromAmino: MsgCommunityPoolSpend.fromAmino - }, - "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool": { - aminoType: "cosmos-sdk/distr/MsgDepositValRewards", - toAmino: MsgDepositValidatorRewardsPool.toAmino, - fromAmino: MsgDepositValidatorRewardsPool.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..0323b14d --- /dev/null +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetWithdrawAddress.typeUrl, + encoders: toEncoders(MsgSetWithdrawAddress), + converters: toConverters(MsgSetWithdrawAddress) +}); +export const createWithdrawDelegatorReward = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawDelegatorReward.typeUrl, + encoders: toEncoders(MsgWithdrawDelegatorReward), + converters: toConverters(MsgWithdrawDelegatorReward) +}); +export const createWithdrawValidatorCommission = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawValidatorCommission.typeUrl, + encoders: toEncoders(MsgWithdrawValidatorCommission), + converters: toConverters(MsgWithdrawValidatorCommission) +}); +export const createFundCommunityPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgFundCommunityPool.typeUrl, + encoders: toEncoders(MsgFundCommunityPool), + converters: toConverters(MsgFundCommunityPool) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCommunityPoolSpend.typeUrl, + encoders: toEncoders(MsgCommunityPoolSpend), + converters: toConverters(MsgCommunityPoolSpend) +}); +export const createDepositValidatorRewardsPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDepositValidatorRewardsPool.typeUrl, + encoders: toEncoders(MsgDepositValidatorRewardsPool), + converters: toConverters(MsgDepositValidatorRewardsPool) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index a6dd2617..00000000 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgDepositValidatorRewardsPool, MsgDepositValidatorRewardsPoolResponse } from "./tx"; -/** Msg defines the distribution Msg service. */ -export interface Msg { - /** - * SetWithdrawAddress defines a method to change the withdraw address - * for a delegator (or validator self-delegation). - */ - setWithdrawAddress(request: MsgSetWithdrawAddress): Promise; - /** - * WithdrawDelegatorReward defines a method to withdraw rewards of delegator - * from a single validator. - */ - withdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; - /** - * WithdrawValidatorCommission defines a method to withdraw the - * full commission to the validator address. - */ - withdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise; - /** - * FundCommunityPool defines a method to allow an account to directly - * fund the community pool. - */ - 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; - /** - * DepositValidatorRewardsPool defines a method to provide additional rewards - * to delegators to a specific validator. - * - * Since: cosmos-sdk 0.50 - */ - depositValidatorRewardsPool(request: MsgDepositValidatorRewardsPool): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SetWithdrawAddress defines a method to change the withdraw address - for a delegator (or validator self-delegation). */ - setWithdrawAddress = async (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 BinaryReader(data))); - }; - /* WithdrawDelegatorReward defines a method to withdraw rewards of delegator - from a single validator. */ - withdrawDelegatorReward = async (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 BinaryReader(data))); - }; - /* WithdrawValidatorCommission defines a method to withdraw the - full commission to the validator address. */ - withdrawValidatorCommission = async (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 BinaryReader(data))); - }; - /* FundCommunityPool defines a method to allow an account to directly - fund the community pool. */ - fundCommunityPool = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* DepositValidatorRewardsPool defines a method to provide additional rewards - to delegators to a specific validator. - - Since: cosmos-sdk 0.50 */ - depositValidatorRewardsPool = async (request: MsgDepositValidatorRewardsPool): Promise => { - const data = MsgDepositValidatorRewardsPool.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "DepositValidatorRewardsPool", data); - return promise.then(data => MsgDepositValidatorRewardsPoolResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..51d3ad25 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +export const useSetWithdrawAddress = buildUseVueMutation({ + builderMutationFn: createSetWithdrawAddress +}); +export const useWithdrawDelegatorReward = buildUseVueMutation({ + builderMutationFn: createWithdrawDelegatorReward +}); +export const useWithdrawValidatorCommission = buildUseVueMutation({ + builderMutationFn: createWithdrawValidatorCommission +}); +export const useFundCommunityPool = buildUseVueMutation({ + builderMutationFn: createFundCommunityPool +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useCommunityPoolSpend = buildUseVueMutation({ + builderMutationFn: createCommunityPoolSpend +}); +export const useDepositValidatorRewardsPool = buildUseVueMutation({ + builderMutationFn: createDepositValidatorRewardsPool +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.ts index ceb1dff7..64517d0b 100644 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Params, ParamsAmino } from "./distribution"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgSetWithdrawAddress sets the withdraw address for * a delegator (or validator self-delegation). @@ -12,10 +11,6 @@ export interface MsgSetWithdrawAddress { delegatorAddress: string; withdrawAddress: string; } -export interface ReactiveMsgSetWithdrawAddress { - delegatorAddress: ComputedRef; - withdrawAddress: ComputedRef; -} export interface MsgSetWithdrawAddressProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress"; value: Uint8Array; @@ -37,7 +32,6 @@ export interface MsgSetWithdrawAddressAminoMsg { * type. */ export interface MsgSetWithdrawAddressResponse {} -export interface ReactiveMsgSetWithdrawAddressResponse {} export interface MsgSetWithdrawAddressResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse"; value: Uint8Array; @@ -59,10 +53,6 @@ export interface MsgWithdrawDelegatorReward { delegatorAddress: string; validatorAddress: string; } -export interface ReactiveMsgWithdrawDelegatorReward { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; -} export interface MsgWithdrawDelegatorRewardProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"; value: Uint8Array; @@ -87,9 +77,6 @@ export interface MsgWithdrawDelegatorRewardResponse { /** Since: cosmos-sdk 0.46 */ amount: Coin[]; } -export interface ReactiveMsgWithdrawDelegatorRewardResponse { - amount: ComputedRef; -} export interface MsgWithdrawDelegatorRewardResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse"; value: Uint8Array; @@ -113,9 +100,6 @@ export interface MsgWithdrawDelegatorRewardResponseAminoMsg { export interface MsgWithdrawValidatorCommission { validatorAddress: string; } -export interface ReactiveMsgWithdrawValidatorCommission { - validatorAddress: ComputedRef; -} export interface MsgWithdrawValidatorCommissionProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"; value: Uint8Array; @@ -139,9 +123,6 @@ export interface MsgWithdrawValidatorCommissionResponse { /** Since: cosmos-sdk 0.46 */ amount: Coin[]; } -export interface ReactiveMsgWithdrawValidatorCommissionResponse { - amount: ComputedRef; -} export interface MsgWithdrawValidatorCommissionResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse"; value: Uint8Array; @@ -166,10 +147,6 @@ export interface MsgFundCommunityPool { amount: Coin[]; depositor: string; } -export interface ReactiveMsgFundCommunityPool { - amount: ComputedRef; - depositor: ComputedRef; -} export interface MsgFundCommunityPoolProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool"; value: Uint8Array; @@ -188,7 +165,6 @@ export interface MsgFundCommunityPoolAminoMsg { } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ export interface MsgFundCommunityPoolResponse {} -export interface ReactiveMsgFundCommunityPoolResponse {} export interface MsgFundCommunityPoolResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse"; value: Uint8Array; @@ -214,10 +190,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -248,7 +220,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -277,11 +248,6 @@ export interface MsgCommunityPoolSpend { recipient: string; amount: Coin[]; } -export interface ReactiveMsgCommunityPoolSpend { - authority: ComputedRef; - recipient: ComputedRef; - amount: ComputedRef; -} export interface MsgCommunityPoolSpendProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend"; value: Uint8Array; @@ -310,7 +276,6 @@ export interface MsgCommunityPoolSpendAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgCommunityPoolSpendResponse {} -export interface ReactiveMsgCommunityPoolSpendResponse {} export interface MsgCommunityPoolSpendResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse"; value: Uint8Array; @@ -337,11 +302,6 @@ export interface MsgDepositValidatorRewardsPool { validatorAddress: string; amount: Coin[]; } -export interface ReactiveMsgDepositValidatorRewardsPool { - depositor: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgDepositValidatorRewardsPoolProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool"; value: Uint8Array; @@ -368,7 +328,6 @@ export interface MsgDepositValidatorRewardsPoolAminoMsg { * Since: cosmos-sdk 0.50 */ export interface MsgDepositValidatorRewardsPoolResponse {} -export interface ReactiveMsgDepositValidatorRewardsPoolResponse {} export interface MsgDepositValidatorRewardsPoolResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/evidence/module/v1/module.ts b/libs/interchain-vue/src/cosmos/evidence/module/v1/module.ts index 961e85c7..39046e20 100644 --- a/libs/interchain-vue/src/cosmos/evidence/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/evidence/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object of the evidence module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.evidence.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/evidence.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/evidence.ts index fd728d74..1914d254 100644 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/evidence.ts +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/evidence.ts @@ -2,7 +2,6 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * Equivocation implements the Evidence interface and defines evidence of double * signing misbehavior. @@ -17,12 +16,6 @@ export interface Equivocation { /** consensus_address is the equivocation validator consensus address. */ consensusAddress: string; } -export interface ReactiveEquivocation { - height: ComputedRef; - time: ComputedRef; - power: ComputedRef; - consensusAddress: ComputedRef; -} export interface EquivocationProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.Equivocation"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/genesis.ts index 0756e3d6..447912a7 100644 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/genesis.ts @@ -2,15 +2,11 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** GenesisState defines the evidence module's genesis state. */ export interface GenesisState { /** evidence defines all the evidence at genesis. */ evidence: Any[]; } -export interface ReactiveGenesisState { - evidence: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.Query.ts deleted file mode 100644 index d67a9ebb..00000000 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse, ReactiveQueryEvidenceRequest, ReactiveQueryAllEvidenceRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Evidence queries evidence based on evidence hash. */ - evidence(request: QueryEvidenceRequest): Promise; - /** AllEvidence queries all evidence. */ - allEvidence(request?: QueryAllEvidenceRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Evidence queries evidence based on evidence hash. */ - evidence = async (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 BinaryReader(data))); - }; - /* AllEvidence queries all evidence. */ - allEvidence = async (request: QueryAllEvidenceRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - evidence(request: QueryEvidenceRequest): Promise { - return queryService.evidence(request); - }, - allEvidence(request?: QueryAllEvidenceRequest): Promise { - return queryService.allEvidence(request); - } - }; -}; -export interface UseEvidenceQuery extends VueQueryParams { - request: ReactiveQueryEvidenceRequest; -} -export interface UseAllEvidenceQuery extends VueQueryParams { - request?: ReactiveQueryAllEvidenceRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useEvidence = ({ - request, - options - }: UseEvidenceQuery) => { - const queryKey = ["evidenceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.evidence(params); - }, - ...options - }); - }; - const useAllEvidence = ({ - request, - options - }: UseAllEvidenceQuery) => { - const queryKey = ["allEvidenceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allEvidence(params); - }, - ...options - }); - }; - return { - /** Evidence queries evidence based on evidence hash. */useEvidence, - /** AllEvidence queries all evidence. */useAllEvidence - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..55ba061b --- /dev/null +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.func.ts @@ -0,0 +1,16 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse } from "./query"; +export const createGetEvidence = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryEvidenceRequest.encode, + decode: QueryEvidenceResponse.decode, + service: "cosmos.evidence.v1beta1.Query", + method: "Evidence", + clientResolver +}); +export const createGetAllEvidence = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllEvidenceRequest.encode, + decode: QueryAllEvidenceResponse.decode, + service: "cosmos.evidence.v1beta1.Query", + method: "AllEvidence", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..f370dfee --- /dev/null +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts @@ -0,0 +1,11 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse } from "./query"; +import { createGetEvidence, createGetAllEvidence } from "./query.rpc.func.ts"; +export const useGetEvidence = buildUseVueQuery({ + builderQueryFn: createGetEvidence, + queryKeyPrefix: "EvidenceQuery" +}); +export const useGetAllEvidence = buildUseVueQuery({ + builderQueryFn: createGetAllEvidence, + queryKeyPrefix: "AllEvidenceQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.ts index 78b4b304..f198ae95 100644 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.ts @@ -3,7 +3,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequest { /** @@ -19,10 +18,6 @@ export interface QueryEvidenceRequest { */ hash: string; } -export interface ReactiveQueryEvidenceRequest { - evidenceHash: ComputedRef; - hash: ComputedRef; -} export interface QueryEvidenceRequestProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryEvidenceRequest"; value: Uint8Array; @@ -51,9 +46,6 @@ export interface QueryEvidenceResponse { /** evidence returns the requested evidence. */ evidence?: Any; } -export interface ReactiveQueryEvidenceResponse { - evidence?: ComputedRef; -} export interface QueryEvidenceResponseProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryEvidenceResponse"; value: Uint8Array; @@ -75,9 +67,6 @@ export interface QueryAllEvidenceRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAllEvidenceRequest { - pagination?: ComputedRef; -} export interface QueryAllEvidenceRequestProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryAllEvidenceRequest"; value: Uint8Array; @@ -104,10 +93,6 @@ export interface QueryAllEvidenceResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAllEvidenceResponse { - evidence: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllEvidenceResponseProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryAllEvidenceResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.amino.ts deleted file mode 100644 index a9da4176..00000000 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.amino.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MsgSubmitEvidence } from "./tx"; -export const AminoConverter = { - "/cosmos.evidence.v1beta1.MsgSubmitEvidence": { - aminoType: "cosmos-sdk/MsgSubmitEvidence", - toAmino: MsgSubmitEvidence.toAmino, - fromAmino: MsgSubmitEvidence.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..873fedd9 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.func.ts @@ -0,0 +1,9 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitEvidence } from "./tx"; +export const createSubmitEvidence = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitEvidence.typeUrl, + encoders: toEncoders(MsgSubmitEvidence), + converters: toConverters(MsgSubmitEvidence) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 1daaaea0..00000000 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSubmitEvidence, MsgSubmitEvidenceResponse } from "./tx"; -/** Msg defines the evidence Msg service. */ -export interface Msg { - /** - * SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - * counterfactual signing. - */ - submitEvidence(request: MsgSubmitEvidence): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - counterfactual signing. */ - submitEvidence = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..b4a38940 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,6 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSubmitEvidence } from "./tx"; +import { createSubmitEvidence } from "./tx.rpc.func.ts"; +export const useSubmitEvidence = buildUseVueMutation({ + builderMutationFn: createSubmitEvidence +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.ts index 1b674bb0..dd8d0bc6 100644 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.ts @@ -2,7 +2,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgSubmitEvidence represents a message that supports submitting arbitrary * Evidence of misbehavior such as equivocation or counterfactual signing. @@ -13,10 +12,6 @@ export interface MsgSubmitEvidence { /** evidence defines the evidence of misbehavior. */ evidence?: Any | undefined; } -export interface ReactiveMsgSubmitEvidence { - submitter: ComputedRef; - evidence?: ComputedRef; -} export interface MsgSubmitEvidenceProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence"; value: Uint8Array; @@ -43,9 +38,6 @@ export interface MsgSubmitEvidenceResponse { /** hash defines the hash of the evidence. */ hash: Uint8Array; } -export interface ReactiveMsgSubmitEvidenceResponse { - hash: ComputedRef; -} export interface MsgSubmitEvidenceResponseProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/feegrant/module/v1/module.ts b/libs/interchain-vue/src/cosmos/feegrant/module/v1/module.ts index f7822bfc..a464a928 100644 --- a/libs/interchain-vue/src/cosmos/feegrant/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/feegrant/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object of the feegrant module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.feegrant.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/feegrant.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/feegrant.ts index d3b63e9d..b6417220 100644 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/feegrant.ts +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/feegrant.ts @@ -5,7 +5,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * BasicAllowance implements Allowance with a one-time grant of coins * that optionally expires. The grantee can use up to SpendLimit to cover fees. @@ -20,10 +19,6 @@ export interface BasicAllowance { /** expiration specifies an optional time when this allowance expires */ expiration?: Date; } -export interface ReactiveBasicAllowance { - spendLimit: ComputedRef; - expiration?: ComputedRef; -} export interface BasicAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance"; value: Uint8Array; @@ -72,13 +67,6 @@ export interface PeriodicAllowance { */ periodReset: Date; } -export interface ReactivePeriodicAllowance { - basic: ComputedRef; - period: ComputedRef; - periodSpendLimit: ComputedRef; - periodCanSpend: ComputedRef; - periodReset: ComputedRef; -} export interface PeriodicAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; value: Uint8Array; @@ -120,10 +108,6 @@ export interface AllowedMsgAllowance { /** allowed_messages are the messages for which the grantee has the access. */ allowedMessages: string[]; } -export interface ReactiveAllowedMsgAllowance { - allowance?: ComputedRef; - allowedMessages: ComputedRef; -} export interface AllowedMsgAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; value: Uint8Array; @@ -151,11 +135,6 @@ export interface Grant { /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any | undefined; } -export interface ReactiveGrant { - granter: ComputedRef; - grantee: ComputedRef; - allowance?: ComputedRef; -} export interface GrantProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.Grant"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/genesis.ts index 21ac8cde..4f884061 100644 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/genesis.ts @@ -2,14 +2,10 @@ import { Grant, GrantAmino } from "./feegrant"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisState { allowances: Grant[]; } -export interface ReactiveGenesisState { - allowances: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 0baeca1a..00000000 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse, ReactiveQueryAllowanceRequest, ReactiveQueryAllowancesRequest, ReactiveQueryAllowancesByGranterRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Allowance returns granted allwance to the grantee by the granter. */ - allowance(request: QueryAllowanceRequest): Promise; - /** Allowances returns all the grants for the given grantee address. */ - allowances(request: QueryAllowancesRequest): Promise; - /** - * AllowancesByGranter returns all the grants given by an address - * - * Since: cosmos-sdk 0.46 - */ - allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Allowance returns granted allwance to the grantee by the granter. */ - allowance = async (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 BinaryReader(data))); - }; - /* Allowances returns all the grants for the given grantee address. */ - allowances = async (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 BinaryReader(data))); - }; - /* AllowancesByGranter returns all the grants given by an address - - Since: cosmos-sdk 0.46 */ - allowancesByGranter = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - allowance(request: QueryAllowanceRequest): Promise { - return queryService.allowance(request); - }, - allowances(request: QueryAllowancesRequest): Promise { - return queryService.allowances(request); - }, - allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { - return queryService.allowancesByGranter(request); - } - }; -}; -export interface UseAllowanceQuery extends VueQueryParams { - request: ReactiveQueryAllowanceRequest; -} -export interface UseAllowancesQuery extends VueQueryParams { - request: ReactiveQueryAllowancesRequest; -} -export interface UseAllowancesByGranterQuery extends VueQueryParams { - request: ReactiveQueryAllowancesByGranterRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useAllowance = ({ - request, - options - }: UseAllowanceQuery) => { - const queryKey = ["allowanceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allowance(params); - }, - ...options - }); - }; - const useAllowances = ({ - request, - options - }: UseAllowancesQuery) => { - const queryKey = ["allowancesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allowances(params); - }, - ...options - }); - }; - const useAllowancesByGranter = ({ - request, - options - }: UseAllowancesByGranterQuery) => { - const queryKey = ["allowancesByGranterQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allowancesByGranter(params); - }, - ...options - }); - }; - return { - /** Allowance returns granted allwance to the grantee by the granter. */useAllowance, - /** Allowances returns all the grants for the given grantee address. */useAllowances, - /** - * AllowancesByGranter returns all the grants given by an address - * - * Since: cosmos-sdk 0.46 - */ - useAllowancesByGranter - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..ddf38cdf --- /dev/null +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.func.ts @@ -0,0 +1,23 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; +export const createGetAllowance = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllowanceRequest.encode, + decode: QueryAllowanceResponse.decode, + service: "cosmos.feegrant.v1beta1.Query", + method: "Allowance", + clientResolver +}); +export const createGetAllowances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllowancesRequest.encode, + decode: QueryAllowancesResponse.decode, + service: "cosmos.feegrant.v1beta1.Query", + method: "Allowances", + clientResolver +}); +export const createGetAllowancesByGranter = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllowancesByGranterRequest.encode, + decode: QueryAllowancesByGranterResponse.decode, + service: "cosmos.feegrant.v1beta1.Query", + method: "AllowancesByGranter", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..b4282d36 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; +import { createGetAllowance, createGetAllowances, createGetAllowancesByGranter } from "./query.rpc.func.ts"; +export const useGetAllowance = buildUseVueQuery({ + builderQueryFn: createGetAllowance, + queryKeyPrefix: "AllowanceQuery" +}); +export const useGetAllowances = buildUseVueQuery({ + builderQueryFn: createGetAllowances, + queryKeyPrefix: "AllowancesQuery" +}); +export const useGetAllowancesByGranter = buildUseVueQuery({ + builderQueryFn: createGetAllowancesByGranter, + queryKeyPrefix: "AllowancesByGranterQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.ts index 133c6cbd..e993e6fe 100644 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.ts @@ -3,7 +3,6 @@ import { Grant, GrantAmino } from "./feegrant"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ export interface QueryAllowanceRequest { /** granter is the address of the user granting an allowance of their funds. */ @@ -11,10 +10,6 @@ export interface QueryAllowanceRequest { /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; } -export interface ReactiveQueryAllowanceRequest { - granter: ComputedRef; - grantee: ComputedRef; -} export interface QueryAllowanceRequestProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest"; value: Uint8Array; @@ -35,9 +30,6 @@ export interface QueryAllowanceResponse { /** allowance is a allowance granted for grantee by granter. */ allowance?: Grant; } -export interface ReactiveQueryAllowanceResponse { - allowance?: ComputedRef; -} export interface QueryAllowanceResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse"; value: Uint8Array; @@ -57,10 +49,6 @@ export interface QueryAllowancesRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAllowancesRequest { - grantee: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllowancesRequestProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest"; value: Uint8Array; @@ -82,10 +70,6 @@ export interface QueryAllowancesResponse { /** pagination defines an pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAllowancesResponse { - allowances: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllowancesResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse"; value: Uint8Array; @@ -111,10 +95,6 @@ export interface QueryAllowancesByGranterRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAllowancesByGranterRequest { - granter: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllowancesByGranterRequestProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest"; value: Uint8Array; @@ -144,10 +124,6 @@ export interface QueryAllowancesByGranterResponse { /** pagination defines an pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAllowancesByGranterResponse { - allowances: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllowancesByGranterResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts deleted file mode 100644 index abc5f21a..00000000 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; -export const AminoConverter = { - "/cosmos.feegrant.v1beta1.MsgGrantAllowance": { - aminoType: "cosmos-sdk/MsgGrantAllowance", - toAmino: MsgGrantAllowance.toAmino, - fromAmino: MsgGrantAllowance.fromAmino - }, - "/cosmos.feegrant.v1beta1.MsgRevokeAllowance": { - aminoType: "cosmos-sdk/MsgRevokeAllowance", - toAmino: MsgRevokeAllowance.toAmino, - fromAmino: MsgRevokeAllowance.fromAmino - }, - "/cosmos.feegrant.v1beta1.MsgPruneAllowances": { - aminoType: "cosmos-sdk/MsgPruneAllowances", - toAmino: MsgPruneAllowances.toAmino, - fromAmino: MsgPruneAllowances.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..aa73f97f --- /dev/null +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +export const createGrantAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrantAllowance.typeUrl, + encoders: toEncoders(MsgGrantAllowance), + converters: toConverters(MsgGrantAllowance) +}); +export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeAllowance.typeUrl, + encoders: toEncoders(MsgRevokeAllowance), + converters: toConverters(MsgRevokeAllowance) +}); +export const createPruneAllowances = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAllowances.typeUrl, + encoders: toEncoders(MsgPruneAllowances), + converters: toConverters(MsgPruneAllowances) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 8f227710..00000000 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse, MsgPruneAllowances, MsgPruneAllowancesResponse } from "./tx"; -/** Msg defines the feegrant msg service. */ -export interface Msg { - /** - * GrantAllowance grants fee allowance to the grantee on the granter's - * account with the provided expiration time. - */ - grantAllowance(request: MsgGrantAllowance): Promise; - /** - * RevokeAllowance revokes any fee allowance of granter's account that - * has been granted to the grantee. - */ - revokeAllowance(request: MsgRevokeAllowance): Promise; - /** - * PruneAllowances prunes expired fee allowances, currently up to 75 at a time. - * - * Since cosmos-sdk 0.50 - */ - pruneAllowances(request: MsgPruneAllowances): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* GrantAllowance grants fee allowance to the grantee on the granter's - account with the provided expiration time. */ - grantAllowance = async (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 BinaryReader(data))); - }; - /* RevokeAllowance revokes any fee allowance of granter's account that - has been granted to the grantee. */ - revokeAllowance = async (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 BinaryReader(data))); - }; - /* PruneAllowances prunes expired fee allowances, currently up to 75 at a time. - - Since cosmos-sdk 0.50 */ - pruneAllowances = async (request: MsgPruneAllowances): Promise => { - const data = MsgPruneAllowances.encode(request).finish(); - const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "PruneAllowances", data); - return promise.then(data => MsgPruneAllowancesResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..1cf9e374 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,12 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +export const useGrantAllowance = buildUseVueMutation({ + builderMutationFn: createGrantAllowance +}); +export const useRevokeAllowance = buildUseVueMutation({ + builderMutationFn: createRevokeAllowance +}); +export const usePruneAllowances = buildUseVueMutation({ + builderMutationFn: createPruneAllowances +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.ts index 02de5f83..2056c984 100644 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { BasicAllowance, BasicAllowanceProtoMsg, PeriodicAllowance, PeriodicAllo import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgGrantAllowance adds permission for Grantee to spend up to Allowance * of fees from the account of Granter. @@ -16,11 +15,6 @@ export interface MsgGrantAllowance { /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any | undefined; } -export interface ReactiveMsgGrantAllowance { - granter: ComputedRef; - grantee: ComputedRef; - allowance?: ComputedRef; -} export interface MsgGrantAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; value: Uint8Array; @@ -46,7 +40,6 @@ export interface MsgGrantAllowanceAminoMsg { } /** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ export interface MsgGrantAllowanceResponse {} -export interface ReactiveMsgGrantAllowanceResponse {} export interface MsgGrantAllowanceResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse"; value: Uint8Array; @@ -64,10 +57,6 @@ export interface MsgRevokeAllowance { /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; } -export interface ReactiveMsgRevokeAllowance { - granter: ComputedRef; - grantee: ComputedRef; -} export interface MsgRevokeAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance"; value: Uint8Array; @@ -85,7 +74,6 @@ export interface MsgRevokeAllowanceAminoMsg { } /** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ export interface MsgRevokeAllowanceResponse {} -export interface ReactiveMsgRevokeAllowanceResponse {} export interface MsgRevokeAllowanceResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse"; value: Uint8Array; @@ -105,9 +93,6 @@ export interface MsgPruneAllowances { /** pruner is the address of the user pruning expired allowances. */ pruner: string; } -export interface ReactiveMsgPruneAllowances { - pruner: ComputedRef; -} export interface MsgPruneAllowancesProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances"; value: Uint8Array; @@ -131,7 +116,6 @@ export interface MsgPruneAllowancesAminoMsg { * Since cosmos-sdk 0.50 */ export interface MsgPruneAllowancesResponse {} -export interface ReactiveMsgPruneAllowancesResponse {} export interface MsgPruneAllowancesResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/genutil/module/v1/module.ts b/libs/interchain-vue/src/cosmos/genutil/module/v1/module.ts index 902fd4de..1c8ed35c 100644 --- a/libs/interchain-vue/src/cosmos/genutil/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/genutil/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object for the genutil module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.genutil.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/genutil/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/genutil/v1beta1/genesis.ts index f099a944..9d996fbe 100644 --- a/libs/interchain-vue/src/cosmos/genutil/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/genutil/v1beta1/genesis.ts @@ -1,15 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** GenesisState defines the raw genesis transaction in JSON. */ export interface GenesisState { /** gen_txs defines the genesis transactions. */ genTxs: Uint8Array[]; } -export interface ReactiveGenesisState { - genTxs: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.genutil.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/module/v1/module.ts b/libs/interchain-vue/src/cosmos/gov/module/v1/module.ts index 728c63f4..bbc5e597 100644 --- a/libs/interchain-vue/src/cosmos/gov/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/gov/module/v1/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the gov module. */ export interface Module { /** @@ -12,10 +11,6 @@ export interface Module { /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - maxMetadataLen: ComputedRef; - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.gov.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1/genesis.ts b/libs/interchain-vue/src/cosmos/gov/v1/genesis.ts index 6f46325a..9baead60 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1/genesis.ts @@ -2,7 +2,6 @@ import { Deposit, DepositAmino, Vote, VoteAmino, Proposal, ProposalAmino, Deposi import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ @@ -47,17 +46,6 @@ export interface GenesisState { */ constitution: string; } -export interface ReactiveGenesisState { - startingProposalId: ComputedRef; - deposits: ComputedRef; - votes: ComputedRef; - proposals: ComputedRef; - depositParams?: ComputedRef; - votingParams?: ComputedRef; - tallyParams?: ComputedRef; - params?: ComputedRef; - constitution: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.gov.v1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1/gov.ts b/libs/interchain-vue/src/cosmos/gov/v1/gov.ts index 0cfe2aa1..434920f3 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1/gov.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1/gov.ts @@ -5,7 +5,6 @@ import { Duration, DurationAmino } from "../../../google/protobuf/duration"; import { isSet, DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** 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. */ @@ -145,10 +144,6 @@ export interface WeightedVoteOption { /** weight is the vote weight associated with the vote option. */ weight: string; } -export interface ReactiveWeightedVoteOption { - option: ComputedRef; - weight: ComputedRef; -} export interface WeightedVoteOptionProtoMsg { typeUrl: "/cosmos.gov.v1.WeightedVoteOption"; value: Uint8Array; @@ -176,11 +171,6 @@ export interface Deposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface DepositProtoMsg { typeUrl: "/cosmos.gov.v1.Deposit"; value: Uint8Array; @@ -262,23 +252,6 @@ export interface Proposal { */ failedReason: string; } -export interface ReactiveProposal { - id: ComputedRef; - messages: ComputedRef; - status: ComputedRef; - finalTallyResult?: ComputedRef; - submitTime?: ComputedRef; - depositEndTime?: ComputedRef; - totalDeposit: ComputedRef; - votingStartTime?: ComputedRef; - votingEndTime?: ComputedRef; - metadata: ComputedRef; - title: ComputedRef; - summary: ComputedRef; - proposer: ComputedRef; - expedited: ComputedRef; - failedReason: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/cosmos.gov.v1.Proposal"; value: Uint8Array; @@ -359,12 +332,6 @@ export interface TallyResult { /** no_with_veto_count is the number of no with veto votes on a proposal. */ noWithVetoCount: string; } -export interface ReactiveTallyResult { - yesCount: ComputedRef; - abstainCount: ComputedRef; - noCount: ComputedRef; - noWithVetoCount: ComputedRef; -} export interface TallyResultProtoMsg { typeUrl: "/cosmos.gov.v1.TallyResult"; value: Uint8Array; @@ -401,12 +368,6 @@ export interface Vote { */ metadata: string; } -export interface ReactiveVote { - proposalId: ComputedRef; - voter: ComputedRef; - options: ComputedRef; - metadata: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/cosmos.gov.v1.Vote"; value: Uint8Array; @@ -443,10 +404,6 @@ export interface DepositParams { */ maxDepositPeriod?: Duration; } -export interface ReactiveDepositParams { - minDeposit: ComputedRef; - maxDepositPeriod?: ComputedRef; -} export interface DepositParamsProtoMsg { typeUrl: "/cosmos.gov.v1.DepositParams"; value: Uint8Array; @@ -472,9 +429,6 @@ export interface VotingParams { /** Duration of the voting period. */ votingPeriod?: Duration; } -export interface ReactiveVotingParams { - votingPeriod?: ComputedRef; -} export interface VotingParamsProtoMsg { typeUrl: "/cosmos.gov.v1.VotingParams"; value: Uint8Array; @@ -505,11 +459,6 @@ export interface TallyParams { */ vetoThreshold: string; } -export interface ReactiveTallyParams { - quorum: ComputedRef; - threshold: ComputedRef; - vetoThreshold: ComputedRef; -} export interface TallyParamsProtoMsg { typeUrl: "/cosmos.gov.v1.TallyParams"; value: Uint8Array; @@ -605,24 +554,6 @@ export interface Params { */ minDepositRatio: string; } -export interface ReactiveParams { - minDeposit: ComputedRef; - maxDepositPeriod?: ComputedRef; - votingPeriod?: ComputedRef; - quorum: ComputedRef; - threshold: ComputedRef; - vetoThreshold: ComputedRef; - minInitialDepositRatio: ComputedRef; - proposalCancelRatio: ComputedRef; - proposalCancelDest: ComputedRef; - expeditedVotingPeriod?: ComputedRef; - expeditedThreshold: ComputedRef; - expeditedMinDeposit: ComputedRef; - burnVoteQuorum: ComputedRef; - burnProposalDepositPrevote: ComputedRef; - burnVoteVeto: ComputedRef; - minDepositRatio: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.gov.v1.Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.Query.ts deleted file mode 100644 index 1c731a88..00000000 --- a/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.Query.ts +++ /dev/null @@ -1,400 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse, ReactiveQueryConstitutionRequest, ReactiveQueryProposalRequest, ReactiveQueryProposalsRequest, ReactiveQueryVoteRequest, ReactiveQueryVotesRequest, ReactiveQueryParamsRequest, ReactiveQueryDepositRequest, ReactiveQueryDepositsRequest, ReactiveQueryTallyResultRequest } from "./query"; -/** Query defines the gRPC querier service for gov module */ -export interface Query { - /** Constitution queries the chain's constitution. */ - constitution(request?: QueryConstitutionRequest): Promise; - /** 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 on 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Constitution queries the chain's constitution. */ - constitution = async (request: QueryConstitutionRequest = {}): Promise => { - const data = QueryConstitutionRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1.Query", "Constitution", data); - return promise.then(data => QueryConstitutionResponse.decode(new BinaryReader(data))); - }; - /* Proposal queries proposal details based on ProposalID. */ - proposal = async (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 BinaryReader(data))); - }; - /* Proposals queries all proposals based on given status. */ - proposals = async (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 BinaryReader(data))); - }; - /* Vote queries voted information based on proposalID, voterAddr. */ - vote = async (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 BinaryReader(data))); - }; - /* Votes queries votes of a given proposal. */ - votes = async (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 BinaryReader(data))); - }; - /* Params queries all parameters of the gov module. */ - params = async (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 BinaryReader(data))); - }; - /* Deposit queries single deposit information based on proposalID, depositAddr. */ - deposit = async (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 BinaryReader(data))); - }; - /* Deposits queries all deposits of a single proposal. */ - deposits = async (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 BinaryReader(data))); - }; - /* TallyResult queries the tally of a proposal vote. */ - tallyResult = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - constitution(request?: QueryConstitutionRequest): Promise { - return queryService.constitution(request); - }, - proposal(request: QueryProposalRequest): Promise { - return queryService.proposal(request); - }, - proposals(request: QueryProposalsRequest): Promise { - return queryService.proposals(request); - }, - vote(request: QueryVoteRequest): Promise { - return queryService.vote(request); - }, - votes(request: QueryVotesRequest): Promise { - return queryService.votes(request); - }, - params(request: QueryParamsRequest): Promise { - return queryService.params(request); - }, - deposit(request: QueryDepositRequest): Promise { - return queryService.deposit(request); - }, - deposits(request: QueryDepositsRequest): Promise { - return queryService.deposits(request); - }, - tallyResult(request: QueryTallyResultRequest): Promise { - return queryService.tallyResult(request); - } - }; -}; -export interface UseConstitutionQuery extends VueQueryParams { - request?: ReactiveQueryConstitutionRequest; -} -export interface UseProposalQuery extends VueQueryParams { - request: ReactiveQueryProposalRequest; -} -export interface UseProposalsQuery extends VueQueryParams { - request: ReactiveQueryProposalsRequest; -} -export interface UseVoteQuery extends VueQueryParams { - request: ReactiveQueryVoteRequest; -} -export interface UseVotesQuery extends VueQueryParams { - request: ReactiveQueryVotesRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request: ReactiveQueryParamsRequest; -} -export interface UseDepositQuery extends VueQueryParams { - request: ReactiveQueryDepositRequest; -} -export interface UseDepositsQuery extends VueQueryParams { - request: ReactiveQueryDepositsRequest; -} -export interface UseTallyResultQuery extends VueQueryParams { - request: ReactiveQueryTallyResultRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useConstitution = ({ - request, - options - }: UseConstitutionQuery) => { - const queryKey = ["constitutionQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.constitution(params); - }, - ...options - }); - }; - const useProposal = ({ - request, - options - }: UseProposalQuery) => { - const queryKey = ["proposalQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposal(params); - }, - ...options - }); - }; - const useProposals = ({ - request, - options - }: UseProposalsQuery) => { - const queryKey = ["proposalsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposals(params); - }, - ...options - }); - }; - const useVote = ({ - request, - options - }: UseVoteQuery) => { - const queryKey = ["voteQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.vote(params); - }, - ...options - }); - }; - const useVotes = ({ - request, - options - }: UseVotesQuery) => { - const queryKey = ["votesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.votes(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useDeposit = ({ - request, - options - }: UseDepositQuery) => { - const queryKey = ["depositQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.deposit(params); - }, - ...options - }); - }; - const useDeposits = ({ - request, - options - }: UseDepositsQuery) => { - const queryKey = ["depositsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.deposits(params); - }, - ...options - }); - }; - const useTallyResult = ({ - request, - options - }: UseTallyResultQuery) => { - const queryKey = ["tallyResultQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.tallyResult(params); - }, - ...options - }); - }; - return { - /** Constitution queries the chain's constitution. */useConstitution, - /** Proposal queries proposal details based on ProposalID. */useProposal, - /** Proposals queries all proposals based on given status. */useProposals, - /** Vote queries voted information based on proposalID, voterAddr. */useVote, - /** Votes queries votes of a given proposal. */useVotes, - /** Params queries all parameters of the gov module. */useParams, - /** Deposit queries single deposit information based on proposalID, depositAddr. */useDeposit, - /** Deposits queries all deposits of a single proposal. */useDeposits, - /** TallyResult queries the tally of a proposal vote. */useTallyResult - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.func.ts new file mode 100644 index 00000000..187a8cbc --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.func.ts @@ -0,0 +1,65 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +export const createGetConstitution = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryConstitutionRequest.encode, + decode: QueryConstitutionResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Constitution", + clientResolver +}); +export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalRequest.encode, + decode: QueryProposalResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Proposal", + clientResolver +}); +export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalsRequest.encode, + decode: QueryProposalsResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Proposals", + clientResolver +}); +export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVoteRequest.encode, + decode: QueryVoteResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Vote", + clientResolver +}); +export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVotesRequest.encode, + decode: QueryVotesResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Votes", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Params", + clientResolver +}); +export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositRequest.encode, + decode: QueryDepositResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Deposit", + clientResolver +}); +export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositsRequest.encode, + decode: QueryDepositsResponse.decode, + service: "cosmos.gov.v1.Query", + method: "Deposits", + clientResolver +}); +export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTallyResultRequest.encode, + decode: QueryTallyResultResponse.decode, + service: "cosmos.gov.v1.Query", + method: "TallyResult", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts new file mode 100644 index 00000000..cc87fbbc --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts @@ -0,0 +1,39 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +import { createGetConstitution, createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +export const useGetConstitution = buildUseVueQuery({ + builderQueryFn: createGetConstitution, + queryKeyPrefix: "ConstitutionQuery" +}); +export const useGetProposal = buildUseVueQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposals = buildUseVueQuery({ + builderQueryFn: createGetProposals, + queryKeyPrefix: "ProposalsQuery" +}); +export const useGetVote = buildUseVueQuery({ + builderQueryFn: createGetVote, + queryKeyPrefix: "VoteQuery" +}); +export const useGetVotes = buildUseVueQuery({ + builderQueryFn: createGetVotes, + queryKeyPrefix: "VotesQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDeposit = buildUseVueQuery({ + builderQueryFn: createGetDeposit, + queryKeyPrefix: "DepositQuery" +}); +export const useGetDeposits = buildUseVueQuery({ + builderQueryFn: createGetDeposits, + queryKeyPrefix: "DepositsQuery" +}); +export const useGetTallyResult = buildUseVueQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1/query.ts b/libs/interchain-vue/src/cosmos/gov/v1/query.ts index b9b11668..f435528f 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1/query.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1/query.ts @@ -3,10 +3,8 @@ import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from " import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryConstitutionRequest is the request type for the Query/Constitution RPC method */ export interface QueryConstitutionRequest {} -export interface ReactiveQueryConstitutionRequest {} export interface QueryConstitutionRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryConstitutionRequest"; value: Uint8Array; @@ -21,9 +19,6 @@ export interface QueryConstitutionRequestAminoMsg { export interface QueryConstitutionResponse { constitution: string; } -export interface ReactiveQueryConstitutionResponse { - constitution: ComputedRef; -} export interface QueryConstitutionResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryConstitutionResponse"; value: Uint8Array; @@ -41,9 +36,6 @@ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveQueryProposalRequest { - proposalId: ComputedRef; -} export interface QueryProposalRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalRequest"; value: Uint8Array; @@ -62,9 +54,6 @@ export interface QueryProposalResponse { /** proposal is the requested governance proposal. */ proposal?: Proposal; } -export interface ReactiveQueryProposalResponse { - proposal?: ComputedRef; -} export interface QueryProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalResponse"; value: Uint8Array; @@ -89,12 +78,6 @@ export interface QueryProposalsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryProposalsRequest { - proposalStatus: ComputedRef; - voter: ComputedRef; - depositor: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalsRequest"; value: Uint8Array; @@ -124,10 +107,6 @@ export interface QueryProposalsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryProposalsResponse { - proposals: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalsResponse"; value: Uint8Array; @@ -153,10 +132,6 @@ export interface QueryVoteRequest { /** voter defines the voter address for the proposals. */ voter: string; } -export interface ReactiveQueryVoteRequest { - proposalId: ComputedRef; - voter: ComputedRef; -} export interface QueryVoteRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryVoteRequest"; value: Uint8Array; @@ -177,9 +152,6 @@ export interface QueryVoteResponse { /** vote defines the queried vote. */ vote?: Vote; } -export interface ReactiveQueryVoteResponse { - vote?: ComputedRef; -} export interface QueryVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryVoteResponse"; value: Uint8Array; @@ -200,10 +172,6 @@ export interface QueryVotesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryVotesRequest { - proposalId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryVotesRequest"; value: Uint8Array; @@ -226,10 +194,6 @@ export interface QueryVotesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryVotesResponse { - votes: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryVotesResponse"; value: Uint8Array; @@ -253,9 +217,6 @@ export interface QueryParamsRequest { */ paramsType: string; } -export interface ReactiveQueryParamsRequest { - paramsType: ComputedRef; -} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryParamsRequest"; value: Uint8Array; @@ -299,12 +260,6 @@ export interface QueryParamsResponse { */ params?: Params; } -export interface ReactiveQueryParamsResponse { - votingParams?: ComputedRef; - depositParams?: ComputedRef; - tallyParams?: ComputedRef; - params?: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryParamsResponse"; value: Uint8Array; @@ -347,10 +302,6 @@ export interface QueryDepositRequest { /** depositor defines the deposit addresses from the proposals. */ depositor: string; } -export interface ReactiveQueryDepositRequest { - proposalId: ComputedRef; - depositor: ComputedRef; -} export interface QueryDepositRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryDepositRequest"; value: Uint8Array; @@ -371,9 +322,6 @@ export interface QueryDepositResponse { /** deposit defines the requested deposit. */ deposit?: Deposit; } -export interface ReactiveQueryDepositResponse { - deposit?: ComputedRef; -} export interface QueryDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryDepositResponse"; value: Uint8Array; @@ -394,10 +342,6 @@ export interface QueryDepositsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDepositsRequest { - proposalId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDepositsRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryDepositsRequest"; value: Uint8Array; @@ -420,10 +364,6 @@ export interface QueryDepositsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDepositsResponse { - deposits: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDepositsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryDepositsResponse"; value: Uint8Array; @@ -444,9 +384,6 @@ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveQueryTallyResultRequest { - proposalId: ComputedRef; -} export interface QueryTallyResultRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest"; value: Uint8Array; @@ -465,9 +402,6 @@ export interface QueryTallyResultResponse { /** tally defines the requested tally. */ tally?: TallyResult; } -export interface ReactiveQueryTallyResultResponse { - tally?: ComputedRef; -} export interface QueryTallyResultResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1/tx.amino.ts b/libs/interchain-vue/src/cosmos/gov/v1/tx.amino.ts deleted file mode 100644 index 6b91907b..00000000 --- a/libs/interchain-vue/src/cosmos/gov/v1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; -export const AminoConverter = { - "/cosmos.gov.v1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/v1/MsgSubmitProposal", - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino - }, - "/cosmos.gov.v1.MsgExecLegacyContent": { - aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", - toAmino: MsgExecLegacyContent.toAmino, - fromAmino: MsgExecLegacyContent.fromAmino - }, - "/cosmos.gov.v1.MsgVote": { - aminoType: "cosmos-sdk/v1/MsgVote", - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino - }, - "/cosmos.gov.v1.MsgVoteWeighted": { - aminoType: "cosmos-sdk/v1/MsgVoteWeighted", - toAmino: MsgVoteWeighted.toAmino, - fromAmino: MsgVoteWeighted.fromAmino - }, - "/cosmos.gov.v1.MsgDeposit": { - aminoType: "cosmos-sdk/v1/MsgDeposit", - toAmino: MsgDeposit.toAmino, - fromAmino: MsgDeposit.fromAmino - }, - "/cosmos.gov.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/gov/v1/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmos.gov.v1.MsgCancelProposal": { - aminoType: "cosmos-sdk/v1/MsgCancelProposal", - toAmino: MsgCancelProposal.toAmino, - fromAmino: MsgCancelProposal.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.func.ts new file mode 100644 index 00000000..0fe35d3a --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createExecLegacyContent = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecLegacyContent.typeUrl, + encoders: toEncoders(MsgExecLegacyContent), + converters: toConverters(MsgExecLegacyContent) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCancelProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelProposal.typeUrl, + encoders: toEncoders(MsgCancelProposal), + converters: toConverters(MsgCancelProposal) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.msg.ts deleted file mode 100644 index 9112b3d9..00000000 --- a/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgExecLegacyContent, MsgExecLegacyContentResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCancelProposal, MsgCancelProposalResponse } from "./tx"; -/** 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; - /** - * CancelProposal defines a method to cancel governance proposal - * - * Since: cosmos-sdk 0.50 - */ - cancelProposal(request: MsgCancelProposal): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SubmitProposal defines a method to create new proposal given the messages. */ - submitProposal = async (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 BinaryReader(data))); - }; - /* ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - to execute a legacy content-based proposal. */ - execLegacyContent = async (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 BinaryReader(data))); - }; - /* Vote defines a method to add a vote on a specific proposal. */ - vote = async (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 BinaryReader(data))); - }; - /* VoteWeighted defines a method to add a weighted vote on a specific proposal. */ - voteWeighted = async (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 BinaryReader(data))); - }; - /* Deposit defines a method to add deposit on a specific proposal. */ - deposit = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* CancelProposal defines a method to cancel governance proposal - - Since: cosmos-sdk 0.50 */ - cancelProposal = async (request: MsgCancelProposal): Promise => { - const data = MsgCancelProposal.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1.Msg", "CancelProposal", data); - return promise.then(data => MsgCancelProposalResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..603f5139 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseVueMutation({ + builderMutationFn: createSubmitProposal +}); +export const useExecLegacyContent = buildUseVueMutation({ + builderMutationFn: createExecLegacyContent +}); +export const useVote = buildUseVueMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseVueMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseVueMutation({ + builderMutationFn: createDeposit +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useCancelProposal = buildUseVueMutation({ + builderMutationFn: createCancelProposal +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1/tx.ts b/libs/interchain-vue/src/cosmos/gov/v1/tx.ts index e1df4153..0aea3ac2 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1/tx.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1/tx.ts @@ -9,7 +9,6 @@ import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwar import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. @@ -42,15 +41,6 @@ export interface MsgSubmitProposal { */ expedited: boolean; } -export interface ReactiveMsgSubmitProposal { - messages: ComputedRef; - initialDeposit: ComputedRef; - proposer: ComputedRef; - metadata: ComputedRef; - title: ComputedRef; - summary: ComputedRef; - expedited: ComputedRef; -} export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal"; value: Uint8Array; @@ -96,9 +86,6 @@ export interface MsgSubmitProposalResponse { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveMsgSubmitProposalResponse { - proposalId: ComputedRef; -} export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; value: Uint8Array; @@ -122,10 +109,6 @@ export interface MsgExecLegacyContent { /** authority must be the gov module address. */ authority: string; } -export interface ReactiveMsgExecLegacyContent { - content?: ComputedRef; - authority: ComputedRef; -} export interface MsgExecLegacyContentProtoMsg { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; value: Uint8Array; @@ -149,7 +132,6 @@ export interface MsgExecLegacyContentAminoMsg { } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponse {} -export interface ReactiveMsgExecLegacyContentResponse {} export interface MsgExecLegacyContentResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; value: Uint8Array; @@ -171,12 +153,6 @@ export interface MsgVote { /** metadata is any arbitrary metadata attached to the Vote. */ metadata: string; } -export interface ReactiveMsgVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - metadata: ComputedRef; -} export interface MsgVoteProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVote"; value: Uint8Array; @@ -198,7 +174,6 @@ export interface MsgVoteAminoMsg { } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponse {} -export interface ReactiveMsgVoteResponse {} export interface MsgVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; value: Uint8Array; @@ -220,12 +195,6 @@ export interface MsgVoteWeighted { /** metadata is any arbitrary metadata attached to the VoteWeighted. */ metadata: string; } -export interface ReactiveMsgVoteWeighted { - proposalId: ComputedRef; - voter: ComputedRef; - options: ComputedRef; - metadata: ComputedRef; -} export interface MsgVoteWeightedProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted"; value: Uint8Array; @@ -247,7 +216,6 @@ export interface MsgVoteWeightedAminoMsg { } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponse {} -export interface ReactiveMsgVoteWeightedResponse {} export interface MsgVoteWeightedResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; value: Uint8Array; @@ -267,11 +235,6 @@ export interface MsgDeposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveMsgDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface MsgDepositProtoMsg { typeUrl: "/cosmos.gov.v1.MsgDeposit"; value: Uint8Array; @@ -291,7 +254,6 @@ export interface MsgDepositAminoMsg { } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponse {} -export interface ReactiveMsgDepositResponse {} export interface MsgDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; value: Uint8Array; @@ -317,10 +279,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.gov.v1.MsgUpdateParams"; value: Uint8Array; @@ -351,7 +309,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -378,10 +335,6 @@ export interface MsgCancelProposal { /** proposer is the account address of the proposer. */ proposer: string; } -export interface ReactiveMsgCancelProposal { - proposalId: ComputedRef; - proposer: ComputedRef; -} export interface MsgCancelProposalProtoMsg { typeUrl: "/cosmos.gov.v1.MsgCancelProposal"; value: Uint8Array; @@ -415,11 +368,6 @@ export interface MsgCancelProposalResponse { /** canceled_height defines the block height at which the proposal is canceled. */ canceledHeight: bigint; } -export interface ReactiveMsgCancelProposalResponse { - proposalId: ComputedRef; - canceledTime: ComputedRef; - canceledHeight: ComputedRef; -} export interface MsgCancelProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/genesis.ts index 36f2b38b..8212faf5 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Deposit, DepositAmino, Vote, VoteAmino, Proposal, ProposalAmino, Deposi import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ @@ -20,15 +19,6 @@ export interface GenesisState { /** tally_params defines all the parameters related to tally. */ tallyParams: TallyParams; } -export interface ReactiveGenesisState { - startingProposalId: ComputedRef; - deposits: ComputedRef; - votes: ComputedRef; - proposals: ComputedRef; - depositParams: ComputedRef; - votingParams: ComputedRef; - tallyParams: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.gov.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/gov.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/gov.ts index 0a70fe9e..fe73180b 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/gov.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/gov.ts @@ -8,7 +8,6 @@ import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwar import { isSet, DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** 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. */ @@ -152,10 +151,6 @@ export interface WeightedVoteOption { /** weight is the vote weight associated with the vote option. */ weight: string; } -export interface ReactiveWeightedVoteOption { - option: ComputedRef; - weight: ComputedRef; -} export interface WeightedVoteOptionProtoMsg { typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption"; value: Uint8Array; @@ -185,10 +180,6 @@ export interface TextProposal { /** description associated with the proposal. */ description: string; } -export interface ReactiveTextProposal { - title: ComputedRef; - description: ComputedRef; -} export interface TextProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TextProposal"; value: Uint8Array; @@ -219,11 +210,6 @@ export interface Deposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface DepositProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Deposit"; value: Uint8Array; @@ -269,17 +255,6 @@ export interface Proposal { /** voting_end_time is the end time of voting on a proposal. */ votingEndTime: Date; } -export interface ReactiveProposal { - proposalId: ComputedRef; - content?: ComputedRef; - status: ComputedRef; - finalTallyResult: ComputedRef; - submitTime: ComputedRef; - depositEndTime: ComputedRef; - totalDeposit: ComputedRef; - votingStartTime: ComputedRef; - votingEndTime: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Proposal"; value: Uint8Array; @@ -327,12 +302,6 @@ export interface TallyResult { /** no_with_veto is the number of no with veto votes on a proposal. */ noWithVeto: string; } -export interface ReactiveTallyResult { - yes: ComputedRef; - abstain: ComputedRef; - no: ComputedRef; - noWithVeto: ComputedRef; -} export interface TallyResultProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TallyResult"; value: Uint8Array; @@ -375,12 +344,6 @@ export interface Vote { */ options: WeightedVoteOption[]; } -export interface ReactiveVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - options: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Vote"; value: Uint8Array; @@ -422,10 +385,6 @@ export interface DepositParams { */ maxDepositPeriod: Duration; } -export interface ReactiveDepositParams { - minDeposit: ComputedRef; - maxDepositPeriod: ComputedRef; -} export interface DepositParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.DepositParams"; value: Uint8Array; @@ -449,9 +408,6 @@ export interface VotingParams { /** Duration of the voting period. */ votingPeriod: Duration; } -export interface ReactiveVotingParams { - votingPeriod: ComputedRef; -} export interface VotingParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.VotingParams"; value: Uint8Array; @@ -480,11 +436,6 @@ export interface TallyParams { */ vetoThreshold: Uint8Array; } -export interface ReactiveTallyParams { - quorum: ComputedRef; - threshold: ComputedRef; - vetoThreshold: ComputedRef; -} export interface TallyParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TallyParams"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 0312b968..00000000 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,360 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse, ReactiveQueryProposalRequest, ReactiveQueryProposalsRequest, ReactiveQueryVoteRequest, ReactiveQueryVotesRequest, ReactiveQueryParamsRequest, ReactiveQueryDepositRequest, ReactiveQueryDepositsRequest, ReactiveQueryTallyResultRequest } from "./query"; -/** 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 on proposalID, depositor address. */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Proposal queries proposal details based on ProposalID. */ - proposal = async (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 BinaryReader(data))); - }; - /* Proposals queries all proposals based on given status. */ - proposals = async (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 BinaryReader(data))); - }; - /* Vote queries voted information based on proposalID, voterAddr. */ - vote = async (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 BinaryReader(data))); - }; - /* Votes queries votes of a given proposal. */ - votes = async (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 BinaryReader(data))); - }; - /* Params queries all parameters of the gov module. */ - params = async (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 BinaryReader(data))); - }; - /* Deposit queries single deposit information based on proposalID, depositor address. */ - deposit = async (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 BinaryReader(data))); - }; - /* Deposits queries all deposits of a single proposal. */ - deposits = async (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 BinaryReader(data))); - }; - /* TallyResult queries the tally of a proposal vote. */ - tallyResult = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - proposal(request: QueryProposalRequest): Promise { - return queryService.proposal(request); - }, - proposals(request: QueryProposalsRequest): Promise { - return queryService.proposals(request); - }, - vote(request: QueryVoteRequest): Promise { - return queryService.vote(request); - }, - votes(request: QueryVotesRequest): Promise { - return queryService.votes(request); - }, - params(request: QueryParamsRequest): Promise { - return queryService.params(request); - }, - deposit(request: QueryDepositRequest): Promise { - return queryService.deposit(request); - }, - deposits(request: QueryDepositsRequest): Promise { - return queryService.deposits(request); - }, - tallyResult(request: QueryTallyResultRequest): Promise { - return queryService.tallyResult(request); - } - }; -}; -export interface UseProposalQuery extends VueQueryParams { - request: ReactiveQueryProposalRequest; -} -export interface UseProposalsQuery extends VueQueryParams { - request: ReactiveQueryProposalsRequest; -} -export interface UseVoteQuery extends VueQueryParams { - request: ReactiveQueryVoteRequest; -} -export interface UseVotesQuery extends VueQueryParams { - request: ReactiveQueryVotesRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request: ReactiveQueryParamsRequest; -} -export interface UseDepositQuery extends VueQueryParams { - request: ReactiveQueryDepositRequest; -} -export interface UseDepositsQuery extends VueQueryParams { - request: ReactiveQueryDepositsRequest; -} -export interface UseTallyResultQuery extends VueQueryParams { - request: ReactiveQueryTallyResultRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useProposal = ({ - request, - options - }: UseProposalQuery) => { - const queryKey = ["proposalQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposal(params); - }, - ...options - }); - }; - const useProposals = ({ - request, - options - }: UseProposalsQuery) => { - const queryKey = ["proposalsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposals(params); - }, - ...options - }); - }; - const useVote = ({ - request, - options - }: UseVoteQuery) => { - const queryKey = ["voteQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.vote(params); - }, - ...options - }); - }; - const useVotes = ({ - request, - options - }: UseVotesQuery) => { - const queryKey = ["votesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.votes(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useDeposit = ({ - request, - options - }: UseDepositQuery) => { - const queryKey = ["depositQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.deposit(params); - }, - ...options - }); - }; - const useDeposits = ({ - request, - options - }: UseDepositsQuery) => { - const queryKey = ["depositsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.deposits(params); - }, - ...options - }); - }; - const useTallyResult = ({ - request, - options - }: UseTallyResultQuery) => { - const queryKey = ["tallyResultQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.tallyResult(params); - }, - ...options - }); - }; - return { - /** Proposal queries proposal details based on ProposalID. */useProposal, - /** Proposals queries all proposals based on given status. */useProposals, - /** Vote queries voted information based on proposalID, voterAddr. */useVote, - /** Votes queries votes of a given proposal. */useVotes, - /** Params queries all parameters of the gov module. */useParams, - /** Deposit queries single deposit information based on proposalID, depositor address. */useDeposit, - /** Deposits queries all deposits of a single proposal. */useDeposits, - /** TallyResult queries the tally of a proposal vote. */useTallyResult - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..eadeddd8 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.func.ts @@ -0,0 +1,58 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalRequest.encode, + decode: QueryProposalResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposal", + clientResolver +}); +export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalsRequest.encode, + decode: QueryProposalsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposals", + clientResolver +}); +export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVoteRequest.encode, + decode: QueryVoteResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Vote", + clientResolver +}); +export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVotesRequest.encode, + decode: QueryVotesResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Votes", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositRequest.encode, + decode: QueryDepositResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposit", + clientResolver +}); +export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositsRequest.encode, + decode: QueryDepositsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposits", + clientResolver +}); +export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTallyResultRequest.encode, + decode: QueryTallyResultResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "TallyResult", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..1771e4a1 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts @@ -0,0 +1,35 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +export const useGetProposal = buildUseVueQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposals = buildUseVueQuery({ + builderQueryFn: createGetProposals, + queryKeyPrefix: "ProposalsQuery" +}); +export const useGetVote = buildUseVueQuery({ + builderQueryFn: createGetVote, + queryKeyPrefix: "VoteQuery" +}); +export const useGetVotes = buildUseVueQuery({ + builderQueryFn: createGetVotes, + queryKeyPrefix: "VotesQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetDeposit = buildUseVueQuery({ + builderQueryFn: createGetDeposit, + queryKeyPrefix: "DepositQuery" +}); +export const useGetDeposits = buildUseVueQuery({ + builderQueryFn: createGetDeposits, + queryKeyPrefix: "DepositsQuery" +}); +export const useGetTallyResult = buildUseVueQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.ts index c209f318..15053043 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.ts @@ -3,15 +3,11 @@ import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from " import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveQueryProposalRequest { - proposalId: ComputedRef; -} export interface QueryProposalRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest"; value: Uint8Array; @@ -29,9 +25,6 @@ export interface QueryProposalRequestAminoMsg { export interface QueryProposalResponse { proposal: Proposal; } -export interface ReactiveQueryProposalResponse { - proposal: ComputedRef; -} export interface QueryProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse"; value: Uint8Array; @@ -55,12 +48,6 @@ export interface QueryProposalsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryProposalsRequest { - proposalStatus: ComputedRef; - voter: ComputedRef; - depositor: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest"; value: Uint8Array; @@ -90,10 +77,6 @@ export interface QueryProposalsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryProposalsResponse { - proposals: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse"; value: Uint8Array; @@ -119,10 +102,6 @@ export interface QueryVoteRequest { /** voter defines the voter address for the proposals. */ voter: string; } -export interface ReactiveQueryVoteRequest { - proposalId: ComputedRef; - voter: ComputedRef; -} export interface QueryVoteRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest"; value: Uint8Array; @@ -143,9 +122,6 @@ export interface QueryVoteResponse { /** vote defines the queried vote. */ vote: Vote; } -export interface ReactiveQueryVoteResponse { - vote: ComputedRef; -} export interface QueryVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse"; value: Uint8Array; @@ -166,10 +142,6 @@ export interface QueryVotesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryVotesRequest { - proposalId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest"; value: Uint8Array; @@ -192,10 +164,6 @@ export interface QueryVotesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryVotesResponse { - votes: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse"; value: Uint8Array; @@ -219,9 +187,6 @@ export interface QueryParamsRequest { */ paramsType: string; } -export interface ReactiveQueryParamsRequest { - paramsType: ComputedRef; -} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -247,11 +212,6 @@ export interface QueryParamsResponse { /** tally_params defines the parameters related to tally. */ tallyParams: TallyParams; } -export interface ReactiveQueryParamsResponse { - votingParams: ComputedRef; - depositParams: ComputedRef; - tallyParams: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -276,10 +236,6 @@ export interface QueryDepositRequest { /** depositor defines the deposit addresses from the proposals. */ depositor: string; } -export interface ReactiveQueryDepositRequest { - proposalId: ComputedRef; - depositor: ComputedRef; -} export interface QueryDepositRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest"; value: Uint8Array; @@ -300,9 +256,6 @@ export interface QueryDepositResponse { /** deposit defines the requested deposit. */ deposit: Deposit; } -export interface ReactiveQueryDepositResponse { - deposit: ComputedRef; -} export interface QueryDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse"; value: Uint8Array; @@ -323,10 +276,6 @@ export interface QueryDepositsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDepositsRequest { - proposalId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDepositsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest"; value: Uint8Array; @@ -349,10 +298,6 @@ export interface QueryDepositsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDepositsResponse { - deposits: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDepositsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse"; value: Uint8Array; @@ -373,9 +318,6 @@ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveQueryTallyResultRequest { - proposalId: ComputedRef; -} export interface QueryTallyResultRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest"; value: Uint8Array; @@ -394,9 +336,6 @@ export interface QueryTallyResultResponse { /** tally defines the requested tally. */ tally: TallyResult; } -export interface ReactiveQueryTallyResultResponse { - tally: ComputedRef; -} export interface QueryTallyResultResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.amino.ts deleted file mode 100644 index 1d618905..00000000 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.amino.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; -export const AminoConverter = { - "/cosmos.gov.v1beta1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/MsgSubmitProposal", - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino - }, - "/cosmos.gov.v1beta1.MsgVote": { - aminoType: "cosmos-sdk/MsgVote", - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino - }, - "/cosmos.gov.v1beta1.MsgVoteWeighted": { - aminoType: "cosmos-sdk/MsgVoteWeighted", - toAmino: MsgVoteWeighted.toAmino, - fromAmino: MsgVoteWeighted.fromAmino - }, - "/cosmos.gov.v1beta1.MsgDeposit": { - aminoType: "cosmos-sdk/MsgDeposit", - toAmino: MsgDeposit.toAmino, - fromAmino: MsgDeposit.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..222ecb6c --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 32f0d24f..00000000 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; -/** Msg defines the gov Msg service. */ -export interface Msg { - /** SubmitProposal defines a method to create new proposal given a content. */ - submitProposal(request: MsgSubmitProposal): 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. - * - * Since: cosmos-sdk 0.43 - */ - voteWeighted(request: MsgVoteWeighted): Promise; - /** Deposit defines a method to add deposit on a specific proposal. */ - deposit(request: MsgDeposit): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SubmitProposal defines a method to create new proposal given a content. */ - submitProposal = async (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 BinaryReader(data))); - }; - /* Vote defines a method to add a vote on a specific proposal. */ - vote = async (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 BinaryReader(data))); - }; - /* VoteWeighted defines a method to add a weighted vote on a specific proposal. - - Since: cosmos-sdk 0.43 */ - voteWeighted = async (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 BinaryReader(data))); - }; - /* Deposit defines a method to add deposit on a specific proposal. */ - deposit = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..f1bc66da --- /dev/null +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +export const useSubmitProposal = buildUseVueMutation({ + builderMutationFn: createSubmitProposal +}); +export const useVote = buildUseVueMutation({ + builderMutationFn: createVote +}); +export const useVoteWeighted = buildUseVueMutation({ + builderMutationFn: createVoteWeighted +}); +export const useDeposit = buildUseVueMutation({ + builderMutationFn: createDeposit +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.ts index 0820419b..dbe0f7a5 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.ts @@ -7,7 +7,6 @@ import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwar import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. @@ -20,11 +19,6 @@ export interface MsgSubmitProposal { /** proposer is the account address of the proposer. */ proposer: string; } -export interface ReactiveMsgSubmitProposal { - content?: ComputedRef; - initialDeposit: ComputedRef; - proposer: ComputedRef; -} export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; value: Uint8Array; @@ -53,9 +47,6 @@ export interface MsgSubmitProposalResponse { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } -export interface ReactiveMsgSubmitProposalResponse { - proposalId: ComputedRef; -} export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse"; value: Uint8Array; @@ -78,11 +69,6 @@ export interface MsgVote { /** option defines the vote option. */ option: VoteOption; } -export interface ReactiveMsgVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; -} export interface MsgVoteProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVote"; value: Uint8Array; @@ -102,7 +88,6 @@ export interface MsgVoteAminoMsg { } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponse {} -export interface ReactiveMsgVoteResponse {} export interface MsgVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse"; value: Uint8Array; @@ -126,11 +111,6 @@ export interface MsgVoteWeighted { /** options defines the weighted vote options. */ options: WeightedVoteOption[]; } -export interface ReactiveMsgVoteWeighted { - proposalId: ComputedRef; - voter: ComputedRef; - options: ComputedRef; -} export interface MsgVoteWeightedProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted"; value: Uint8Array; @@ -158,7 +138,6 @@ export interface MsgVoteWeightedAminoMsg { * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeightedResponse {} -export interface ReactiveMsgVoteWeightedResponse {} export interface MsgVoteWeightedResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse"; value: Uint8Array; @@ -182,11 +161,6 @@ export interface MsgDeposit { /** amount to be deposited by depositor. */ amount: Coin[]; } -export interface ReactiveMsgDeposit { - proposalId: ComputedRef; - depositor: ComputedRef; - amount: ComputedRef; -} export interface MsgDepositProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit"; value: Uint8Array; @@ -206,7 +180,6 @@ export interface MsgDepositAminoMsg { } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponse {} -export interface ReactiveMsgDepositResponse {} export interface MsgDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/group/module/v1/module.ts b/libs/interchain-vue/src/cosmos/group/module/v1/module.ts index e7c00f8c..28c973bb 100644 --- a/libs/interchain-vue/src/cosmos/group/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/group/module/v1/module.ts @@ -2,7 +2,6 @@ import { Duration, DurationAmino } from "../../../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** Module is the config object of the group module. */ export interface Module { /** @@ -16,10 +15,6 @@ export interface Module { */ maxMetadataLen: bigint; } -export interface ReactiveModule { - maxExecutionPeriod: ComputedRef; - maxMetadataLen: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.group.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/group/v1/events.ts b/libs/interchain-vue/src/cosmos/group/v1/events.ts index 9ea4e1de..f0df97d8 100644 --- a/libs/interchain-vue/src/cosmos/group/v1/events.ts +++ b/libs/interchain-vue/src/cosmos/group/v1/events.ts @@ -2,15 +2,11 @@ import { ProposalExecutorResult, ProposalStatus, TallyResult, TallyResultAmino } import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** EventCreateGroup is an event emitted when a group is created. */ export interface EventCreateGroup { /** group_id is the unique ID of the group. */ groupId: bigint; } -export interface ReactiveEventCreateGroup { - groupId: ComputedRef; -} export interface EventCreateGroupProtoMsg { typeUrl: "/cosmos.group.v1.EventCreateGroup"; value: Uint8Array; @@ -29,9 +25,6 @@ export interface EventUpdateGroup { /** group_id is the unique ID of the group. */ groupId: bigint; } -export interface ReactiveEventUpdateGroup { - groupId: ComputedRef; -} export interface EventUpdateGroupProtoMsg { typeUrl: "/cosmos.group.v1.EventUpdateGroup"; value: Uint8Array; @@ -50,9 +43,6 @@ export interface EventCreateGroupPolicy { /** address is the account address of the group policy. */ address: string; } -export interface ReactiveEventCreateGroupPolicy { - address: ComputedRef; -} export interface EventCreateGroupPolicyProtoMsg { typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy"; value: Uint8Array; @@ -71,9 +61,6 @@ export interface EventUpdateGroupPolicy { /** address is the account address of the group policy. */ address: string; } -export interface ReactiveEventUpdateGroupPolicy { - address: ComputedRef; -} export interface EventUpdateGroupPolicyProtoMsg { typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy"; value: Uint8Array; @@ -92,9 +79,6 @@ export interface EventSubmitProposal { /** proposal_id is the unique ID of the proposal. */ proposalId: bigint; } -export interface ReactiveEventSubmitProposal { - proposalId: ComputedRef; -} export interface EventSubmitProposalProtoMsg { typeUrl: "/cosmos.group.v1.EventSubmitProposal"; value: Uint8Array; @@ -113,9 +97,6 @@ export interface EventWithdrawProposal { /** proposal_id is the unique ID of the proposal. */ proposalId: bigint; } -export interface ReactiveEventWithdrawProposal { - proposalId: ComputedRef; -} export interface EventWithdrawProposalProtoMsg { typeUrl: "/cosmos.group.v1.EventWithdrawProposal"; value: Uint8Array; @@ -134,9 +115,6 @@ export interface EventVote { /** proposal_id is the unique ID of the proposal. */ proposalId: bigint; } -export interface ReactiveEventVote { - proposalId: ComputedRef; -} export interface EventVoteProtoMsg { typeUrl: "/cosmos.group.v1.EventVote"; value: Uint8Array; @@ -159,11 +137,6 @@ export interface EventExec { /** logs contains error logs in case the execution result is FAILURE. */ logs: string; } -export interface ReactiveEventExec { - proposalId: ComputedRef; - result: ComputedRef; - logs: ComputedRef; -} export interface EventExecProtoMsg { typeUrl: "/cosmos.group.v1.EventExec"; value: Uint8Array; @@ -188,10 +161,6 @@ export interface EventLeaveGroup { /** address is the account address of the group member. */ address: string; } -export interface ReactiveEventLeaveGroup { - groupId: ComputedRef; - address: ComputedRef; -} export interface EventLeaveGroupProtoMsg { typeUrl: "/cosmos.group.v1.EventLeaveGroup"; value: Uint8Array; @@ -216,11 +185,6 @@ export interface EventProposalPruned { /** tally_result is the proposal tally result (when applicable). */ tallyResult?: TallyResult; } -export interface ReactiveEventProposalPruned { - proposalId: ComputedRef; - status: ComputedRef; - tallyResult?: ComputedRef; -} export interface EventProposalPrunedProtoMsg { typeUrl: "/cosmos.group.v1.EventProposalPruned"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/group/v1/genesis.ts b/libs/interchain-vue/src/cosmos/group/v1/genesis.ts index ca81ed4f..fb97ce62 100644 --- a/libs/interchain-vue/src/cosmos/group/v1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/group/v1/genesis.ts @@ -2,7 +2,6 @@ import { GroupInfo, GroupInfoAmino, GroupMember, GroupMemberAmino, GroupPolicyIn import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** GenesisState defines the group module's genesis state. */ export interface GenesisState { /** @@ -31,16 +30,6 @@ export interface GenesisState { /** votes is the list of votes. */ votes: Vote[]; } -export interface ReactiveGenesisState { - groupSeq: ComputedRef; - groups: ComputedRef; - groupMembers: ComputedRef; - groupPolicySeq: ComputedRef; - groupPolicies: ComputedRef; - proposalSeq: ComputedRef; - proposals: ComputedRef; - votes: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.group.v1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/group/v1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/group/v1/query.rpc.Query.ts deleted file mode 100644 index 17955911..00000000 --- a/libs/interchain-vue/src/cosmos/group/v1/query.rpc.Query.ts +++ /dev/null @@ -1,630 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse, ReactiveQueryGroupInfoRequest, ReactiveQueryGroupPolicyInfoRequest, ReactiveQueryGroupMembersRequest, ReactiveQueryGroupsByAdminRequest, ReactiveQueryGroupPoliciesByGroupRequest, ReactiveQueryGroupPoliciesByAdminRequest, ReactiveQueryProposalRequest, ReactiveQueryProposalsByGroupPolicyRequest, ReactiveQueryVoteByProposalVoterRequest, ReactiveQueryVotesByProposalRequest, ReactiveQueryVotesByVoterRequest, ReactiveQueryGroupsByMemberRequest, ReactiveQueryTallyResultRequest, ReactiveQueryGroupsRequest } from "./query"; -/** Query is the cosmos.group.v1 Query service. */ -export interface Query { - /** GroupInfo queries group info based on group id. */ - groupInfo(request: QueryGroupInfoRequest): Promise; - /** GroupPolicyInfo queries group policy info based on account address of group policy. */ - groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise; - /** GroupMembers queries members of a group by group id. */ - groupMembers(request: QueryGroupMembersRequest): Promise; - /** GroupsByAdmin queries groups by admin address. */ - groupsByAdmin(request: QueryGroupsByAdminRequest): Promise; - /** GroupPoliciesByGroup queries group policies by group id. */ - groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise; - /** GroupPoliciesByAdmin queries group policies by admin address. */ - groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise; - /** Proposal queries a proposal based on proposal id. */ - proposal(request: QueryProposalRequest): Promise; - /** ProposalsByGroupPolicy queries proposals based on account address of group policy. */ - proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise; - /** VoteByProposalVoter queries a vote by proposal id and voter. */ - voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise; - /** VotesByProposal queries a vote by proposal id. */ - votesByProposal(request: QueryVotesByProposalRequest): Promise; - /** VotesByVoter queries a vote by voter. */ - votesByVoter(request: QueryVotesByVoterRequest): Promise; - /** GroupsByMember queries groups by member address. */ - groupsByMember(request: QueryGroupsByMemberRequest): Promise; - /** - * TallyResult returns the tally result of a proposal. If the proposal is - * still in voting period, then this query computes the current tally state, - * which might not be final. On the other hand, if the proposal is final, - * then it simply returns the `final_tally_result` state stored in the - * proposal itself. - */ - tallyResult(request: QueryTallyResultRequest): Promise; - /** - * Groups queries all groups in state. - * - * Since: cosmos-sdk 0.47.1 - */ - groups(request?: QueryGroupsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* GroupInfo queries group info based on group id. */ - groupInfo = async (request: QueryGroupInfoRequest): Promise => { - const data = QueryGroupInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "GroupInfo", data); - return promise.then(data => QueryGroupInfoResponse.decode(new BinaryReader(data))); - }; - /* GroupPolicyInfo queries group policy info based on account address of group policy. */ - groupPolicyInfo = async (request: QueryGroupPolicyInfoRequest): Promise => { - const data = QueryGroupPolicyInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPolicyInfo", data); - return promise.then(data => QueryGroupPolicyInfoResponse.decode(new BinaryReader(data))); - }; - /* GroupMembers queries members of a group by group id. */ - groupMembers = async (request: QueryGroupMembersRequest): Promise => { - const data = QueryGroupMembersRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "GroupMembers", data); - return promise.then(data => QueryGroupMembersResponse.decode(new BinaryReader(data))); - }; - /* GroupsByAdmin queries groups by admin address. */ - groupsByAdmin = async (request: QueryGroupsByAdminRequest): Promise => { - const data = QueryGroupsByAdminRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByAdmin", data); - return promise.then(data => QueryGroupsByAdminResponse.decode(new BinaryReader(data))); - }; - /* GroupPoliciesByGroup queries group policies by group id. */ - groupPoliciesByGroup = async (request: QueryGroupPoliciesByGroupRequest): Promise => { - const data = QueryGroupPoliciesByGroupRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByGroup", data); - return promise.then(data => QueryGroupPoliciesByGroupResponse.decode(new BinaryReader(data))); - }; - /* GroupPoliciesByAdmin queries group policies by admin address. */ - groupPoliciesByAdmin = async (request: QueryGroupPoliciesByAdminRequest): Promise => { - const data = QueryGroupPoliciesByAdminRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByAdmin", data); - return promise.then(data => QueryGroupPoliciesByAdminResponse.decode(new BinaryReader(data))); - }; - /* Proposal queries a proposal based on proposal id. */ - proposal = async (request: QueryProposalRequest): Promise => { - const data = QueryProposalRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "Proposal", data); - return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); - }; - /* ProposalsByGroupPolicy queries proposals based on account address of group policy. */ - proposalsByGroupPolicy = async (request: QueryProposalsByGroupPolicyRequest): Promise => { - const data = QueryProposalsByGroupPolicyRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "ProposalsByGroupPolicy", data); - return promise.then(data => QueryProposalsByGroupPolicyResponse.decode(new BinaryReader(data))); - }; - /* VoteByProposalVoter queries a vote by proposal id and voter. */ - voteByProposalVoter = async (request: QueryVoteByProposalVoterRequest): Promise => { - const data = QueryVoteByProposalVoterRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "VoteByProposalVoter", data); - return promise.then(data => QueryVoteByProposalVoterResponse.decode(new BinaryReader(data))); - }; - /* VotesByProposal queries a vote by proposal id. */ - votesByProposal = async (request: QueryVotesByProposalRequest): Promise => { - const data = QueryVotesByProposalRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByProposal", data); - return promise.then(data => QueryVotesByProposalResponse.decode(new BinaryReader(data))); - }; - /* VotesByVoter queries a vote by voter. */ - votesByVoter = async (request: QueryVotesByVoterRequest): Promise => { - const data = QueryVotesByVoterRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByVoter", data); - return promise.then(data => QueryVotesByVoterResponse.decode(new BinaryReader(data))); - }; - /* GroupsByMember queries groups by member address. */ - groupsByMember = async (request: QueryGroupsByMemberRequest): Promise => { - const data = QueryGroupsByMemberRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByMember", data); - return promise.then(data => QueryGroupsByMemberResponse.decode(new BinaryReader(data))); - }; - /* TallyResult returns the tally result of a proposal. If the proposal is - still in voting period, then this query computes the current tally state, - which might not be final. On the other hand, if the proposal is final, - then it simply returns the `final_tally_result` state stored in the - proposal itself. */ - tallyResult = async (request: QueryTallyResultRequest): Promise => { - const data = QueryTallyResultRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data); - return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); - }; - /* Groups queries all groups in state. - - Since: cosmos-sdk 0.47.1 */ - groups = async (request: QueryGroupsRequest = { - pagination: undefined - }): Promise => { - const data = QueryGroupsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "Groups", data); - return promise.then(data => QueryGroupsResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - groupInfo(request: QueryGroupInfoRequest): Promise { - return queryService.groupInfo(request); - }, - groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise { - return queryService.groupPolicyInfo(request); - }, - groupMembers(request: QueryGroupMembersRequest): Promise { - return queryService.groupMembers(request); - }, - groupsByAdmin(request: QueryGroupsByAdminRequest): Promise { - return queryService.groupsByAdmin(request); - }, - groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise { - return queryService.groupPoliciesByGroup(request); - }, - groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise { - return queryService.groupPoliciesByAdmin(request); - }, - proposal(request: QueryProposalRequest): Promise { - return queryService.proposal(request); - }, - proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise { - return queryService.proposalsByGroupPolicy(request); - }, - voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise { - return queryService.voteByProposalVoter(request); - }, - votesByProposal(request: QueryVotesByProposalRequest): Promise { - return queryService.votesByProposal(request); - }, - votesByVoter(request: QueryVotesByVoterRequest): Promise { - return queryService.votesByVoter(request); - }, - groupsByMember(request: QueryGroupsByMemberRequest): Promise { - return queryService.groupsByMember(request); - }, - tallyResult(request: QueryTallyResultRequest): Promise { - return queryService.tallyResult(request); - }, - groups(request?: QueryGroupsRequest): Promise { - return queryService.groups(request); - } - }; -}; -export interface UseGroupInfoQuery extends VueQueryParams { - request: ReactiveQueryGroupInfoRequest; -} -export interface UseGroupPolicyInfoQuery extends VueQueryParams { - request: ReactiveQueryGroupPolicyInfoRequest; -} -export interface UseGroupMembersQuery extends VueQueryParams { - request: ReactiveQueryGroupMembersRequest; -} -export interface UseGroupsByAdminQuery extends VueQueryParams { - request: ReactiveQueryGroupsByAdminRequest; -} -export interface UseGroupPoliciesByGroupQuery extends VueQueryParams { - request: ReactiveQueryGroupPoliciesByGroupRequest; -} -export interface UseGroupPoliciesByAdminQuery extends VueQueryParams { - request: ReactiveQueryGroupPoliciesByAdminRequest; -} -export interface UseProposalQuery extends VueQueryParams { - request: ReactiveQueryProposalRequest; -} -export interface UseProposalsByGroupPolicyQuery extends VueQueryParams { - request: ReactiveQueryProposalsByGroupPolicyRequest; -} -export interface UseVoteByProposalVoterQuery extends VueQueryParams { - request: ReactiveQueryVoteByProposalVoterRequest; -} -export interface UseVotesByProposalQuery extends VueQueryParams { - request: ReactiveQueryVotesByProposalRequest; -} -export interface UseVotesByVoterQuery extends VueQueryParams { - request: ReactiveQueryVotesByVoterRequest; -} -export interface UseGroupsByMemberQuery extends VueQueryParams { - request: ReactiveQueryGroupsByMemberRequest; -} -export interface UseTallyResultQuery extends VueQueryParams { - request: ReactiveQueryTallyResultRequest; -} -export interface UseGroupsQuery extends VueQueryParams { - request?: ReactiveQueryGroupsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useGroupInfo = ({ - request, - options - }: UseGroupInfoQuery) => { - const queryKey = ["groupInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groupInfo(params); - }, - ...options - }); - }; - const useGroupPolicyInfo = ({ - request, - options - }: UseGroupPolicyInfoQuery) => { - const queryKey = ["groupPolicyInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groupPolicyInfo(params); - }, - ...options - }); - }; - const useGroupMembers = ({ - request, - options - }: UseGroupMembersQuery) => { - const queryKey = ["groupMembersQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groupMembers(params); - }, - ...options - }); - }; - const useGroupsByAdmin = ({ - request, - options - }: UseGroupsByAdminQuery) => { - const queryKey = ["groupsByAdminQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groupsByAdmin(params); - }, - ...options - }); - }; - const useGroupPoliciesByGroup = ({ - request, - options - }: UseGroupPoliciesByGroupQuery) => { - const queryKey = ["groupPoliciesByGroupQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groupPoliciesByGroup(params); - }, - ...options - }); - }; - const useGroupPoliciesByAdmin = ({ - request, - options - }: UseGroupPoliciesByAdminQuery) => { - const queryKey = ["groupPoliciesByAdminQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groupPoliciesByAdmin(params); - }, - ...options - }); - }; - const useProposal = ({ - request, - options - }: UseProposalQuery) => { - const queryKey = ["proposalQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposal(params); - }, - ...options - }); - }; - const useProposalsByGroupPolicy = ({ - request, - options - }: UseProposalsByGroupPolicyQuery) => { - const queryKey = ["proposalsByGroupPolicyQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.proposalsByGroupPolicy(params); - }, - ...options - }); - }; - const useVoteByProposalVoter = ({ - request, - options - }: UseVoteByProposalVoterQuery) => { - const queryKey = ["voteByProposalVoterQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.voteByProposalVoter(params); - }, - ...options - }); - }; - const useVotesByProposal = ({ - request, - options - }: UseVotesByProposalQuery) => { - const queryKey = ["votesByProposalQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.votesByProposal(params); - }, - ...options - }); - }; - const useVotesByVoter = ({ - request, - options - }: UseVotesByVoterQuery) => { - const queryKey = ["votesByVoterQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.votesByVoter(params); - }, - ...options - }); - }; - const useGroupsByMember = ({ - request, - options - }: UseGroupsByMemberQuery) => { - const queryKey = ["groupsByMemberQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groupsByMember(params); - }, - ...options - }); - }; - const useTallyResult = ({ - request, - options - }: UseTallyResultQuery) => { - const queryKey = ["tallyResultQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.tallyResult(params); - }, - ...options - }); - }; - const useGroups = ({ - request, - options - }: UseGroupsQuery) => { - const queryKey = ["groupsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.groups(params); - }, - ...options - }); - }; - return { - /** GroupInfo queries group info based on group id. */useGroupInfo, - /** GroupPolicyInfo queries group policy info based on account address of group policy. */useGroupPolicyInfo, - /** GroupMembers queries members of a group by group id. */useGroupMembers, - /** GroupsByAdmin queries groups by admin address. */useGroupsByAdmin, - /** GroupPoliciesByGroup queries group policies by group id. */useGroupPoliciesByGroup, - /** GroupPoliciesByAdmin queries group policies by admin address. */useGroupPoliciesByAdmin, - /** Proposal queries a proposal based on proposal id. */useProposal, - /** ProposalsByGroupPolicy queries proposals based on account address of group policy. */useProposalsByGroupPolicy, - /** VoteByProposalVoter queries a vote by proposal id and voter. */useVoteByProposalVoter, - /** VotesByProposal queries a vote by proposal id. */useVotesByProposal, - /** VotesByVoter queries a vote by voter. */useVotesByVoter, - /** GroupsByMember queries groups by member address. */useGroupsByMember, - /** - * TallyResult returns the tally result of a proposal. If the proposal is - * still in voting period, then this query computes the current tally state, - * which might not be final. On the other hand, if the proposal is final, - * then it simply returns the `final_tally_result` state stored in the - * proposal itself. - */ - useTallyResult, - /** - * Groups queries all groups in state. - * - * Since: cosmos-sdk 0.47.1 - */ - useGroups - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/group/v1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/group/v1/query.rpc.func.ts new file mode 100644 index 00000000..1f161531 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/group/v1/query.rpc.func.ts @@ -0,0 +1,100 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse } from "./query"; +export const createGetGroupInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupInfoRequest.encode, + decode: QueryGroupInfoResponse.decode, + service: "cosmos.group.v1.Query", + method: "GroupInfo", + clientResolver +}); +export const createGetGroupPolicyInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupPolicyInfoRequest.encode, + decode: QueryGroupPolicyInfoResponse.decode, + service: "cosmos.group.v1.Query", + method: "GroupPolicyInfo", + clientResolver +}); +export const createGetGroupMembers = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupMembersRequest.encode, + decode: QueryGroupMembersResponse.decode, + service: "cosmos.group.v1.Query", + method: "GroupMembers", + clientResolver +}); +export const createGetGroupsByAdmin = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupsByAdminRequest.encode, + decode: QueryGroupsByAdminResponse.decode, + service: "cosmos.group.v1.Query", + method: "GroupsByAdmin", + clientResolver +}); +export const createGetGroupPoliciesByGroup = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupPoliciesByGroupRequest.encode, + decode: QueryGroupPoliciesByGroupResponse.decode, + service: "cosmos.group.v1.Query", + method: "GroupPoliciesByGroup", + clientResolver +}); +export const createGetGroupPoliciesByAdmin = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupPoliciesByAdminRequest.encode, + decode: QueryGroupPoliciesByAdminResponse.decode, + service: "cosmos.group.v1.Query", + method: "GroupPoliciesByAdmin", + clientResolver +}); +export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalRequest.encode, + decode: QueryProposalResponse.decode, + service: "cosmos.group.v1.Query", + method: "Proposal", + clientResolver +}); +export const createGetProposalsByGroupPolicy = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalsByGroupPolicyRequest.encode, + decode: QueryProposalsByGroupPolicyResponse.decode, + service: "cosmos.group.v1.Query", + method: "ProposalsByGroupPolicy", + clientResolver +}); +export const createGetVoteByProposalVoter = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVoteByProposalVoterRequest.encode, + decode: QueryVoteByProposalVoterResponse.decode, + service: "cosmos.group.v1.Query", + method: "VoteByProposalVoter", + clientResolver +}); +export const createGetVotesByProposal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVotesByProposalRequest.encode, + decode: QueryVotesByProposalResponse.decode, + service: "cosmos.group.v1.Query", + method: "VotesByProposal", + clientResolver +}); +export const createGetVotesByVoter = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVotesByVoterRequest.encode, + decode: QueryVotesByVoterResponse.decode, + service: "cosmos.group.v1.Query", + method: "VotesByVoter", + clientResolver +}); +export const createGetGroupsByMember = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupsByMemberRequest.encode, + decode: QueryGroupsByMemberResponse.decode, + service: "cosmos.group.v1.Query", + method: "GroupsByMember", + clientResolver +}); +export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTallyResultRequest.encode, + decode: QueryTallyResultResponse.decode, + service: "cosmos.group.v1.Query", + method: "TallyResult", + clientResolver +}); +export const createGetGroups = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGroupsRequest.encode, + decode: QueryGroupsResponse.decode, + service: "cosmos.group.v1.Query", + method: "Groups", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts new file mode 100644 index 00000000..6a01b3a5 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts @@ -0,0 +1,59 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse } from "./query"; +import { createGetGroupInfo, createGetGroupPolicyInfo, createGetGroupMembers, createGetGroupsByAdmin, createGetGroupPoliciesByGroup, createGetGroupPoliciesByAdmin, createGetProposal, createGetProposalsByGroupPolicy, createGetVoteByProposalVoter, createGetVotesByProposal, createGetVotesByVoter, createGetGroupsByMember, createGetTallyResult, createGetGroups } from "./query.rpc.func.ts"; +export const useGetGroupInfo = buildUseVueQuery({ + builderQueryFn: createGetGroupInfo, + queryKeyPrefix: "GroupInfoQuery" +}); +export const useGetGroupPolicyInfo = buildUseVueQuery({ + builderQueryFn: createGetGroupPolicyInfo, + queryKeyPrefix: "GroupPolicyInfoQuery" +}); +export const useGetGroupMembers = buildUseVueQuery({ + builderQueryFn: createGetGroupMembers, + queryKeyPrefix: "GroupMembersQuery" +}); +export const useGetGroupsByAdmin = buildUseVueQuery({ + builderQueryFn: createGetGroupsByAdmin, + queryKeyPrefix: "GroupsByAdminQuery" +}); +export const useGetGroupPoliciesByGroup = buildUseVueQuery({ + builderQueryFn: createGetGroupPoliciesByGroup, + queryKeyPrefix: "GroupPoliciesByGroupQuery" +}); +export const useGetGroupPoliciesByAdmin = buildUseVueQuery({ + builderQueryFn: createGetGroupPoliciesByAdmin, + queryKeyPrefix: "GroupPoliciesByAdminQuery" +}); +export const useGetProposal = buildUseVueQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const useGetProposalsByGroupPolicy = buildUseVueQuery({ + builderQueryFn: createGetProposalsByGroupPolicy, + queryKeyPrefix: "ProposalsByGroupPolicyQuery" +}); +export const useGetVoteByProposalVoter = buildUseVueQuery({ + builderQueryFn: createGetVoteByProposalVoter, + queryKeyPrefix: "VoteByProposalVoterQuery" +}); +export const useGetVotesByProposal = buildUseVueQuery({ + builderQueryFn: createGetVotesByProposal, + queryKeyPrefix: "VotesByProposalQuery" +}); +export const useGetVotesByVoter = buildUseVueQuery({ + builderQueryFn: createGetVotesByVoter, + queryKeyPrefix: "VotesByVoterQuery" +}); +export const useGetGroupsByMember = buildUseVueQuery({ + builderQueryFn: createGetGroupsByMember, + queryKeyPrefix: "GroupsByMemberQuery" +}); +export const useGetTallyResult = buildUseVueQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); +export const useGetGroups = buildUseVueQuery({ + builderQueryFn: createGetGroups, + queryKeyPrefix: "GroupsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/group/v1/query.ts b/libs/interchain-vue/src/cosmos/group/v1/query.ts index c1717e9e..912c47fb 100644 --- a/libs/interchain-vue/src/cosmos/group/v1/query.ts +++ b/libs/interchain-vue/src/cosmos/group/v1/query.ts @@ -3,15 +3,11 @@ import { GroupInfo, GroupInfoAmino, GroupPolicyInfo, GroupPolicyInfoAmino, Group import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryGroupInfoRequest is the Query/GroupInfo request type. */ export interface QueryGroupInfoRequest { /** group_id is the unique ID of the group. */ groupId: bigint; } -export interface ReactiveQueryGroupInfoRequest { - groupId: ComputedRef; -} export interface QueryGroupInfoRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest"; value: Uint8Array; @@ -30,9 +26,6 @@ export interface QueryGroupInfoResponse { /** info is the GroupInfo of the group. */ info?: GroupInfo; } -export interface ReactiveQueryGroupInfoResponse { - info?: ComputedRef; -} export interface QueryGroupInfoResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse"; value: Uint8Array; @@ -51,9 +44,6 @@ export interface QueryGroupPolicyInfoRequest { /** address is the account address of the group policy. */ address: string; } -export interface ReactiveQueryGroupPolicyInfoRequest { - address: ComputedRef; -} export interface QueryGroupPolicyInfoRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest"; value: Uint8Array; @@ -72,9 +62,6 @@ export interface QueryGroupPolicyInfoResponse { /** info is the GroupPolicyInfo of the group policy. */ info?: GroupPolicyInfo; } -export interface ReactiveQueryGroupPolicyInfoResponse { - info?: ComputedRef; -} export interface QueryGroupPolicyInfoResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse"; value: Uint8Array; @@ -95,10 +82,6 @@ export interface QueryGroupMembersRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGroupMembersRequest { - groupId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupMembersRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest"; value: Uint8Array; @@ -121,10 +104,6 @@ export interface QueryGroupMembersResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGroupMembersResponse { - members: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupMembersResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse"; value: Uint8Array; @@ -147,10 +126,6 @@ export interface QueryGroupsByAdminRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGroupsByAdminRequest { - admin: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupsByAdminRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest"; value: Uint8Array; @@ -173,10 +148,6 @@ export interface QueryGroupsByAdminResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGroupsByAdminResponse { - groups: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupsByAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse"; value: Uint8Array; @@ -199,10 +170,6 @@ export interface QueryGroupPoliciesByGroupRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGroupPoliciesByGroupRequest { - groupId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupPoliciesByGroupRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest"; value: Uint8Array; @@ -225,10 +192,6 @@ export interface QueryGroupPoliciesByGroupResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGroupPoliciesByGroupResponse { - groupPolicies: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupPoliciesByGroupResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse"; value: Uint8Array; @@ -251,10 +214,6 @@ export interface QueryGroupPoliciesByAdminRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGroupPoliciesByAdminRequest { - admin: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupPoliciesByAdminRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest"; value: Uint8Array; @@ -277,10 +236,6 @@ export interface QueryGroupPoliciesByAdminResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGroupPoliciesByAdminResponse { - groupPolicies: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupPoliciesByAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse"; value: Uint8Array; @@ -301,9 +256,6 @@ export interface QueryProposalRequest { /** proposal_id is the unique ID of a proposal. */ proposalId: bigint; } -export interface ReactiveQueryProposalRequest { - proposalId: ComputedRef; -} export interface QueryProposalRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalRequest"; value: Uint8Array; @@ -322,9 +274,6 @@ export interface QueryProposalResponse { /** proposal is the proposal info. */ proposal?: Proposal; } -export interface ReactiveQueryProposalResponse { - proposal?: ComputedRef; -} export interface QueryProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalResponse"; value: Uint8Array; @@ -345,10 +294,6 @@ export interface QueryProposalsByGroupPolicyRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryProposalsByGroupPolicyRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsByGroupPolicyRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest"; value: Uint8Array; @@ -371,10 +316,6 @@ export interface QueryProposalsByGroupPolicyResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryProposalsByGroupPolicyResponse { - proposals: ComputedRef; - pagination?: ComputedRef; -} export interface QueryProposalsByGroupPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse"; value: Uint8Array; @@ -397,10 +338,6 @@ export interface QueryVoteByProposalVoterRequest { /** voter is a proposal voter account address. */ voter: string; } -export interface ReactiveQueryVoteByProposalVoterRequest { - proposalId: ComputedRef; - voter: ComputedRef; -} export interface QueryVoteByProposalVoterRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest"; value: Uint8Array; @@ -421,9 +358,6 @@ export interface QueryVoteByProposalVoterResponse { /** vote is the vote with given proposal_id and voter. */ vote?: Vote; } -export interface ReactiveQueryVoteByProposalVoterResponse { - vote?: ComputedRef; -} export interface QueryVoteByProposalVoterResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse"; value: Uint8Array; @@ -444,10 +378,6 @@ export interface QueryVotesByProposalRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryVotesByProposalRequest { - proposalId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesByProposalRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest"; value: Uint8Array; @@ -470,10 +400,6 @@ export interface QueryVotesByProposalResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryVotesByProposalResponse { - votes: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesByProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse"; value: Uint8Array; @@ -496,10 +422,6 @@ export interface QueryVotesByVoterRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryVotesByVoterRequest { - voter: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesByVoterRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest"; value: Uint8Array; @@ -522,10 +444,6 @@ export interface QueryVotesByVoterResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryVotesByVoterResponse { - votes: ComputedRef; - pagination?: ComputedRef; -} export interface QueryVotesByVoterResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse"; value: Uint8Array; @@ -548,10 +466,6 @@ export interface QueryGroupsByMemberRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGroupsByMemberRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupsByMemberRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest"; value: Uint8Array; @@ -574,10 +488,6 @@ export interface QueryGroupsByMemberResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGroupsByMemberResponse { - groups: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupsByMemberResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse"; value: Uint8Array; @@ -598,9 +508,6 @@ export interface QueryTallyResultRequest { /** proposal_id is the unique id of a proposal. */ proposalId: bigint; } -export interface ReactiveQueryTallyResultRequest { - proposalId: ComputedRef; -} export interface QueryTallyResultRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryTallyResultRequest"; value: Uint8Array; @@ -619,9 +526,6 @@ export interface QueryTallyResultResponse { /** tally defines the requested tally. */ tally: TallyResult; } -export interface ReactiveQueryTallyResultResponse { - tally: ComputedRef; -} export interface QueryTallyResultResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryTallyResultResponse"; value: Uint8Array; @@ -644,9 +548,6 @@ export interface QueryGroupsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryGroupsRequest { - pagination?: ComputedRef; -} export interface QueryGroupsRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsRequest"; value: Uint8Array; @@ -675,10 +576,6 @@ export interface QueryGroupsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryGroupsResponse { - groups: ComputedRef; - pagination?: ComputedRef; -} export interface QueryGroupsResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/group/v1/tx.amino.ts b/libs/interchain-vue/src/cosmos/group/v1/tx.amino.ts deleted file mode 100644 index 3a5c0e59..00000000 --- a/libs/interchain-vue/src/cosmos/group/v1/tx.amino.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; -export const AminoConverter = { - "/cosmos.group.v1.MsgCreateGroup": { - aminoType: "cosmos-sdk/MsgCreateGroup", - toAmino: MsgCreateGroup.toAmino, - fromAmino: MsgCreateGroup.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupMembers": { - aminoType: "cosmos-sdk/MsgUpdateGroupMembers", - toAmino: MsgUpdateGroupMembers.toAmino, - fromAmino: MsgUpdateGroupMembers.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupAdmin": { - aminoType: "cosmos-sdk/MsgUpdateGroupAdmin", - toAmino: MsgUpdateGroupAdmin.toAmino, - fromAmino: MsgUpdateGroupAdmin.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupMetadata": { - aminoType: "cosmos-sdk/MsgUpdateGroupMetadata", - toAmino: MsgUpdateGroupMetadata.toAmino, - fromAmino: MsgUpdateGroupMetadata.fromAmino - }, - "/cosmos.group.v1.MsgCreateGroupPolicy": { - aminoType: "cosmos-sdk/MsgCreateGroupPolicy", - toAmino: MsgCreateGroupPolicy.toAmino, - fromAmino: MsgCreateGroupPolicy.fromAmino - }, - "/cosmos.group.v1.MsgCreateGroupWithPolicy": { - aminoType: "cosmos-sdk/MsgCreateGroupWithPolicy", - toAmino: MsgCreateGroupWithPolicy.toAmino, - fromAmino: MsgCreateGroupWithPolicy.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin": { - aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", - toAmino: MsgUpdateGroupPolicyAdmin.toAmino, - fromAmino: MsgUpdateGroupPolicyAdmin.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy": { - aminoType: "cosmos-sdk/MsgUpdateGroupDecisionPolicy", - toAmino: MsgUpdateGroupPolicyDecisionPolicy.toAmino, - fromAmino: MsgUpdateGroupPolicyDecisionPolicy.fromAmino - }, - "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata": { - aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", - toAmino: MsgUpdateGroupPolicyMetadata.toAmino, - fromAmino: MsgUpdateGroupPolicyMetadata.fromAmino - }, - "/cosmos.group.v1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/group/MsgSubmitProposal", - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino - }, - "/cosmos.group.v1.MsgWithdrawProposal": { - aminoType: "cosmos-sdk/group/MsgWithdrawProposal", - toAmino: MsgWithdrawProposal.toAmino, - fromAmino: MsgWithdrawProposal.fromAmino - }, - "/cosmos.group.v1.MsgVote": { - aminoType: "cosmos-sdk/group/MsgVote", - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino - }, - "/cosmos.group.v1.MsgExec": { - aminoType: "cosmos-sdk/group/MsgExec", - toAmino: MsgExec.toAmino, - fromAmino: MsgExec.fromAmino - }, - "/cosmos.group.v1.MsgLeaveGroup": { - aminoType: "cosmos-sdk/group/MsgLeaveGroup", - toAmino: MsgLeaveGroup.toAmino, - fromAmino: MsgLeaveGroup.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.func.ts new file mode 100644 index 00000000..28648bdd --- /dev/null +++ b/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.func.ts @@ -0,0 +1,87 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const createCreateGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroup.typeUrl, + encoders: toEncoders(MsgCreateGroup), + converters: toConverters(MsgCreateGroup) +}); +export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMembers.typeUrl, + encoders: toEncoders(MsgUpdateGroupMembers), + converters: toConverters(MsgUpdateGroupMembers) +}); +export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupAdmin), + converters: toConverters(MsgUpdateGroupAdmin) +}); +export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupMetadata), + converters: toConverters(MsgUpdateGroupMetadata) +}); +export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupPolicy), + converters: toConverters(MsgCreateGroupPolicy) +}); +export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupWithPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupWithPolicy), + converters: toConverters(MsgCreateGroupWithPolicy) +}); +export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyAdmin), + converters: toConverters(MsgUpdateGroupPolicyAdmin) +}); +export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyDecisionPolicy.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyDecisionPolicy), + converters: toConverters(MsgUpdateGroupPolicyDecisionPolicy) +}); +export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyMetadata), + converters: toConverters(MsgUpdateGroupPolicyMetadata) +}); +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createWithdrawProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawProposal.typeUrl, + encoders: toEncoders(MsgWithdrawProposal), + converters: toConverters(MsgWithdrawProposal) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const createLeaveGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgLeaveGroup.typeUrl, + encoders: toEncoders(MsgLeaveGroup), + converters: toConverters(MsgLeaveGroup) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.msg.ts deleted file mode 100644 index 46e7fb32..00000000 --- a/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateGroup, MsgCreateGroupResponse, MsgUpdateGroupMembers, MsgUpdateGroupMembersResponse, MsgUpdateGroupAdmin, MsgUpdateGroupAdminResponse, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataResponse, MsgCreateGroupPolicy, MsgCreateGroupPolicyResponse, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicyResponse, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminResponse, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicyResponse, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataResponse, MsgSubmitProposal, MsgSubmitProposalResponse, MsgWithdrawProposal, MsgWithdrawProposalResponse, MsgVote, MsgVoteResponse, MsgExec, MsgExecResponse, MsgLeaveGroup, MsgLeaveGroupResponse } from "./tx"; -/** Msg is the cosmos.group.v1 Msg service. */ -export interface Msg { - /** CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. */ - createGroup(request: MsgCreateGroup): Promise; - /** UpdateGroupMembers updates the group members with given group id and admin address. */ - updateGroupMembers(request: MsgUpdateGroupMembers): Promise; - /** UpdateGroupAdmin updates the group admin with given group id and previous admin address. */ - updateGroupAdmin(request: MsgUpdateGroupAdmin): Promise; - /** UpdateGroupMetadata updates the group metadata with given group id and admin address. */ - updateGroupMetadata(request: MsgUpdateGroupMetadata): Promise; - /** CreateGroupPolicy creates a new group policy using given DecisionPolicy. */ - createGroupPolicy(request: MsgCreateGroupPolicy): Promise; - /** CreateGroupWithPolicy creates a new group with policy. */ - createGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise; - /** UpdateGroupPolicyAdmin updates a group policy admin. */ - updateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise; - /** UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. */ - updateGroupPolicyDecisionPolicy(request: MsgUpdateGroupPolicyDecisionPolicy): Promise; - /** UpdateGroupPolicyMetadata updates a group policy metadata. */ - updateGroupPolicyMetadata(request: MsgUpdateGroupPolicyMetadata): Promise; - /** SubmitProposal submits a new proposal. */ - submitProposal(request: MsgSubmitProposal): Promise; - /** WithdrawProposal withdraws a proposal. */ - withdrawProposal(request: MsgWithdrawProposal): Promise; - /** Vote allows a voter to vote on a proposal. */ - vote(request: MsgVote): Promise; - /** Exec executes a proposal. */ - exec(request: MsgExec): Promise; - /** LeaveGroup allows a group member to leave the group. */ - leaveGroup(request: MsgLeaveGroup): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. */ - createGroup = async (request: MsgCreateGroup): Promise => { - const data = MsgCreateGroup.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroup", data); - return promise.then(data => MsgCreateGroupResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupMembers updates the group members with given group id and admin address. */ - updateGroupMembers = async (request: MsgUpdateGroupMembers): Promise => { - const data = MsgUpdateGroupMembers.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMembers", data); - return promise.then(data => MsgUpdateGroupMembersResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupAdmin updates the group admin with given group id and previous admin address. */ - updateGroupAdmin = async (request: MsgUpdateGroupAdmin): Promise => { - const data = MsgUpdateGroupAdmin.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupAdmin", data); - return promise.then(data => MsgUpdateGroupAdminResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupMetadata updates the group metadata with given group id and admin address. */ - updateGroupMetadata = async (request: MsgUpdateGroupMetadata): Promise => { - const data = MsgUpdateGroupMetadata.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMetadata", data); - return promise.then(data => MsgUpdateGroupMetadataResponse.decode(new BinaryReader(data))); - }; - /* CreateGroupPolicy creates a new group policy using given DecisionPolicy. */ - createGroupPolicy = async (request: MsgCreateGroupPolicy): Promise => { - const data = MsgCreateGroupPolicy.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupPolicy", data); - return promise.then(data => MsgCreateGroupPolicyResponse.decode(new BinaryReader(data))); - }; - /* CreateGroupWithPolicy creates a new group with policy. */ - createGroupWithPolicy = async (request: MsgCreateGroupWithPolicy): Promise => { - const data = MsgCreateGroupWithPolicy.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupWithPolicy", data); - return promise.then(data => MsgCreateGroupWithPolicyResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupPolicyAdmin updates a group policy admin. */ - updateGroupPolicyAdmin = async (request: MsgUpdateGroupPolicyAdmin): Promise => { - const data = MsgUpdateGroupPolicyAdmin.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyAdmin", data); - return promise.then(data => MsgUpdateGroupPolicyAdminResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. */ - updateGroupPolicyDecisionPolicy = async (request: MsgUpdateGroupPolicyDecisionPolicy): Promise => { - const data = MsgUpdateGroupPolicyDecisionPolicy.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyDecisionPolicy", data); - return promise.then(data => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new BinaryReader(data))); - }; - /* UpdateGroupPolicyMetadata updates a group policy metadata. */ - updateGroupPolicyMetadata = async (request: MsgUpdateGroupPolicyMetadata): Promise => { - const data = MsgUpdateGroupPolicyMetadata.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyMetadata", data); - return promise.then(data => MsgUpdateGroupPolicyMetadataResponse.decode(new BinaryReader(data))); - }; - /* SubmitProposal submits a new proposal. */ - submitProposal = async (request: MsgSubmitProposal): Promise => { - const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "SubmitProposal", data); - return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); - }; - /* WithdrawProposal withdraws a proposal. */ - withdrawProposal = async (request: MsgWithdrawProposal): Promise => { - const data = MsgWithdrawProposal.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "WithdrawProposal", data); - return promise.then(data => MsgWithdrawProposalResponse.decode(new BinaryReader(data))); - }; - /* Vote allows a voter to vote on a proposal. */ - vote = async (request: MsgVote): Promise => { - const data = MsgVote.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "Vote", data); - return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); - }; - /* Exec executes a proposal. */ - exec = async (request: MsgExec): Promise => { - const data = MsgExec.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "Exec", data); - return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); - }; - /* LeaveGroup allows a group member to leave the group. */ - leaveGroup = async (request: MsgLeaveGroup): Promise => { - const data = MsgLeaveGroup.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Msg", "LeaveGroup", data); - return promise.then(data => MsgLeaveGroupResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..ed9a30e0 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts @@ -0,0 +1,45 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +export const useCreateGroup = buildUseVueMutation({ + builderMutationFn: createCreateGroup +}); +export const useUpdateGroupMembers = buildUseVueMutation({ + builderMutationFn: createUpdateGroupMembers +}); +export const useUpdateGroupAdmin = buildUseVueMutation({ + builderMutationFn: createUpdateGroupAdmin +}); +export const useUpdateGroupMetadata = buildUseVueMutation({ + builderMutationFn: createUpdateGroupMetadata +}); +export const useCreateGroupPolicy = buildUseVueMutation({ + builderMutationFn: createCreateGroupPolicy +}); +export const useCreateGroupWithPolicy = buildUseVueMutation({ + builderMutationFn: createCreateGroupWithPolicy +}); +export const useUpdateGroupPolicyAdmin = buildUseVueMutation({ + builderMutationFn: createUpdateGroupPolicyAdmin +}); +export const useUpdateGroupPolicyDecisionPolicy = buildUseVueMutation({ + builderMutationFn: createUpdateGroupPolicyDecisionPolicy +}); +export const useUpdateGroupPolicyMetadata = buildUseVueMutation({ + builderMutationFn: createUpdateGroupPolicyMetadata +}); +export const useSubmitProposal = buildUseVueMutation({ + builderMutationFn: createSubmitProposal +}); +export const useWithdrawProposal = buildUseVueMutation({ + builderMutationFn: createWithdrawProposal +}); +export const useVote = buildUseVueMutation({ + builderMutationFn: createVote +}); +export const useExec = buildUseVueMutation({ + builderMutationFn: createExec +}); +export const useLeaveGroup = buildUseVueMutation({ + builderMutationFn: createLeaveGroup +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/group/v1/tx.ts b/libs/interchain-vue/src/cosmos/group/v1/tx.ts index 636a0e89..492b0084 100644 --- a/libs/interchain-vue/src/cosmos/group/v1/tx.ts +++ b/libs/interchain-vue/src/cosmos/group/v1/tx.ts @@ -3,7 +3,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Exec defines modes of execution of a proposal on creation or on new vote. */ export enum Exec { /** @@ -55,11 +54,6 @@ export interface MsgCreateGroup { /** metadata is any arbitrary metadata to attached to the group. */ metadata: string; } -export interface ReactiveMsgCreateGroup { - admin: ComputedRef; - members: ComputedRef; - metadata: ComputedRef; -} export interface MsgCreateGroupProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroup"; value: Uint8Array; @@ -82,9 +76,6 @@ export interface MsgCreateGroupResponse { /** group_id is the unique ID of the newly created group. */ groupId: bigint; } -export interface ReactiveMsgCreateGroupResponse { - groupId: ComputedRef; -} export interface MsgCreateGroupResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse"; value: Uint8Array; @@ -110,11 +101,6 @@ export interface MsgUpdateGroupMembers { */ memberUpdates: MemberRequest[]; } -export interface ReactiveMsgUpdateGroupMembers { - admin: ComputedRef; - groupId: ComputedRef; - memberUpdates: ComputedRef; -} export interface MsgUpdateGroupMembersProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers"; value: Uint8Array; @@ -137,7 +123,6 @@ export interface MsgUpdateGroupMembersAminoMsg { } /** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ export interface MsgUpdateGroupMembersResponse {} -export interface ReactiveMsgUpdateGroupMembersResponse {} export interface MsgUpdateGroupMembersResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse"; value: Uint8Array; @@ -157,11 +142,6 @@ export interface MsgUpdateGroupAdmin { /** new_admin is the group new admin account address. */ newAdmin: string; } -export interface ReactiveMsgUpdateGroupAdmin { - admin: ComputedRef; - groupId: ComputedRef; - newAdmin: ComputedRef; -} export interface MsgUpdateGroupAdminProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin"; value: Uint8Array; @@ -181,7 +161,6 @@ export interface MsgUpdateGroupAdminAminoMsg { } /** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ export interface MsgUpdateGroupAdminResponse {} -export interface ReactiveMsgUpdateGroupAdminResponse {} export interface MsgUpdateGroupAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse"; value: Uint8Array; @@ -201,11 +180,6 @@ export interface MsgUpdateGroupMetadata { /** metadata is the updated group's metadata. */ metadata: string; } -export interface ReactiveMsgUpdateGroupMetadata { - admin: ComputedRef; - groupId: ComputedRef; - metadata: ComputedRef; -} export interface MsgUpdateGroupMetadataProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata"; value: Uint8Array; @@ -225,7 +199,6 @@ export interface MsgUpdateGroupMetadataAminoMsg { } /** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ export interface MsgUpdateGroupMetadataResponse {} -export interface ReactiveMsgUpdateGroupMetadataResponse {} export interface MsgUpdateGroupMetadataResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse"; value: Uint8Array; @@ -247,12 +220,6 @@ export interface MsgCreateGroupPolicy { /** decision_policy specifies the group policy's decision policy. */ decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; } -export interface ReactiveMsgCreateGroupPolicy { - admin: ComputedRef; - groupId: ComputedRef; - metadata: ComputedRef; - decisionPolicy?: ComputedRef; -} export interface MsgCreateGroupPolicyProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; value: Uint8Array; @@ -280,9 +247,6 @@ export interface MsgCreateGroupPolicyResponse { /** address is the account address of the newly created group policy. */ address: string; } -export interface ReactiveMsgCreateGroupPolicyResponse { - address: ComputedRef; -} export interface MsgCreateGroupPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse"; value: Uint8Array; @@ -305,11 +269,6 @@ export interface MsgUpdateGroupPolicyAdmin { /** new_admin is the new group policy admin. */ newAdmin: string; } -export interface ReactiveMsgUpdateGroupPolicyAdmin { - admin: ComputedRef; - groupPolicyAddress: ComputedRef; - newAdmin: ComputedRef; -} export interface MsgUpdateGroupPolicyAdminProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin"; value: Uint8Array; @@ -329,7 +288,6 @@ export interface MsgUpdateGroupPolicyAdminAminoMsg { } /** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ export interface MsgUpdateGroupPolicyAdminResponse {} -export interface ReactiveMsgUpdateGroupPolicyAdminResponse {} export interface MsgUpdateGroupPolicyAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse"; value: Uint8Array; @@ -358,14 +316,6 @@ export interface MsgCreateGroupWithPolicy { /** decision_policy specifies the group policy's decision policy. */ decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; } -export interface ReactiveMsgCreateGroupWithPolicy { - admin: ComputedRef; - members: ComputedRef; - groupMetadata: ComputedRef; - groupPolicyMetadata: ComputedRef; - groupPolicyAsAdmin: ComputedRef; - decisionPolicy?: ComputedRef; -} export interface MsgCreateGroupWithPolicyProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy"; value: Uint8Array; @@ -402,10 +352,6 @@ export interface MsgCreateGroupWithPolicyResponse { /** group_policy_address is the account address of the newly created group policy. */ groupPolicyAddress: string; } -export interface ReactiveMsgCreateGroupWithPolicyResponse { - groupId: ComputedRef; - groupPolicyAddress: ComputedRef; -} export interface MsgCreateGroupWithPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse"; value: Uint8Array; @@ -430,11 +376,6 @@ export interface MsgUpdateGroupPolicyDecisionPolicy { /** decision_policy is the updated group policy's decision policy. */ decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; } -export interface ReactiveMsgUpdateGroupPolicyDecisionPolicy { - admin: ComputedRef; - groupPolicyAddress: ComputedRef; - decisionPolicy?: ComputedRef; -} export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy"; value: Uint8Array; @@ -457,7 +398,6 @@ export interface MsgUpdateGroupPolicyDecisionPolicyAminoMsg { } /** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ export interface MsgUpdateGroupPolicyDecisionPolicyResponse {} -export interface ReactiveMsgUpdateGroupPolicyDecisionPolicyResponse {} export interface MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse"; value: Uint8Array; @@ -477,11 +417,6 @@ export interface MsgUpdateGroupPolicyMetadata { /** metadata is the group policy metadata to be updated. */ metadata: string; } -export interface ReactiveMsgUpdateGroupPolicyMetadata { - admin: ComputedRef; - groupPolicyAddress: ComputedRef; - metadata: ComputedRef; -} export interface MsgUpdateGroupPolicyMetadataProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata"; value: Uint8Array; @@ -501,7 +436,6 @@ export interface MsgUpdateGroupPolicyMetadataAminoMsg { } /** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ export interface MsgUpdateGroupPolicyMetadataResponse {} -export interface ReactiveMsgUpdateGroupPolicyMetadataResponse {} export interface MsgUpdateGroupPolicyMetadataResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse"; value: Uint8Array; @@ -544,15 +478,6 @@ export interface MsgSubmitProposal { */ summary: string; } -export interface ReactiveMsgSubmitProposal { - groupPolicyAddress: ComputedRef; - proposers: ComputedRef; - metadata: ComputedRef; - messages: ComputedRef; - exec: ComputedRef; - title: ComputedRef; - summary: ComputedRef; -} export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.group.v1.MsgSubmitProposal"; value: Uint8Array; @@ -598,9 +523,6 @@ export interface MsgSubmitProposalResponse { /** proposal is the unique ID of the proposal. */ proposalId: bigint; } -export interface ReactiveMsgSubmitProposalResponse { - proposalId: ComputedRef; -} export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse"; value: Uint8Array; @@ -621,10 +543,6 @@ export interface MsgWithdrawProposal { /** address is the admin of the group policy or one of the proposer of the proposal. */ address: string; } -export interface ReactiveMsgWithdrawProposal { - proposalId: ComputedRef; - address: ComputedRef; -} export interface MsgWithdrawProposalProtoMsg { typeUrl: "/cosmos.group.v1.MsgWithdrawProposal"; value: Uint8Array; @@ -642,7 +560,6 @@ export interface MsgWithdrawProposalAminoMsg { } /** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ export interface MsgWithdrawProposalResponse {} -export interface ReactiveMsgWithdrawProposalResponse {} export interface MsgWithdrawProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse"; value: Uint8Array; @@ -669,13 +586,6 @@ export interface MsgVote { */ exec: Exec; } -export interface ReactiveMsgVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - metadata: ComputedRef; - exec: ComputedRef; -} export interface MsgVoteProtoMsg { typeUrl: "/cosmos.group.v1.MsgVote"; value: Uint8Array; @@ -702,7 +612,6 @@ export interface MsgVoteAminoMsg { } /** MsgVoteResponse is the Msg/Vote response type. */ export interface MsgVoteResponse {} -export interface ReactiveMsgVoteResponse {} export interface MsgVoteResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgVoteResponse"; value: Uint8Array; @@ -720,10 +629,6 @@ export interface MsgExec { /** executor is the account address used to execute the proposal. */ executor: string; } -export interface ReactiveMsgExec { - proposalId: ComputedRef; - executor: ComputedRef; -} export interface MsgExecProtoMsg { typeUrl: "/cosmos.group.v1.MsgExec"; value: Uint8Array; @@ -744,9 +649,6 @@ export interface MsgExecResponse { /** result is the final result of the proposal execution. */ result: ProposalExecutorResult; } -export interface ReactiveMsgExecResponse { - result: ComputedRef; -} export interface MsgExecResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgExecResponse"; value: Uint8Array; @@ -767,10 +669,6 @@ export interface MsgLeaveGroup { /** group_id is the unique ID of the group. */ groupId: bigint; } -export interface ReactiveMsgLeaveGroup { - address: ComputedRef; - groupId: ComputedRef; -} export interface MsgLeaveGroupProtoMsg { typeUrl: "/cosmos.group.v1.MsgLeaveGroup"; value: Uint8Array; @@ -788,7 +686,6 @@ export interface MsgLeaveGroupAminoMsg { } /** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ export interface MsgLeaveGroupResponse {} -export interface ReactiveMsgLeaveGroupResponse {} export interface MsgLeaveGroupResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/group/v1/types.ts b/libs/interchain-vue/src/cosmos/group/v1/types.ts index 1c1a10b4..f8e9c860 100644 --- a/libs/interchain-vue/src/cosmos/group/v1/types.ts +++ b/libs/interchain-vue/src/cosmos/group/v1/types.ts @@ -4,7 +4,6 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** VoteOption enumerates the valid vote options for a given proposal. */ export enum VoteOption { /** @@ -199,12 +198,6 @@ export interface Member { /** added_at is a timestamp specifying when a member was added. */ addedAt: Date; } -export interface ReactiveMember { - address: ComputedRef; - weight: ComputedRef; - metadata: ComputedRef; - addedAt: ComputedRef; -} export interface MemberProtoMsg { typeUrl: "/cosmos.group.v1.Member"; value: Uint8Array; @@ -240,11 +233,6 @@ export interface MemberRequest { /** metadata is any arbitrary metadata attached to the member. */ metadata: string; } -export interface ReactiveMemberRequest { - address: ComputedRef; - weight: ComputedRef; - metadata: ComputedRef; -} export interface MemberRequestProtoMsg { typeUrl: "/cosmos.group.v1.MemberRequest"; value: Uint8Array; @@ -283,10 +271,6 @@ export interface ThresholdDecisionPolicy { /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindows; } -export interface ReactiveThresholdDecisionPolicy { - threshold: ComputedRef; - windows?: ComputedRef; -} export interface ThresholdDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy"; value: Uint8Array; @@ -329,10 +313,6 @@ export interface PercentageDecisionPolicy { /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindows; } -export interface ReactivePercentageDecisionPolicy { - percentage: ComputedRef; - windows?: ComputedRef; -} export interface PercentageDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy"; value: Uint8Array; @@ -380,10 +360,6 @@ export interface DecisionPolicyWindows { */ minExecutionPeriod: Duration; } -export interface ReactiveDecisionPolicyWindows { - votingPeriod: ComputedRef; - minExecutionPeriod: ComputedRef; -} export interface DecisionPolicyWindowsProtoMsg { typeUrl: "/cosmos.group.v1.DecisionPolicyWindows"; value: Uint8Array; @@ -437,14 +413,6 @@ export interface GroupInfo { /** created_at is a timestamp specifying when a group was created. */ createdAt: Date; } -export interface ReactiveGroupInfo { - id: ComputedRef; - admin: ComputedRef; - metadata: ComputedRef; - version: ComputedRef; - totalWeight: ComputedRef; - createdAt: ComputedRef; -} export interface GroupInfoProtoMsg { typeUrl: "/cosmos.group.v1.GroupInfo"; value: Uint8Array; @@ -483,10 +451,6 @@ export interface GroupMember { /** member is the member data. */ member?: Member; } -export interface ReactiveGroupMember { - groupId: ComputedRef; - member?: ComputedRef; -} export interface GroupMemberProtoMsg { typeUrl: "/cosmos.group.v1.GroupMember"; value: Uint8Array; @@ -526,15 +490,6 @@ export interface GroupPolicyInfo { /** created_at is a timestamp specifying when a group policy was created. */ createdAt: Date; } -export interface ReactiveGroupPolicyInfo { - address: ComputedRef; - groupId: ComputedRef; - admin: ComputedRef; - metadata: ComputedRef; - version: ComputedRef; - decisionPolicy?: ComputedRef; - createdAt: ComputedRef; -} export interface GroupPolicyInfoProtoMsg { typeUrl: "/cosmos.group.v1.GroupPolicyInfo"; value: Uint8Array; @@ -637,22 +592,6 @@ export interface Proposal { */ summary: string; } -export interface ReactiveProposal { - id: ComputedRef; - groupPolicyAddress: ComputedRef; - metadata: ComputedRef; - proposers: ComputedRef; - submitTime: ComputedRef; - groupVersion: ComputedRef; - groupPolicyVersion: ComputedRef; - status: ComputedRef; - finalTallyResult: ComputedRef; - votingPeriodEnd: ComputedRef; - executorResult: ComputedRef; - messages: ComputedRef; - title: ComputedRef; - summary: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/cosmos.group.v1.Proposal"; value: Uint8Array; @@ -739,12 +678,6 @@ export interface TallyResult { /** no_with_veto_count is the weighted sum of veto. */ noWithVetoCount: string; } -export interface ReactiveTallyResult { - yesCount: ComputedRef; - abstainCount: ComputedRef; - noCount: ComputedRef; - noWithVetoCount: ComputedRef; -} export interface TallyResultProtoMsg { typeUrl: "/cosmos.group.v1.TallyResult"; value: Uint8Array; @@ -780,13 +713,6 @@ export interface Vote { /** submit_time is the timestamp when the vote was submitted. */ submitTime: Date; } -export interface ReactiveVote { - proposalId: ComputedRef; - voter: ComputedRef; - option: ComputedRef; - metadata: ComputedRef; - submitTime: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/cosmos.group.v1.Vote"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/ics23/v1/proofs.ts b/libs/interchain-vue/src/cosmos/ics23/v1/proofs.ts index bdefd7f7..30e1bc14 100644 --- a/libs/interchain-vue/src/cosmos/ics23/v1/proofs.ts +++ b/libs/interchain-vue/src/cosmos/ics23/v1/proofs.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; 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, @@ -198,12 +197,6 @@ export interface ExistenceProof { leaf?: LeafOp; path: InnerOp[]; } -export interface ReactiveExistenceProof { - key: ComputedRef; - value: ComputedRef; - leaf?: ComputedRef; - path: ComputedRef; -} export interface ExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.ExistenceProof"; value: Uint8Array; @@ -250,11 +243,6 @@ export interface NonExistenceProof { left?: ExistenceProof; right?: ExistenceProof; } -export interface ReactiveNonExistenceProof { - key: ComputedRef; - left?: ComputedRef; - right?: ComputedRef; -} export interface NonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.NonExistenceProof"; value: Uint8Array; @@ -281,12 +269,6 @@ export interface CommitmentProof { batch?: BatchProof; compressed?: CompressedBatchProof; } -export interface ReactiveCommitmentProof { - exist?: ComputedRef; - nonexist?: ComputedRef; - batch?: ComputedRef; - compressed?: ComputedRef; -} export interface CommitmentProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CommitmentProof"; value: Uint8Array; @@ -329,13 +311,6 @@ export interface LeafOp { */ prefix: Uint8Array; } -export interface ReactiveLeafOp { - hash: ComputedRef; - prehashKey: ComputedRef; - prehashValue: ComputedRef; - length: ComputedRef; - prefix: ComputedRef; -} export interface LeafOpProtoMsg { typeUrl: "/cosmos.ics23.v1.LeafOp"; value: Uint8Array; @@ -393,11 +368,6 @@ export interface InnerOp { prefix: Uint8Array; suffix: Uint8Array; } -export interface ReactiveInnerOp { - hash: ComputedRef; - prefix: ComputedRef; - suffix: ComputedRef; -} export interface InnerOpProtoMsg { typeUrl: "/cosmos.ics23.v1.InnerOp"; value: Uint8Array; @@ -461,13 +431,6 @@ export interface ProofSpec { */ prehashKeyBeforeComparison: boolean; } -export interface ReactiveProofSpec { - leafSpec?: ComputedRef; - innerSpec?: ComputedRef; - maxDepth: ComputedRef; - minDepth: ComputedRef; - prehashKeyBeforeComparison: ComputedRef; -} export interface ProofSpecProtoMsg { typeUrl: "/cosmos.ics23.v1.ProofSpec"; value: Uint8Array; @@ -535,14 +498,6 @@ export interface InnerSpec { /** hash is the algorithm that must be used for each InnerOp */ hash: HashOp; } -export interface ReactiveInnerSpec { - childOrder: ComputedRef; - childSize: ComputedRef; - minPrefixLength: ComputedRef; - maxPrefixLength: ComputedRef; - emptyChild: ComputedRef; - hash: ComputedRef; -} export interface InnerSpecProtoMsg { typeUrl: "/cosmos.ics23.v1.InnerSpec"; value: Uint8Array; @@ -581,9 +536,6 @@ export interface InnerSpecAminoMsg { export interface BatchProof { entries: BatchEntry[]; } -export interface ReactiveBatchProof { - entries: ComputedRef; -} export interface BatchProofProtoMsg { typeUrl: "/cosmos.ics23.v1.BatchProof"; value: Uint8Array; @@ -601,10 +553,6 @@ export interface BatchEntry { exist?: ExistenceProof; nonexist?: NonExistenceProof; } -export interface ReactiveBatchEntry { - exist?: ComputedRef; - nonexist?: ComputedRef; -} export interface BatchEntryProtoMsg { typeUrl: "/cosmos.ics23.v1.BatchEntry"; value: Uint8Array; @@ -622,10 +570,6 @@ export interface CompressedBatchProof { entries: CompressedBatchEntry[]; lookupInners: InnerOp[]; } -export interface ReactiveCompressedBatchProof { - entries: ComputedRef; - lookupInners: ComputedRef; -} export interface CompressedBatchProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedBatchProof"; value: Uint8Array; @@ -643,10 +587,6 @@ export interface CompressedBatchEntry { exist?: CompressedExistenceProof; nonexist?: CompressedNonExistenceProof; } -export interface ReactiveCompressedBatchEntry { - exist?: ComputedRef; - nonexist?: ComputedRef; -} export interface CompressedBatchEntryProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry"; value: Uint8Array; @@ -667,12 +607,6 @@ export interface CompressedExistenceProof { /** these are indexes into the lookup_inners table in CompressedBatchProof */ path: number[]; } -export interface ReactiveCompressedExistenceProof { - key: ComputedRef; - value: ComputedRef; - leaf?: ComputedRef; - path: ComputedRef; -} export interface CompressedExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof"; value: Uint8Array; @@ -694,11 +628,6 @@ export interface CompressedNonExistenceProof { left?: CompressedExistenceProof; right?: CompressedExistenceProof; } -export interface ReactiveCompressedNonExistenceProof { - key: ComputedRef; - left?: ComputedRef; - right?: ComputedRef; -} export interface CompressedNonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/mint/module/v1/module.ts b/libs/interchain-vue/src/cosmos/mint/module/v1/module.ts index f3a65642..73eedec2 100644 --- a/libs/interchain-vue/src/cosmos/mint/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/mint/module/v1/module.ts @@ -1,17 +1,12 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the mint module. */ export interface Module { feeCollectorName: string; /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - feeCollectorName: ComputedRef; - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.mint.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/genesis.ts index c2c2e4cb..8d3d556b 100644 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Minter, MinterAmino, Params, ParamsAmino } from "./mint"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the mint module's genesis state. */ export interface GenesisState { /** minter is a space for holding current inflation information. */ @@ -10,10 +9,6 @@ export interface GenesisState { /** params defines all the parameters of the module. */ params: Params; } -export interface ReactiveGenesisState { - minter: ComputedRef; - params: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.mint.v1beta1.GenesisState"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/mint.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/mint.ts index 9a5abe89..e06b7636 100644 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/mint.ts +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/mint.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Minter represents the minting state. */ export interface Minter { /** current annual inflation rate */ @@ -9,10 +8,6 @@ export interface Minter { /** current annual expected provisions */ annualProvisions: string; } -export interface ReactiveMinter { - inflation: ComputedRef; - annualProvisions: ComputedRef; -} export interface MinterProtoMsg { typeUrl: "/cosmos.mint.v1beta1.Minter"; value: Uint8Array; @@ -43,14 +38,6 @@ export interface Params { /** expected blocks per year */ blocksPerYear: bigint; } -export interface ReactiveParams { - mintDenom: ComputedRef; - inflationRateChange: ComputedRef; - inflationMax: ComputedRef; - inflationMin: ComputedRef; - goalBonded: ComputedRef; - blocksPerYear: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.mint.v1beta1.Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 0c48468c..00000000 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse, ReactiveQueryParamsRequest, ReactiveQueryInflationRequest, ReactiveQueryAnnualProvisionsRequest } from "./query"; -/** Query provides defines the gRPC querier service. */ -export interface Query { - /** Params returns the total set of minting parameters. */ - params(request?: QueryParamsRequest): Promise; - /** Inflation returns the current minting inflation value. */ - inflation(request?: QueryInflationRequest): Promise; - /** AnnualProvisions current minting annual provisions value. */ - annualProvisions(request?: QueryAnnualProvisionsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params returns the total set of minting parameters. */ - params = async (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 BinaryReader(data))); - }; - /* Inflation returns the current minting inflation value. */ - inflation = async (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 BinaryReader(data))); - }; - /* AnnualProvisions current minting annual provisions value. */ - annualProvisions = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - inflation(request?: QueryInflationRequest): Promise { - return queryService.inflation(request); - }, - annualProvisions(request?: QueryAnnualProvisionsRequest): Promise { - return queryService.annualProvisions(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseInflationQuery extends VueQueryParams { - request?: ReactiveQueryInflationRequest; -} -export interface UseAnnualProvisionsQuery extends VueQueryParams { - request?: ReactiveQueryAnnualProvisionsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useInflation = ({ - request, - options - }: UseInflationQuery) => { - const queryKey = ["inflationQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.inflation(params); - }, - ...options - }); - }; - const useAnnualProvisions = ({ - request, - options - }: UseAnnualProvisionsQuery) => { - const queryKey = ["annualProvisionsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.annualProvisions(params); - }, - ...options - }); - }; - return { - /** Params returns the total set of minting parameters. */useParams, - /** Inflation returns the current minting inflation value. */useInflation, - /** AnnualProvisions current minting annual provisions value. */useAnnualProvisions - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..a809d63d --- /dev/null +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.func.ts @@ -0,0 +1,23 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.mint.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetInflation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInflationRequest.encode, + decode: QueryInflationResponse.decode, + service: "cosmos.mint.v1beta1.Query", + method: "Inflation", + clientResolver +}); +export const createGetAnnualProvisions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAnnualProvisionsRequest.encode, + decode: QueryAnnualProvisionsResponse.decode, + service: "cosmos.mint.v1beta1.Query", + method: "AnnualProvisions", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..224f8a34 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; +import { createGetParams, createGetInflation, createGetAnnualProvisions } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetInflation = buildUseVueQuery({ + builderQueryFn: createGetInflation, + queryKeyPrefix: "InflationQuery" +}); +export const useGetAnnualProvisions = buildUseVueQuery({ + builderQueryFn: createGetAnnualProvisions, + queryKeyPrefix: "AnnualProvisionsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.ts index e2bd30c1..8673aec6 100644 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.ts @@ -2,10 +2,8 @@ import { Params, ParamsAmino } from "./mint"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.mint.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -21,9 +19,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.mint.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -39,7 +34,6 @@ export interface QueryParamsResponseAminoMsg { } /** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ export interface QueryInflationRequest {} -export interface ReactiveQueryInflationRequest {} export interface QueryInflationRequestProtoMsg { typeUrl: "/cosmos.mint.v1beta1.QueryInflationRequest"; value: Uint8Array; @@ -58,9 +52,6 @@ export interface QueryInflationResponse { /** inflation is the current minting inflation value. */ inflation: Uint8Array; } -export interface ReactiveQueryInflationResponse { - inflation: ComputedRef; -} export interface QueryInflationResponseProtoMsg { typeUrl: "/cosmos.mint.v1beta1.QueryInflationResponse"; value: Uint8Array; @@ -82,7 +73,6 @@ export interface QueryInflationResponseAminoMsg { * Query/AnnualProvisions RPC method. */ export interface QueryAnnualProvisionsRequest {} -export interface ReactiveQueryAnnualProvisionsRequest {} export interface QueryAnnualProvisionsRequestProtoMsg { typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest"; value: Uint8Array; @@ -104,9 +94,6 @@ export interface QueryAnnualProvisionsResponse { /** annual_provisions is the current minting annual provisions value. */ annualProvisions: Uint8Array; } -export interface ReactiveQueryAnnualProvisionsResponse { - annualProvisions: ComputedRef; -} export interface QueryAnnualProvisionsResponseProtoMsg { typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.amino.ts deleted file mode 100644 index 8298dfa5..00000000 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.amino.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/cosmos.mint.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/mint/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..d8aead51 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.func.ts @@ -0,0 +1,9 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateParams } from "./tx"; +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 9925ab44..00000000 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..9b8d58b6 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,6 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgUpdateParams } from "./tx"; +import { createUpdateParams } from "./tx.rpc.func.ts"; +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.ts index 554553bd..c22a93ae 100644 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino } from "./mint"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgUpdateParams is the Msg/UpdateParams request type. * @@ -18,10 +17,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -52,7 +47,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/nft/module/v1/module.ts b/libs/interchain-vue/src/cosmos/nft/module/v1/module.ts index dedd6466..d945fa98 100644 --- a/libs/interchain-vue/src/cosmos/nft/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/nft/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object of the nft module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.nft.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/event.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/event.ts index caa0c591..62d0c880 100644 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/event.ts +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/event.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** EventSend is emitted on Msg/Send */ export interface EventSend { /** class_id associated with the nft */ @@ -13,12 +12,6 @@ export interface EventSend { /** receiver is the receiver address of nft */ receiver: string; } -export interface ReactiveEventSend { - classId: ComputedRef; - id: ComputedRef; - sender: ComputedRef; - receiver: ComputedRef; -} export interface EventSendProtoMsg { typeUrl: "/cosmos.nft.v1beta1.EventSend"; value: Uint8Array; @@ -47,11 +40,6 @@ export interface EventMint { /** owner is the owner address of the nft */ owner: string; } -export interface ReactiveEventMint { - classId: ComputedRef; - id: ComputedRef; - owner: ComputedRef; -} export interface EventMintProtoMsg { typeUrl: "/cosmos.nft.v1beta1.EventMint"; value: Uint8Array; @@ -78,11 +66,6 @@ export interface EventBurn { /** owner is the owner address of the nft */ owner: string; } -export interface ReactiveEventBurn { - classId: ComputedRef; - id: ComputedRef; - owner: ComputedRef; -} export interface EventBurnProtoMsg { typeUrl: "/cosmos.nft.v1beta1.EventBurn"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/genesis.ts index 0300362a..fa4a88c2 100644 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Class, ClassAmino, NFT, NFTAmino } from "./nft"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** GenesisState defines the nft module's genesis state. */ export interface GenesisState { /** class defines the class of the nft type. */ @@ -10,10 +9,6 @@ export interface GenesisState { /** entry defines all nft owned by a person. */ entries: Entry[]; } -export interface ReactiveGenesisState { - classes: ComputedRef; - entries: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.nft.v1beta1.GenesisState"; value: Uint8Array; @@ -36,10 +31,6 @@ export interface Entry { /** nfts is a group of nfts of the same owner */ nfts: NFT[]; } -export interface ReactiveEntry { - owner: ComputedRef; - nfts: ComputedRef; -} export interface EntryProtoMsg { typeUrl: "/cosmos.nft.v1beta1.Entry"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/nft.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/nft.ts index d924da0e..74c458fd 100644 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/nft.ts +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/nft.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** 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 */ @@ -20,15 +19,6 @@ export interface Class { /** data is the app specific metadata of the NFT class. Optional */ data?: Any; } -export interface ReactiveClass { - id: ComputedRef; - name: ComputedRef; - symbol: ComputedRef; - description: ComputedRef; - uri: ComputedRef; - uriHash: ComputedRef; - data?: ComputedRef; -} export interface ClassProtoMsg { typeUrl: "/cosmos.nft.v1beta1.Class"; value: Uint8Array; @@ -67,13 +57,6 @@ export interface NFT { /** data is an app specific data of the NFT. Optional */ data?: Any; } -export interface ReactiveNFT { - classId: ComputedRef; - id: ComputedRef; - uri: ComputedRef; - uriHash: ComputedRef; - data?: ComputedRef; -} export interface NFTProtoMsg { typeUrl: "/cosmos.nft.v1beta1.NFT"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 27782e4f..00000000 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,330 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse, ReactiveQueryBalanceRequest, ReactiveQueryOwnerRequest, ReactiveQuerySupplyRequest, ReactiveQueryNFTsRequest, ReactiveQueryNFTRequest, ReactiveQueryClassRequest, ReactiveQueryClassesRequest } from "./query"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 */ - balance = async (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 BinaryReader(data))); - }; - /* Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 */ - owner = async (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 BinaryReader(data))); - }; - /* Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. */ - supply = async (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 BinaryReader(data))); - }; - /* NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in - ERC721Enumerable */ - nFTs = async (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 BinaryReader(data))); - }; - /* NFT queries an NFT based on its class and id. */ - nFT = async (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 BinaryReader(data))); - }; - /* Class queries an NFT class based on its id */ - class = async (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 BinaryReader(data))); - }; - /* Classes queries all NFT classes */ - classes = async (request: QueryClassesRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - balance(request: QueryBalanceRequest): Promise { - return queryService.balance(request); - }, - owner(request: QueryOwnerRequest): Promise { - return queryService.owner(request); - }, - supply(request: QuerySupplyRequest): Promise { - return queryService.supply(request); - }, - nFTs(request: QueryNFTsRequest): Promise { - return queryService.nFTs(request); - }, - nFT(request: QueryNFTRequest): Promise { - return queryService.nFT(request); - }, - class(request: QueryClassRequest): Promise { - return queryService.class(request); - }, - classes(request?: QueryClassesRequest): Promise { - return queryService.classes(request); - } - }; -}; -export interface UseBalanceQuery extends VueQueryParams { - request: ReactiveQueryBalanceRequest; -} -export interface UseOwnerQuery extends VueQueryParams { - request: ReactiveQueryOwnerRequest; -} -export interface UseSupplyQuery extends VueQueryParams { - request: ReactiveQuerySupplyRequest; -} -export interface UseNFTsQuery extends VueQueryParams { - request: ReactiveQueryNFTsRequest; -} -export interface UseNFTQuery extends VueQueryParams { - request: ReactiveQueryNFTRequest; -} -export interface UseClassQuery extends VueQueryParams { - request: ReactiveQueryClassRequest; -} -export interface UseClassesQuery extends VueQueryParams { - request?: ReactiveQueryClassesRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useBalance = ({ - request, - options - }: UseBalanceQuery) => { - const queryKey = ["balanceQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.balance(params); - }, - ...options - }); - }; - const useOwner = ({ - request, - options - }: UseOwnerQuery) => { - const queryKey = ["ownerQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.owner(params); - }, - ...options - }); - }; - const useSupply = ({ - request, - options - }: UseSupplyQuery) => { - const queryKey = ["supplyQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.supply(params); - }, - ...options - }); - }; - const useNFTs = ({ - request, - options - }: UseNFTsQuery) => { - const queryKey = ["nFTsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.nFTs(params); - }, - ...options - }); - }; - const useNFT = ({ - request, - options - }: UseNFTQuery) => { - const queryKey = ["nFTQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.nFT(params); - }, - ...options - }); - }; - const useClass = ({ - request, - options - }: UseClassQuery) => { - const queryKey = ["classQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.class(params); - }, - ...options - }); - }; - const useClasses = ({ - request, - options - }: UseClassesQuery) => { - const queryKey = ["classesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.classes(params); - }, - ...options - }); - }; - return { - /** Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 */useBalance, - /** Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 */useOwner, - /** Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. */useSupply, - /** - * NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in - * ERC721Enumerable - */ - useNFTs, - /** NFT queries an NFT based on its class and id. */useNFT, - /** Class queries an NFT class based on its id */useClass, - /** Classes queries all NFT classes */useClasses - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..26f23480 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.func.ts @@ -0,0 +1,51 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; +export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceRequest.encode, + decode: QueryBalanceResponse.decode, + service: "cosmos.nft.v1beta1.Query", + method: "Balance", + clientResolver +}); +export const createGetOwner = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOwnerRequest.encode, + decode: QueryOwnerResponse.decode, + service: "cosmos.nft.v1beta1.Query", + method: "Owner", + clientResolver +}); +export const createGetSupply = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySupplyRequest.encode, + decode: QuerySupplyResponse.decode, + service: "cosmos.nft.v1beta1.Query", + method: "Supply", + clientResolver +}); +export const createGetNFTs = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryNFTsRequest.encode, + decode: QueryNFTsResponse.decode, + service: "cosmos.nft.v1beta1.Query", + method: "NFTs", + clientResolver +}); +export const createGetNFT = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryNFTRequest.encode, + decode: QueryNFTResponse.decode, + service: "cosmos.nft.v1beta1.Query", + method: "NFT", + clientResolver +}); +export const createGetClass = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryClassRequest.encode, + decode: QueryClassResponse.decode, + service: "cosmos.nft.v1beta1.Query", + method: "Class", + clientResolver +}); +export const createGetClasses = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryClassesRequest.encode, + decode: QueryClassesResponse.decode, + service: "cosmos.nft.v1beta1.Query", + method: "Classes", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..f0fb8231 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts @@ -0,0 +1,31 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; +import { createGetBalance, createGetOwner, createGetSupply, createGetNFTs, createGetNFT, createGetClass, createGetClasses } from "./query.rpc.func.ts"; +export const useGetBalance = buildUseVueQuery({ + builderQueryFn: createGetBalance, + queryKeyPrefix: "BalanceQuery" +}); +export const useGetOwner = buildUseVueQuery({ + builderQueryFn: createGetOwner, + queryKeyPrefix: "OwnerQuery" +}); +export const useGetSupply = buildUseVueQuery({ + builderQueryFn: createGetSupply, + queryKeyPrefix: "SupplyQuery" +}); +export const useGetNFTs = buildUseVueQuery({ + builderQueryFn: createGetNFTs, + queryKeyPrefix: "NFTsQuery" +}); +export const useGetNFT = buildUseVueQuery({ + builderQueryFn: createGetNFT, + queryKeyPrefix: "NFTQuery" +}); +export const useGetClass = buildUseVueQuery({ + builderQueryFn: createGetClass, + queryKeyPrefix: "ClassQuery" +}); +export const useGetClasses = buildUseVueQuery({ + builderQueryFn: createGetClasses, + queryKeyPrefix: "ClassesQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.ts index 4840d2bb..1eaeb8a1 100644 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.ts @@ -3,7 +3,6 @@ import { NFT, NFTAmino, Class, ClassAmino } from "./nft"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method */ export interface QueryBalanceRequest { /** class_id associated with the nft */ @@ -11,10 +10,6 @@ export interface QueryBalanceRequest { /** owner is the owner address of the nft */ owner: string; } -export interface ReactiveQueryBalanceRequest { - classId: ComputedRef; - owner: ComputedRef; -} export interface QueryBalanceRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryBalanceRequest"; value: Uint8Array; @@ -35,9 +30,6 @@ export interface QueryBalanceResponse { /** amount is the number of all NFTs of a given class owned by the owner */ amount: bigint; } -export interface ReactiveQueryBalanceResponse { - amount: ComputedRef; -} export interface QueryBalanceResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryBalanceResponse"; value: Uint8Array; @@ -58,10 +50,6 @@ export interface QueryOwnerRequest { /** id is a unique identifier of the NFT */ id: string; } -export interface ReactiveQueryOwnerRequest { - classId: ComputedRef; - id: ComputedRef; -} export interface QueryOwnerRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryOwnerRequest"; value: Uint8Array; @@ -82,9 +70,6 @@ export interface QueryOwnerResponse { /** owner is the owner address of the nft */ owner: string; } -export interface ReactiveQueryOwnerResponse { - owner: ComputedRef; -} export interface QueryOwnerResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryOwnerResponse"; value: Uint8Array; @@ -103,9 +88,6 @@ export interface QuerySupplyRequest { /** class_id associated with the nft */ classId: string; } -export interface ReactiveQuerySupplyRequest { - classId: ComputedRef; -} export interface QuerySupplyRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QuerySupplyRequest"; value: Uint8Array; @@ -124,9 +106,6 @@ export interface QuerySupplyResponse { /** amount is the number of all NFTs from the given class */ amount: bigint; } -export interface ReactiveQuerySupplyResponse { - amount: ComputedRef; -} export interface QuerySupplyResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QuerySupplyResponse"; value: Uint8Array; @@ -149,11 +128,6 @@ export interface QueryNFTsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryNFTsRequest { - classId: ComputedRef; - owner: ComputedRef; - pagination?: ComputedRef; -} export interface QueryNFTsRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryNFTsRequest"; value: Uint8Array; @@ -178,10 +152,6 @@ export interface QueryNFTsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryNFTsResponse { - nfts: ComputedRef; - pagination?: ComputedRef; -} export interface QueryNFTsResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryNFTsResponse"; value: Uint8Array; @@ -204,10 +174,6 @@ export interface QueryNFTRequest { /** id is a unique identifier of the NFT */ id: string; } -export interface ReactiveQueryNFTRequest { - classId: ComputedRef; - id: ComputedRef; -} export interface QueryNFTRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryNFTRequest"; value: Uint8Array; @@ -228,9 +194,6 @@ export interface QueryNFTResponse { /** owner is the owner address of the nft */ nft?: NFT; } -export interface ReactiveQueryNFTResponse { - nft?: ComputedRef; -} export interface QueryNFTResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryNFTResponse"; value: Uint8Array; @@ -249,9 +212,6 @@ export interface QueryClassRequest { /** class_id associated with the nft */ classId: string; } -export interface ReactiveQueryClassRequest { - classId: ComputedRef; -} export interface QueryClassRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryClassRequest"; value: Uint8Array; @@ -270,9 +230,6 @@ export interface QueryClassResponse { /** class defines the class of the nft type. */ class?: Class; } -export interface ReactiveQueryClassResponse { - class?: ComputedRef; -} export interface QueryClassResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryClassResponse"; value: Uint8Array; @@ -291,9 +248,6 @@ export interface QueryClassesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryClassesRequest { - pagination?: ComputedRef; -} export interface QueryClassesRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryClassesRequest"; value: Uint8Array; @@ -314,10 +268,6 @@ export interface QueryClassesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryClassesResponse { - classes: ComputedRef; - pagination?: ComputedRef; -} export interface QueryClassesResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryClassesResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.amino.ts deleted file mode 100644 index a10e415f..00000000 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.amino.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MsgSend } from "./tx"; -export const AminoConverter = { - "/cosmos.nft.v1beta1.MsgSend": { - aminoType: "cosmos-sdk/MsgNFTSend", - toAmino: MsgSend.toAmino, - fromAmino: MsgSend.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..e8e832b3 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.func.ts @@ -0,0 +1,9 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSend } from "./tx"; +export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSend.typeUrl, + encoders: toEncoders(MsgSend), + converters: toConverters(MsgSend) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 9d6e78b5..00000000 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSend, MsgSendResponse } from "./tx"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Send defines a method to send a nft from one account to another account. */ - send = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..6ec53ef6 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,6 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSend } from "./tx"; +import { createSend } from "./tx.rpc.func.ts"; +export const useSend = buildUseVueMutation({ + builderMutationFn: createSend +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.ts index c64b8fdc..26b670d0 100644 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** 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 */ @@ -13,12 +12,6 @@ export interface MsgSend { /** receiver is the receiver address of nft */ receiver: string; } -export interface ReactiveMsgSend { - classId: ComputedRef; - id: ComputedRef; - sender: ComputedRef; - receiver: ComputedRef; -} export interface MsgSendProtoMsg { typeUrl: "/cosmos.nft.v1beta1.MsgSend"; value: Uint8Array; @@ -40,7 +33,6 @@ export interface MsgSendAminoMsg { } /** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponse {} -export interface ReactiveMsgSendResponse {} export interface MsgSendResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/orm/module/v1alpha1/module.ts b/libs/interchain-vue/src/cosmos/orm/module/v1alpha1/module.ts index f5b4eb69..15e37151 100644 --- a/libs/interchain-vue/src/cosmos/orm/module/v1alpha1/module.ts +++ b/libs/interchain-vue/src/cosmos/orm/module/v1alpha1/module.ts @@ -7,7 +7,6 @@ import { GlobalDecoderRegistry } from "../../../../registry"; * services for modules that use the ORM. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.orm.module.v1alpha1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.Query.ts deleted file mode 100644 index 29990d78..00000000 --- a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.Query.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; -/** Query is a generic gRPC service for querying ORM data. */ -export interface Query { - /** Get queries an ORM table against an unique index. */ - get(request: GetRequest): Promise; - /** List queries an ORM table against an index. */ - list(request: ListRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Get queries an ORM table against an unique index. */ - get = async (request: GetRequest): Promise => { - const data = GetRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "Get", data); - return promise.then(data => GetResponse.decode(new BinaryReader(data))); - }; - /* List queries an ORM table against an index. */ - list = async (request: ListRequest): Promise => { - const data = ListRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "List", data); - return promise.then(data => ListResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - get(request: GetRequest): Promise { - return queryService.get(request); - }, - list(request: ListRequest): Promise { - return queryService.list(request); - } - }; -}; -export interface UseGetQuery extends VueQueryParams { - request: ReactiveGetRequest; -} -export interface UseListQuery extends VueQueryParams { - request: ReactiveListRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useGet = ({ - request, - options - }: UseGetQuery) => { - const queryKey = ["getQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.get(params); - }, - ...options - }); - }; - const useList = ({ - request, - options - }: UseListQuery) => { - const queryKey = ["listQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.list(params); - }, - ...options - }); - }; - return { - /** Get queries an ORM table against an unique index. */useGet, - /** List queries an ORM table against an index. */useList - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts new file mode 100644 index 00000000..3a1a9322 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts @@ -0,0 +1,16 @@ +import { RpcResolver, buildQuery } from "../../../../helper-func-types"; +import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; +export const createGetGet = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetRequest.encode, + decode: GetResponse.decode, + service: "cosmos.orm.query.v1alpha1.Query", + method: "Get", + clientResolver +}); +export const createGetList = (clientResolver?: RpcResolver) => buildQuery({ + encode: ListRequest.encode, + decode: ListResponse.decode, + service: "cosmos.orm.query.v1alpha1.Query", + method: "List", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts new file mode 100644 index 00000000..1d9671d9 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts @@ -0,0 +1,11 @@ +import { buildUseVueQuery } from "../../../../vue-query"; +import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; +import { createGetGet, createGetList } from "./query.rpc.func.ts"; +export const useGetGet = buildUseVueQuery({ + builderQueryFn: createGetGet, + queryKeyPrefix: "GetQuery" +}); +export const useGetList = buildUseVueQuery({ + builderQueryFn: createGetList, + queryKeyPrefix: "ListQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.ts b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.ts index ea88bb33..dbecba22 100644 --- a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.ts +++ b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.ts @@ -5,7 +5,6 @@ import { Duration, DurationAmino } from "../../../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** GetRequest is the Query/Get request type. */ export interface GetRequest { /** message_name is the fully-qualified message name of the ORM table being queried. */ @@ -23,11 +22,6 @@ export interface GetRequest { */ values: IndexValue[]; } -export interface ReactiveGetRequest { - messageName: ComputedRef; - index: ComputedRef; - values: ComputedRef; -} export interface GetRequestProtoMsg { typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest"; value: Uint8Array; @@ -61,9 +55,6 @@ export interface GetResponse { */ result?: Any; } -export interface ReactiveGetResponse { - result?: ComputedRef; -} export interface GetResponseProtoMsg { typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse"; value: Uint8Array; @@ -96,13 +87,6 @@ export interface ListRequest { /** pagination is the pagination request. */ pagination?: PageRequest; } -export interface ReactiveListRequest { - messageName: ComputedRef; - index: ComputedRef; - prefix?: ComputedRef; - range?: ComputedRef; - pagination?: ComputedRef; -} export interface ListRequestProtoMsg { typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest"; value: Uint8Array; @@ -136,9 +120,6 @@ export interface ListRequest_Prefix { */ values: IndexValue[]; } -export interface ReactiveListRequest_Prefix { - values: ComputedRef; -} export interface ListRequest_PrefixProtoMsg { typeUrl: "/cosmos.orm.query.v1alpha1.Prefix"; value: Uint8Array; @@ -171,10 +152,6 @@ export interface ListRequest_Range { */ end: IndexValue[]; } -export interface ReactiveListRequest_Range { - start: ComputedRef; - end: ComputedRef; -} export interface ListRequest_RangeProtoMsg { typeUrl: "/cosmos.orm.query.v1alpha1.Range"; value: Uint8Array; @@ -205,10 +182,6 @@ export interface ListResponse { /** pagination is the pagination response. */ pagination?: PageResponse; } -export interface ReactiveListResponse { - results: ComputedRef; - pagination?: ComputedRef; -} export interface ListResponseProtoMsg { typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse"; value: Uint8Array; @@ -249,16 +222,6 @@ export interface IndexValue { /** duration specifies a value for a duration index field. */ duration?: Duration; } -export interface ReactiveIndexValue { - uint?: ComputedRef; - int?: ComputedRef; - str?: ComputedRef; - bytes?: ComputedRef; - enum?: ComputedRef; - bool?: ComputedRef; - timestamp?: ComputedRef; - duration?: ComputedRef; -} export interface IndexValueProtoMsg { typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/orm/v1/orm.ts b/libs/interchain-vue/src/cosmos/orm/v1/orm.ts index 4a3fa633..3e1a36e3 100644 --- a/libs/interchain-vue/src/cosmos/orm/v1/orm.ts +++ b/libs/interchain-vue/src/cosmos/orm/v1/orm.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** TableDescriptor describes an ORM table. */ export interface TableDescriptor { /** primary_key defines the primary key for the table. */ @@ -15,11 +14,6 @@ export interface TableDescriptor { */ id: number; } -export interface ReactiveTableDescriptor { - primaryKey?: ComputedRef; - index: ComputedRef; - id: ComputedRef; -} export interface TableDescriptorProtoMsg { typeUrl: "/cosmos.orm.v1.TableDescriptor"; value: Uint8Array; @@ -86,10 +80,6 @@ export interface PrimaryKeyDescriptor { */ autoIncrement: boolean; } -export interface ReactivePrimaryKeyDescriptor { - fields: ComputedRef; - autoIncrement: ComputedRef; -} export interface PrimaryKeyDescriptorProtoMsg { typeUrl: "/cosmos.orm.v1.PrimaryKeyDescriptor"; value: Uint8Array; @@ -166,11 +156,6 @@ export interface SecondaryIndexDescriptor { /** unique specifies that this an unique index. */ unique: boolean; } -export interface ReactiveSecondaryIndexDescriptor { - fields: ComputedRef; - id: ComputedRef; - unique: ComputedRef; -} export interface SecondaryIndexDescriptorProtoMsg { typeUrl: "/cosmos.orm.v1.SecondaryIndexDescriptor"; value: Uint8Array; @@ -211,9 +196,6 @@ export interface SingletonDescriptor { */ id: number; } -export interface ReactiveSingletonDescriptor { - id: ComputedRef; -} export interface SingletonDescriptorProtoMsg { typeUrl: "/cosmos.orm.v1.SingletonDescriptor"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/orm/v1alpha1/schema.ts b/libs/interchain-vue/src/cosmos/orm/v1alpha1/schema.ts index eec5ee71..471f3e39 100644 --- a/libs/interchain-vue/src/cosmos/orm/v1alpha1/schema.ts +++ b/libs/interchain-vue/src/cosmos/orm/v1alpha1/schema.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** StorageType */ export enum StorageType { /** @@ -65,10 +64,6 @@ export interface ModuleSchemaDescriptor { */ prefix: Uint8Array; } -export interface ReactiveModuleSchemaDescriptor { - schemaFile: ComputedRef; - prefix: ComputedRef; -} export interface ModuleSchemaDescriptorProtoMsg { typeUrl: "/cosmos.orm.v1alpha1.ModuleSchemaDescriptor"; value: Uint8Array; @@ -106,11 +101,6 @@ export interface ModuleSchemaDescriptor_FileEntry { */ storageType: StorageType; } -export interface ReactiveModuleSchemaDescriptor_FileEntry { - id: ComputedRef; - protoFileName: ComputedRef; - storageType: ComputedRef; -} export interface ModuleSchemaDescriptor_FileEntryProtoMsg { typeUrl: "/cosmos.orm.v1alpha1.FileEntry"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/params/module/v1/module.ts b/libs/interchain-vue/src/cosmos/params/module/v1/module.ts index ded10927..ad73de69 100644 --- a/libs/interchain-vue/src/cosmos/params/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/params/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object of the params module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.params.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/params/v1beta1/params.ts b/libs/interchain-vue/src/cosmos/params/v1beta1/params.ts index 46f09f89..b4065457 100644 --- a/libs/interchain-vue/src/cosmos/params/v1beta1/params.ts +++ b/libs/interchain-vue/src/cosmos/params/v1beta1/params.ts @@ -1,18 +1,12 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** ParameterChangeProposal defines a proposal to change one or more parameters. */ export interface ParameterChangeProposal { title: string; description: string; changes: ParamChange[]; } -export interface ReactiveParameterChangeProposal { - title: ComputedRef; - description: ComputedRef; - changes: ComputedRef; -} export interface ParameterChangeProposalProtoMsg { typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal"; value: Uint8Array; @@ -36,11 +30,6 @@ export interface ParamChange { key: string; value: string; } -export interface ReactiveParamChange { - subspace: ComputedRef; - key: ComputedRef; - value: ComputedRef; -} export interface ParamChangeProtoMsg { typeUrl: "/cosmos.params.v1beta1.ParamChange"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 3ef31425..00000000 --- a/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse, ReactiveQueryParamsRequest, ReactiveQuerySubspacesRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Params queries a specific parameter of a module, given its subspace and - * 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params queries a specific parameter of a module, given its subspace and - key. */ - params = async (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 BinaryReader(data))); - }; - /* Subspaces queries for all registered subspaces and all keys for a subspace. - - Since: cosmos-sdk 0.46 */ - subspaces = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request: QueryParamsRequest): Promise { - return queryService.params(request); - }, - subspaces(request?: QuerySubspacesRequest): Promise { - return queryService.subspaces(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request: ReactiveQueryParamsRequest; -} -export interface UseSubspacesQuery extends VueQueryParams { - request?: ReactiveQuerySubspacesRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useSubspaces = ({ - request, - options - }: UseSubspacesQuery) => { - const queryKey = ["subspacesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.subspaces(params); - }, - ...options - }); - }; - return { - /** - * Params queries a specific parameter of a module, given its subspace and - * key. - */ - useParams, - /** - * Subspaces queries for all registered subspaces and all keys for a subspace. - * - * Since: cosmos-sdk 0.46 - */ - useSubspaces - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..ce4af5b2 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.func.ts @@ -0,0 +1,16 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.params.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetSubspaces = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubspacesRequest.encode, + decode: QuerySubspacesResponse.decode, + service: "cosmos.params.v1beta1.Query", + method: "Subspaces", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..2b06be90 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts @@ -0,0 +1,11 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; +import { createGetParams, createGetSubspaces } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetSubspaces = buildUseVueQuery({ + builderQueryFn: createGetSubspaces, + queryKeyPrefix: "SubspacesQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/params/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/params/v1beta1/query.ts index 8f97f4ea..8e61a295 100644 --- a/libs/interchain-vue/src/cosmos/params/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/params/v1beta1/query.ts @@ -2,7 +2,6 @@ import { ParamChange, ParamChangeAmino } from "./params"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest { /** subspace defines the module to query the parameter for. */ @@ -10,10 +9,6 @@ export interface QueryParamsRequest { /** key defines the key of the parameter in the subspace. */ key: string; } -export interface ReactiveQueryParamsRequest { - subspace: ComputedRef; - key: ComputedRef; -} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -34,9 +29,6 @@ export interface QueryParamsResponse { /** param defines the queried parameter. */ param: ParamChange; } -export interface ReactiveQueryParamsResponse { - param: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -57,7 +49,6 @@ export interface QueryParamsResponseAminoMsg { * Since: cosmos-sdk 0.46 */ export interface QuerySubspacesRequest {} -export interface ReactiveQuerySubspacesRequest {} export interface QuerySubspacesRequestProtoMsg { typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest"; value: Uint8Array; @@ -82,9 +73,6 @@ export interface QuerySubspacesRequestAminoMsg { export interface QuerySubspacesResponse { subspaces: Subspace[]; } -export interface ReactiveQuerySubspacesResponse { - subspaces: ComputedRef; -} export interface QuerySubspacesResponseProtoMsg { typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse"; value: Uint8Array; @@ -112,10 +100,6 @@ export interface Subspace { subspace: string; keys: string[]; } -export interface ReactiveSubspace { - subspace: ComputedRef; - keys: ComputedRef; -} export interface SubspaceProtoMsg { typeUrl: "/cosmos.params.v1beta1.Subspace"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.func.ts b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.func.ts new file mode 100644 index 00000000..51c035b2 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.func.ts @@ -0,0 +1,9 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { FileDescriptorsRequest, FileDescriptorsResponse } from "./reflection"; +export const createGetFileDescriptors = (clientResolver?: RpcResolver) => buildQuery({ + encode: FileDescriptorsRequest.encode, + decode: FileDescriptorsResponse.decode, + service: "cosmos.reflection.v1.ReflectionService", + method: "FileDescriptors", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts new file mode 100644 index 00000000..dd4805e1 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts @@ -0,0 +1,7 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { FileDescriptorsRequest, FileDescriptorsResponse } from "./reflection"; +import { createGetFileDescriptors } from "./reflection.rpc.func.ts"; +export const useGetFileDescriptors = buildUseVueQuery({ + builderQueryFn: createGetFileDescriptors, + queryKeyPrefix: "FileDescriptorsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/reflection/v1/reflection.ts b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.ts index 596e4f1c..d0a81153 100644 --- a/libs/interchain-vue/src/cosmos/reflection/v1/reflection.ts +++ b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.ts @@ -2,10 +2,8 @@ import { FileDescriptorProto, FileDescriptorProtoAmino } from "../../../google/p import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** FileDescriptorsRequest is the Query/FileDescriptors request type. */ export interface FileDescriptorsRequest {} -export interface ReactiveFileDescriptorsRequest {} export interface FileDescriptorsRequestProtoMsg { typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest"; value: Uint8Array; @@ -21,9 +19,6 @@ export interface FileDescriptorsResponse { /** files is the file descriptors. */ files: FileDescriptorProto[]; } -export interface ReactiveFileDescriptorsResponse { - files: ComputedRef; -} export interface FileDescriptorsResponseProtoMsg { typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/rpc.query.ts b/libs/interchain-vue/src/cosmos/rpc.query.ts deleted file mode 100644 index 268e6810..00000000 --- a/libs/interchain-vue/src/cosmos/rpc.query.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import { QueryClient } from "@cosmjs/stargate"; -export const createRPCQueryClient = async ({ - rpcEndpoint -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - cosmos: { - app: { - v1alpha1: (await import("./app/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) - }, - auth: { - v1beta1: (await import("./auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - authz: { - v1beta1: (await import("./authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - autocli: { - v1: (await import("./autocli/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - bank: { - v1beta1: (await import("./bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - base: { - grpc: { - v2: (await import("./base/grpc/v2/service.rpc.Service")).createRpcQueryExtension(client) - }, - node: { - v1beta1: (await import("./base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client), - v2: (await import("./base/node/v2/query.rpc.Service")).createRpcQueryExtension(client) - }, - tendermint: { - v1beta1: (await import("./base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) - } - }, - circuit: { - v1: (await import("./circuit/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - consensus: { - v1: (await import("./consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - distribution: { - v1beta1: (await import("./distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - evidence: { - v1beta1: (await import("./evidence/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - feegrant: { - v1beta1: (await import("./feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - gov: { - v1: (await import("./gov/v1/query.rpc.Query")).createRpcQueryExtension(client), - v1beta1: (await import("./gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - group: { - v1: (await import("./group/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - mint: { - v1beta1: (await import("./mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - nft: { - v1beta1: (await import("./nft/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - orm: { - query: { - v1alpha1: (await import("./orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) - } - }, - params: { - v1beta1: (await import("./params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - slashing: { - v1beta1: (await import("./slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - staking: { - v1beta1: (await import("./staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - tx: { - v1beta1: (await import("./tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) - }, - upgrade: { - v1beta1: (await import("./upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - } - } - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/rpc.tx.ts b/libs/interchain-vue/src/cosmos/rpc.tx.ts deleted file mode 100644 index d67a0bf5..00000000 --- a/libs/interchain-vue/src/cosmos/rpc.tx.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - auth: { - v1beta1: new (await import("./auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - authz: { - v1beta1: new (await import("./authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("./bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - circuit: { - v1: new (await import("./circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - consensus: { - v1: new (await import("./consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - crisis: { - v1beta1: new (await import("./crisis/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("./distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - evidence: { - v1beta1: new (await import("./evidence/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("./feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("./gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("./gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("./group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - mint: { - v1beta1: new (await import("./mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - nft: { - v1beta1: new (await import("./nft/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - slashing: { - v1beta1: new (await import("./slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("./staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - upgrade: { - v1beta1: new (await import("./upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("./vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - } -}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/module/v1/module.ts b/libs/interchain-vue/src/cosmos/slashing/module/v1/module.ts index 08cf241b..d3710857 100644 --- a/libs/interchain-vue/src/cosmos/slashing/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/slashing/module/v1/module.ts @@ -1,15 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the slashing module. */ export interface Module { /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.slashing.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/genesis.ts index bc3a7fc4..777a3d83 100644 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino, ValidatorSigningInfo, ValidatorSigningInfoAmino } import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the slashing module's genesis state. */ export interface GenesisState { /** params defines all the parameters of the module. */ @@ -18,11 +17,6 @@ export interface GenesisState { */ missedBlocks: ValidatorMissedBlocks[]; } -export interface ReactiveGenesisState { - params: ComputedRef; - signingInfos: ComputedRef; - missedBlocks: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.GenesisState"; value: Uint8Array; @@ -53,10 +47,6 @@ export interface SigningInfo { /** validator_signing_info represents the signing info of this validator. */ validatorSigningInfo: ValidatorSigningInfo; } -export interface ReactiveSigningInfo { - address: ComputedRef; - validatorSigningInfo: ComputedRef; -} export interface SigningInfoProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.SigningInfo"; value: Uint8Array; @@ -82,10 +72,6 @@ export interface ValidatorMissedBlocks { /** missed_blocks is an array of missed blocks by the validator. */ missedBlocks: MissedBlock[]; } -export interface ReactiveValidatorMissedBlocks { - address: ComputedRef; - missedBlocks: ComputedRef; -} export interface ValidatorMissedBlocksProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.ValidatorMissedBlocks"; value: Uint8Array; @@ -111,10 +97,6 @@ export interface MissedBlock { /** missed is the missed status. */ missed: boolean; } -export interface ReactiveMissedBlock { - index: ComputedRef; - missed: ComputedRef; -} export interface MissedBlockProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.MissedBlock"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 5159f159..00000000 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,162 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse, ReactiveQueryParamsRequest, ReactiveQuerySigningInfoRequest, ReactiveQuerySigningInfosRequest } from "./query"; -/** Query provides defines the gRPC querier service */ -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; - /** SigningInfos queries signing info of all validators */ - signingInfos(request?: QuerySigningInfosRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Params queries the parameters of slashing module */ - params = async (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 BinaryReader(data))); - }; - /* SigningInfo queries the signing info of given cons address */ - signingInfo = async (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 BinaryReader(data))); - }; - /* SigningInfos queries signing info of all validators */ - signingInfos = async (request: QuerySigningInfosRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - signingInfo(request: QuerySigningInfoRequest): Promise { - return queryService.signingInfo(request); - }, - signingInfos(request?: QuerySigningInfosRequest): Promise { - return queryService.signingInfos(request); - } - }; -}; -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseSigningInfoQuery extends VueQueryParams { - request: ReactiveQuerySigningInfoRequest; -} -export interface UseSigningInfosQuery extends VueQueryParams { - request?: ReactiveQuerySigningInfosRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useSigningInfo = ({ - request, - options - }: UseSigningInfoQuery) => { - const queryKey = ["signingInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.signingInfo(params); - }, - ...options - }); - }; - const useSigningInfos = ({ - request, - options - }: UseSigningInfosQuery) => { - const queryKey = ["signingInfosQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.signingInfos(params); - }, - ...options - }); - }; - return { - /** Params queries the parameters of slashing module */useParams, - /** SigningInfo queries the signing info of given cons address */useSigningInfo, - /** SigningInfos queries signing info of all validators */useSigningInfos - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..7d006ede --- /dev/null +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.func.ts @@ -0,0 +1,23 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.slashing.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetSigningInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySigningInfoRequest.encode, + decode: QuerySigningInfoResponse.decode, + service: "cosmos.slashing.v1beta1.Query", + method: "SigningInfo", + clientResolver +}); +export const createGetSigningInfos = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySigningInfosRequest.encode, + decode: QuerySigningInfosResponse.decode, + service: "cosmos.slashing.v1beta1.Query", + method: "SigningInfos", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..cc3cd01d --- /dev/null +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts @@ -0,0 +1,15 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./query"; +import { createGetParams, createGetSigningInfo, createGetSigningInfos } from "./query.rpc.func.ts"; +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetSigningInfo = buildUseVueQuery({ + builderQueryFn: createGetSigningInfo, + queryKeyPrefix: "SigningInfoQuery" +}); +export const useGetSigningInfos = buildUseVueQuery({ + builderQueryFn: createGetSigningInfos, + queryKeyPrefix: "SigningInfosQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.ts index 67ccaf33..0d81a59d 100644 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.ts @@ -3,10 +3,8 @@ import { Params, ParamsAmino, ValidatorSigningInfo, ValidatorSigningInfoAmino } import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** QueryParamsRequest is the request type for the Query/Params RPC method */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -21,9 +19,6 @@ export interface QueryParamsRequestAminoMsg { export interface QueryParamsResponse { params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QueryParamsResponse"; value: Uint8Array; @@ -44,9 +39,6 @@ export interface QuerySigningInfoRequest { /** cons_address is the address to query signing info of */ consAddress: string; } -export interface ReactiveQuerySigningInfoRequest { - consAddress: ComputedRef; -} export interface QuerySigningInfoRequestProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfoRequest"; value: Uint8Array; @@ -71,9 +63,6 @@ export interface QuerySigningInfoResponse { /** val_signing_info is the signing info of requested val cons address */ valSigningInfo: ValidatorSigningInfo; } -export interface ReactiveQuerySigningInfoResponse { - valSigningInfo: ComputedRef; -} export interface QuerySigningInfoResponseProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfoResponse"; value: Uint8Array; @@ -97,9 +86,6 @@ export interface QuerySigningInfoResponseAminoMsg { export interface QuerySigningInfosRequest { pagination?: PageRequest; } -export interface ReactiveQuerySigningInfosRequest { - pagination?: ComputedRef; -} export interface QuerySigningInfosRequestProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfosRequest"; value: Uint8Array; @@ -124,10 +110,6 @@ export interface QuerySigningInfosResponse { info: ValidatorSigningInfo[]; pagination?: PageResponse; } -export interface ReactiveQuerySigningInfosResponse { - info: ComputedRef; - pagination?: ComputedRef; -} export interface QuerySigningInfosResponseProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfosResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/slashing.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/slashing.ts index c8d903cc..4977d013 100644 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/slashing.ts +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/slashing.ts @@ -3,7 +3,6 @@ import { Duration, DurationAmino } from "../../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * ValidatorSigningInfo defines a validator's signing info for monitoring their * liveness activity. @@ -32,14 +31,6 @@ export interface ValidatorSigningInfo { */ missedBlocksCounter: bigint; } -export interface ReactiveValidatorSigningInfo { - address: ComputedRef; - startHeight: ComputedRef; - indexOffset: ComputedRef; - jailedUntil: ComputedRef; - tombstoned: ComputedRef; - missedBlocksCounter: ComputedRef; -} export interface ValidatorSigningInfoProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.ValidatorSigningInfo"; value: Uint8Array; @@ -84,13 +75,6 @@ export interface Params { slashFractionDoubleSign: Uint8Array; slashFractionDowntime: Uint8Array; } -export interface ReactiveParams { - signedBlocksWindow: ComputedRef; - minSignedPerWindow: ComputedRef; - downtimeJailDuration: ComputedRef; - slashFractionDoubleSign: ComputedRef; - slashFractionDowntime: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.amino.ts deleted file mode 100644 index d3e20641..00000000 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.amino.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MsgUnjail, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/cosmos.slashing.v1beta1.MsgUnjail": { - aminoType: "cosmos-sdk/MsgUnjail", - toAmino: MsgUnjail.toAmino, - fromAmino: MsgUnjail.fromAmino - }, - "/cosmos.slashing.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/slashing/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..d82a1266 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUnjail, MsgUpdateParams } from "./tx"; +export const createUnjail = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnjail.typeUrl, + encoders: toEncoders(MsgUnjail), + converters: toConverters(MsgUnjail) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 55138c75..00000000 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgUnjail, MsgUnjailResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the slashing Msg service. */ -export interface Msg { - /** - * Unjail defines a method for unjailing a jailed validator, thus returning - * them into the bonded validator set, so they can begin receiving provisions - * 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Unjail defines a method for unjailing a jailed validator, thus returning - them into the bonded validator set, so they can begin receiving provisions - and rewards again. */ - unjail = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..6a1fd7d8 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,9 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgUnjail, MsgUpdateParams } from "./tx"; +import { createUnjail, createUpdateParams } from "./tx.rpc.func.ts"; +export const useUnjail = buildUseVueMutation({ + builderMutationFn: createUnjail +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.ts index 19044ded..72131dbf 100644 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.ts @@ -2,14 +2,10 @@ import { Params, ParamsAmino } from "./slashing"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** MsgUnjail defines the Msg/Unjail request type */ export interface MsgUnjail { validatorAddr: string; } -export interface ReactiveMsgUnjail { - validatorAddr: ComputedRef; -} export interface MsgUnjailProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail"; value: Uint8Array; @@ -24,7 +20,6 @@ export interface MsgUnjailAminoMsg { } /** MsgUnjailResponse defines the Msg/Unjail response type */ export interface MsgUnjailResponse {} -export interface ReactiveMsgUnjailResponse {} export interface MsgUnjailResponseProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.MsgUnjailResponse"; value: Uint8Array; @@ -50,10 +45,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -84,7 +75,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/staking/module/v1/module.ts b/libs/interchain-vue/src/cosmos/staking/module/v1/module.ts index c796f87a..01136510 100644 --- a/libs/interchain-vue/src/cosmos/staking/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/staking/module/v1/module.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the staking module. */ export interface Module { /** @@ -17,12 +16,6 @@ export interface Module { /** bech32_prefix_consensus is the bech32 consensus node prefix for the app. */ bech32PrefixConsensus: string; } -export interface ReactiveModule { - hooksOrder: ComputedRef; - authority: ComputedRef; - bech32PrefixValidator: ComputedRef; - bech32PrefixConsensus: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.staking.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/authz.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/authz.ts index 70fed0c5..11f715ec 100644 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/authz.ts +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/authz.ts @@ -2,7 +2,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { isSet, DeepPartial } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * AuthorizationType defines the type of staking module authorization type * @@ -83,12 +82,6 @@ export interface StakeAuthorization { /** authorization_type defines one of AuthorizationType. */ authorizationType: AuthorizationType; } -export interface ReactiveStakeAuthorization { - maxTokens?: ComputedRef; - allowList?: ComputedRef; - denyList?: ComputedRef; - authorizationType: ComputedRef; -} export interface StakeAuthorizationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization"; value: Uint8Array; @@ -122,9 +115,6 @@ export interface StakeAuthorizationAminoMsg { export interface StakeAuthorization_Validators { address: string[]; } -export interface ReactiveStakeAuthorization_Validators { - address: ComputedRef; -} export interface StakeAuthorization_ValidatorsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Validators"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/genesis.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/genesis.ts index 30d10e45..2e26bab3 100644 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/genesis.ts +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/genesis.ts @@ -2,7 +2,6 @@ import { Params, ParamsAmino, Validator, ValidatorAmino, Delegation, DelegationA import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { /** params defines all the parameters of related to deposit. */ @@ -28,16 +27,6 @@ export interface GenesisState { /** exported defines a bool to identify whether the chain dealing with exported or initialized genesis. */ exported: boolean; } -export interface ReactiveGenesisState { - params: ComputedRef; - lastTotalPower: ComputedRef; - lastValidatorPowers: ComputedRef; - validators: ComputedRef; - delegations: ComputedRef; - unbondingDelegations: ComputedRef; - redelegations: ComputedRef; - exported: ComputedRef; -} export interface GenesisStateProtoMsg { typeUrl: "/cosmos.staking.v1beta1.GenesisState"; value: Uint8Array; @@ -78,10 +67,6 @@ export interface LastValidatorPower { /** power defines the power of the validator. */ power: bigint; } -export interface ReactiveLastValidatorPower { - address: ComputedRef; - power: ComputedRef; -} export interface LastValidatorPowerProtoMsg { typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 9ffb8eb9..00000000 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,720 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse, ReactiveQueryValidatorsRequest, ReactiveQueryValidatorRequest, ReactiveQueryValidatorDelegationsRequest, ReactiveQueryValidatorUnbondingDelegationsRequest, ReactiveQueryDelegationRequest, ReactiveQueryUnbondingDelegationRequest, ReactiveQueryDelegatorDelegationsRequest, ReactiveQueryDelegatorUnbondingDelegationsRequest, ReactiveQueryRedelegationsRequest, ReactiveQueryDelegatorValidatorsRequest, ReactiveQueryDelegatorValidatorRequest, ReactiveQueryHistoricalInfoRequest, ReactiveQueryPoolRequest, ReactiveQueryParamsRequest } from "./query"; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * 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. - * - * 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): Promise; - /** Delegation queries delegate info for given validator delegator pair. */ - delegation(request: QueryDelegationRequest): Promise; - /** - * UnbondingDelegation queries unbonding info for given validator delegator - * pair. - */ - 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): 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; - /** - * DelegatorValidator queries validator info for given delegator validator - * pair. - */ - delegatorValidator(request: QueryDelegatorValidatorRequest): Promise; - /** HistoricalInfo queries the historical info for given height. */ - historicalInfo(request: QueryHistoricalInfoRequest): Promise; - /** Pool queries the pool info. */ - pool(request?: QueryPoolRequest): Promise; - /** Parameters queries the staking parameters. */ - params(request?: QueryParamsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* 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 = async (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 BinaryReader(data))); - }; - /* Validator queries validator info for given validator address. */ - validator = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* Delegation queries delegate info for given validator delegator pair. */ - delegation = async (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 BinaryReader(data))); - }; - /* UnbondingDelegation queries unbonding info for given validator delegator - pair. */ - unbondingDelegation = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* DelegatorValidator queries validator info for given delegator validator - pair. */ - delegatorValidator = async (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 BinaryReader(data))); - }; - /* HistoricalInfo queries the historical info for given height. */ - historicalInfo = async (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 BinaryReader(data))); - }; - /* Pool queries the pool info. */ - pool = async (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 BinaryReader(data))); - }; - /* Parameters queries the staking parameters. */ - params = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - validators(request: QueryValidatorsRequest): Promise { - return queryService.validators(request); - }, - validator(request: QueryValidatorRequest): Promise { - return queryService.validator(request); - }, - validatorDelegations(request: QueryValidatorDelegationsRequest): Promise { - return queryService.validatorDelegations(request); - }, - validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise { - return queryService.validatorUnbondingDelegations(request); - }, - delegation(request: QueryDelegationRequest): Promise { - return queryService.delegation(request); - }, - unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { - return queryService.unbondingDelegation(request); - }, - delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise { - return queryService.delegatorDelegations(request); - }, - delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise { - return queryService.delegatorUnbondingDelegations(request); - }, - redelegations(request: QueryRedelegationsRequest): Promise { - return queryService.redelegations(request); - }, - delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { - return queryService.delegatorValidators(request); - }, - delegatorValidator(request: QueryDelegatorValidatorRequest): Promise { - return queryService.delegatorValidator(request); - }, - historicalInfo(request: QueryHistoricalInfoRequest): Promise { - return queryService.historicalInfo(request); - }, - pool(request?: QueryPoolRequest): Promise { - return queryService.pool(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - } - }; -}; -export interface UseValidatorsQuery extends VueQueryParams { - request: ReactiveQueryValidatorsRequest; -} -export interface UseValidatorQuery extends VueQueryParams { - request: ReactiveQueryValidatorRequest; -} -export interface UseValidatorDelegationsQuery extends VueQueryParams { - request: ReactiveQueryValidatorDelegationsRequest; -} -export interface UseValidatorUnbondingDelegationsQuery extends VueQueryParams { - request: ReactiveQueryValidatorUnbondingDelegationsRequest; -} -export interface UseDelegationQuery extends VueQueryParams { - request: ReactiveQueryDelegationRequest; -} -export interface UseUnbondingDelegationQuery extends VueQueryParams { - request: ReactiveQueryUnbondingDelegationRequest; -} -export interface UseDelegatorDelegationsQuery extends VueQueryParams { - request: ReactiveQueryDelegatorDelegationsRequest; -} -export interface UseDelegatorUnbondingDelegationsQuery extends VueQueryParams { - request: ReactiveQueryDelegatorUnbondingDelegationsRequest; -} -export interface UseRedelegationsQuery extends VueQueryParams { - request: ReactiveQueryRedelegationsRequest; -} -export interface UseDelegatorValidatorsQuery extends VueQueryParams { - request: ReactiveQueryDelegatorValidatorsRequest; -} -export interface UseDelegatorValidatorQuery extends VueQueryParams { - request: ReactiveQueryDelegatorValidatorRequest; -} -export interface UseHistoricalInfoQuery extends VueQueryParams { - request: ReactiveQueryHistoricalInfoRequest; -} -export interface UsePoolQuery extends VueQueryParams { - request?: ReactiveQueryPoolRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useValidators = ({ - request, - options - }: UseValidatorsQuery) => { - const queryKey = ["validatorsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validators(params); - }, - ...options - }); - }; - const useValidator = ({ - request, - options - }: UseValidatorQuery) => { - const queryKey = ["validatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validator(params); - }, - ...options - }); - }; - const useValidatorDelegations = ({ - request, - options - }: UseValidatorDelegationsQuery) => { - const queryKey = ["validatorDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorDelegations(params); - }, - ...options - }); - }; - const useValidatorUnbondingDelegations = ({ - request, - options - }: UseValidatorUnbondingDelegationsQuery) => { - const queryKey = ["validatorUnbondingDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.validatorUnbondingDelegations(params); - }, - ...options - }); - }; - const useDelegation = ({ - request, - options - }: UseDelegationQuery) => { - const queryKey = ["delegationQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegation(params); - }, - ...options - }); - }; - const useUnbondingDelegation = ({ - request, - options - }: UseUnbondingDelegationQuery) => { - const queryKey = ["unbondingDelegationQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.unbondingDelegation(params); - }, - ...options - }); - }; - const useDelegatorDelegations = ({ - request, - options - }: UseDelegatorDelegationsQuery) => { - const queryKey = ["delegatorDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorDelegations(params); - }, - ...options - }); - }; - const useDelegatorUnbondingDelegations = ({ - request, - options - }: UseDelegatorUnbondingDelegationsQuery) => { - const queryKey = ["delegatorUnbondingDelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorUnbondingDelegations(params); - }, - ...options - }); - }; - const useRedelegations = ({ - request, - options - }: UseRedelegationsQuery) => { - const queryKey = ["redelegationsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.redelegations(params); - }, - ...options - }); - }; - const useDelegatorValidators = ({ - request, - options - }: UseDelegatorValidatorsQuery) => { - const queryKey = ["delegatorValidatorsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorValidators(params); - }, - ...options - }); - }; - const useDelegatorValidator = ({ - request, - options - }: UseDelegatorValidatorQuery) => { - const queryKey = ["delegatorValidatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.delegatorValidator(params); - }, - ...options - }); - }; - const useHistoricalInfo = ({ - request, - options - }: UseHistoricalInfoQuery) => { - const queryKey = ["historicalInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.historicalInfo(params); - }, - ...options - }); - }; - const usePool = ({ - request, - options - }: UsePoolQuery) => { - const queryKey = ["poolQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pool(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - return { - /** - * 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. - */ - useValidators, - /** Validator queries validator info for given validator address. */useValidator, - /** - * 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. - */ - useValidatorDelegations, - /** - * 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. - */ - useValidatorUnbondingDelegations, - /** Delegation queries delegate info for given validator delegator pair. */useDelegation, - /** - * UnbondingDelegation queries unbonding info for given validator delegator - * pair. - */ - useUnbondingDelegation, - /** - * 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. - */ - useDelegatorDelegations, - /** - * 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. - */ - useDelegatorUnbondingDelegations, - /** - * 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. - */ - useRedelegations, - /** - * 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. - */ - useDelegatorValidators, - /** - * DelegatorValidator queries validator info for given delegator validator - * pair. - */ - useDelegatorValidator, - /** HistoricalInfo queries the historical info for given height. */useHistoricalInfo, - /** Pool queries the pool info. */usePool, - /** Parameters queries the staking parameters. */useParams - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..d870abdc --- /dev/null +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.func.ts @@ -0,0 +1,100 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorsRequest.encode, + decode: QueryValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validators", + clientResolver +}); +export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorRequest.encode, + decode: QueryValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validator", + clientResolver +}); +export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorDelegationsRequest.encode, + decode: QueryValidatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorDelegations", + clientResolver +}); +export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorUnbondingDelegationsRequest.encode, + decode: QueryValidatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorUnbondingDelegations", + clientResolver +}); +export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegationRequest.encode, + decode: QueryDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Delegation", + clientResolver +}); +export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryUnbondingDelegationRequest.encode, + decode: QueryUnbondingDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "UnbondingDelegation", + clientResolver +}); +export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorDelegationsRequest.encode, + decode: QueryDelegatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorDelegations", + clientResolver +}); +export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorUnbondingDelegationsRequest.encode, + decode: QueryDelegatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorUnbondingDelegations", + clientResolver +}); +export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRedelegationsRequest.encode, + decode: QueryRedelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Redelegations", + clientResolver +}); +export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorsRequest.encode, + decode: QueryDelegatorValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidators", + clientResolver +}); +export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorRequest.encode, + decode: QueryDelegatorValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidator", + clientResolver +}); +export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalInfoRequest.encode, + decode: QueryHistoricalInfoResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "HistoricalInfo", + clientResolver +}); +export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPoolRequest.encode, + decode: QueryPoolResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Pool", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Params", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..92fc3c20 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts @@ -0,0 +1,59 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +export const useGetValidators = buildUseVueQuery({ + builderQueryFn: createGetValidators, + queryKeyPrefix: "ValidatorsQuery" +}); +export const useGetValidator = buildUseVueQuery({ + builderQueryFn: createGetValidator, + queryKeyPrefix: "ValidatorQuery" +}); +export const useGetValidatorDelegations = buildUseVueQuery({ + builderQueryFn: createGetValidatorDelegations, + queryKeyPrefix: "ValidatorDelegationsQuery" +}); +export const useGetValidatorUnbondingDelegations = buildUseVueQuery({ + builderQueryFn: createGetValidatorUnbondingDelegations, + queryKeyPrefix: "ValidatorUnbondingDelegationsQuery" +}); +export const useGetDelegation = buildUseVueQuery({ + builderQueryFn: createGetDelegation, + queryKeyPrefix: "DelegationQuery" +}); +export const useGetUnbondingDelegation = buildUseVueQuery({ + builderQueryFn: createGetUnbondingDelegation, + queryKeyPrefix: "UnbondingDelegationQuery" +}); +export const useGetDelegatorDelegations = buildUseVueQuery({ + builderQueryFn: createGetDelegatorDelegations, + queryKeyPrefix: "DelegatorDelegationsQuery" +}); +export const useGetDelegatorUnbondingDelegations = buildUseVueQuery({ + builderQueryFn: createGetDelegatorUnbondingDelegations, + queryKeyPrefix: "DelegatorUnbondingDelegationsQuery" +}); +export const useGetRedelegations = buildUseVueQuery({ + builderQueryFn: createGetRedelegations, + queryKeyPrefix: "RedelegationsQuery" +}); +export const useGetDelegatorValidators = buildUseVueQuery({ + builderQueryFn: createGetDelegatorValidators, + queryKeyPrefix: "DelegatorValidatorsQuery" +}); +export const useGetDelegatorValidator = buildUseVueQuery({ + builderQueryFn: createGetDelegatorValidator, + queryKeyPrefix: "DelegatorValidatorQuery" +}); +export const useGetHistoricalInfo = buildUseVueQuery({ + builderQueryFn: createGetHistoricalInfo, + queryKeyPrefix: "HistoricalInfoQuery" +}); +export const useGetPool = buildUseVueQuery({ + builderQueryFn: createGetPool, + queryKeyPrefix: "PoolQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.ts index e81b1e3e..35f76c74 100644 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.ts @@ -3,7 +3,6 @@ import { Validator, ValidatorAmino, DelegationResponse, DelegationResponseAmino, import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequest { /** status enables to query for validators matching a given status. */ @@ -11,10 +10,6 @@ export interface QueryValidatorsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryValidatorsRequest { - status: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; value: Uint8Array; @@ -37,10 +32,6 @@ export interface QueryValidatorsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryValidatorsResponse { - validators: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; value: Uint8Array; @@ -61,9 +52,6 @@ export interface QueryValidatorRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryValidatorRequest { - validatorAddr: ComputedRef; -} export interface QueryValidatorRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest"; value: Uint8Array; @@ -82,9 +70,6 @@ export interface QueryValidatorResponse { /** validator defines the validator info. */ validator: Validator; } -export interface ReactiveQueryValidatorResponse { - validator: ComputedRef; -} export interface QueryValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse"; value: Uint8Array; @@ -108,10 +93,6 @@ export interface QueryValidatorDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryValidatorDelegationsRequest { - validatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; value: Uint8Array; @@ -139,10 +120,6 @@ export interface QueryValidatorDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryValidatorDelegationsResponse { - delegationResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; value: Uint8Array; @@ -170,10 +147,6 @@ export interface QueryValidatorUnbondingDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryValidatorUnbondingDelegationsRequest { - validatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; value: Uint8Array; @@ -201,10 +174,6 @@ export interface QueryValidatorUnbondingDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryValidatorUnbondingDelegationsResponse { - unbondingResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; value: Uint8Array; @@ -229,10 +198,6 @@ export interface QueryDelegationRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryDelegationRequest { - delegatorAddr: ComputedRef; - validatorAddr: ComputedRef; -} export interface QueryDelegationRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest"; value: Uint8Array; @@ -253,9 +218,6 @@ export interface QueryDelegationResponse { /** delegation_responses defines the delegation info of a delegation. */ delegationResponse?: DelegationResponse; } -export interface ReactiveQueryDelegationResponse { - delegationResponse?: ComputedRef; -} export interface QueryDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; value: Uint8Array; @@ -279,10 +241,6 @@ export interface QueryUnbondingDelegationRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryUnbondingDelegationRequest { - delegatorAddr: ComputedRef; - validatorAddr: ComputedRef; -} export interface QueryUnbondingDelegationRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest"; value: Uint8Array; @@ -309,9 +267,6 @@ export interface QueryUnbondingDelegationResponse { /** unbond defines the unbonding information of a delegation. */ unbond: UnbondingDelegation; } -export interface ReactiveQueryUnbondingDelegationResponse { - unbond: ComputedRef; -} export interface QueryUnbondingDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse"; value: Uint8Array; @@ -338,10 +293,6 @@ export interface QueryDelegatorDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDelegatorDelegationsRequest { - delegatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; value: Uint8Array; @@ -370,10 +321,6 @@ export interface QueryDelegatorDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDelegatorDelegationsResponse { - delegationResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; value: Uint8Array; @@ -402,10 +349,6 @@ export interface QueryDelegatorUnbondingDelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDelegatorUnbondingDelegationsRequest { - delegatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; value: Uint8Array; @@ -433,10 +376,6 @@ export interface QueryDelegatorUnbondingDelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDelegatorUnbondingDelegationsResponse { - unbondingResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; value: Uint8Array; @@ -468,12 +407,6 @@ export interface QueryRedelegationsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryRedelegationsRequest { - delegatorAddr: ComputedRef; - srcValidatorAddr: ComputedRef; - dstValidatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryRedelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; value: Uint8Array; @@ -505,10 +438,6 @@ export interface QueryRedelegationsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryRedelegationsResponse { - redelegationResponses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryRedelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; value: Uint8Array; @@ -536,10 +465,6 @@ export interface QueryDelegatorValidatorsRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryDelegatorValidatorsRequest { - delegatorAddr: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; value: Uint8Array; @@ -568,10 +493,6 @@ export interface QueryDelegatorValidatorsResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryDelegatorValidatorsResponse { - validators: ComputedRef; - pagination?: ComputedRef; -} export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; value: Uint8Array; @@ -600,10 +521,6 @@ export interface QueryDelegatorValidatorRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; } -export interface ReactiveQueryDelegatorValidatorRequest { - delegatorAddr: ComputedRef; - validatorAddr: ComputedRef; -} export interface QueryDelegatorValidatorRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest"; value: Uint8Array; @@ -630,9 +547,6 @@ export interface QueryDelegatorValidatorResponse { /** validator defines the validator info. */ validator: Validator; } -export interface ReactiveQueryDelegatorValidatorResponse { - validator: ComputedRef; -} export interface QueryDelegatorValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse"; value: Uint8Array; @@ -657,9 +571,6 @@ export interface QueryHistoricalInfoRequest { /** height defines at which height to query the historical info. */ height: bigint; } -export interface ReactiveQueryHistoricalInfoRequest { - height: ComputedRef; -} export interface QueryHistoricalInfoRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest"; value: Uint8Array; @@ -684,9 +595,6 @@ export interface QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ hist?: HistoricalInfo; } -export interface ReactiveQueryHistoricalInfoResponse { - hist?: ComputedRef; -} export interface QueryHistoricalInfoResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; value: Uint8Array; @@ -705,7 +613,6 @@ export interface QueryHistoricalInfoResponseAminoMsg { } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ export interface QueryPoolRequest {} -export interface ReactiveQueryPoolRequest {} export interface QueryPoolRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest"; value: Uint8Array; @@ -721,9 +628,6 @@ export interface QueryPoolResponse { /** pool defines the pool info. */ pool: Pool; } -export interface ReactiveQueryPoolResponse { - pool: ComputedRef; -} export interface QueryPoolResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse"; value: Uint8Array; @@ -739,7 +643,6 @@ export interface QueryPoolResponseAminoMsg { } /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest"; value: Uint8Array; @@ -755,9 +658,6 @@ export interface QueryParamsResponse { /** params holds all the parameters of this module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/staking.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/staking.ts index d99e2c80..2a5589fe 100644 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/staking.ts +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/staking.ts @@ -8,7 +8,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, toTimestamp, fromTimestamp, isSet } from "../../../helpers"; import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; -import { ComputedRef } from "vue"; /** BondStatus is the status of a validator. */ export enum BondStatus { /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ @@ -108,10 +107,6 @@ export interface HistoricalInfo { header: Header; valset: Validator[]; } -export interface ReactiveHistoricalInfo { - header: ComputedRef
; - valset: ComputedRef; -} export interface HistoricalInfoProtoMsg { typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo"; value: Uint8Array; @@ -142,11 +137,6 @@ export interface CommissionRates { /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ maxChangeRate: string; } -export interface ReactiveCommissionRates { - rate: ComputedRef; - maxRate: ComputedRef; - maxChangeRate: ComputedRef; -} export interface CommissionRatesProtoMsg { typeUrl: "/cosmos.staking.v1beta1.CommissionRates"; value: Uint8Array; @@ -174,10 +164,6 @@ export interface Commission { /** update_time is the last time the commission rate was changed. */ updateTime: Date; } -export interface ReactiveCommission { - commissionRates: ComputedRef; - updateTime: ComputedRef; -} export interface CommissionProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Commission"; value: Uint8Array; @@ -206,13 +192,6 @@ export interface Description { /** details define other optional details. */ details: string; } -export interface ReactiveDescription { - moniker: ComputedRef; - identity: ComputedRef; - website: ComputedRef; - securityContact: ComputedRef; - details: ComputedRef; -} export interface DescriptionProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Description"; value: Uint8Array; @@ -276,21 +255,6 @@ export interface Validator { /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ unbondingIds: bigint[]; } -export interface ReactiveValidator { - operatorAddress: ComputedRef; - consensusPubkey?: ComputedRef; - jailed: ComputedRef; - status: ComputedRef; - tokens: ComputedRef; - delegatorShares: ComputedRef; - description: ComputedRef; - unbondingHeight: ComputedRef; - unbondingTime: ComputedRef; - commission: ComputedRef; - minSelfDelegation: ComputedRef; - unbondingOnHoldRefCount: ComputedRef; - unbondingIds: ComputedRef; -} export interface ValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Validator"; value: Uint8Array; @@ -348,9 +312,6 @@ export interface ValidatorAminoMsg { export interface ValAddresses { addresses: string[]; } -export interface ReactiveValAddresses { - addresses: ComputedRef; -} export interface ValAddressesProtoMsg { typeUrl: "/cosmos.staking.v1beta1.ValAddresses"; value: Uint8Array; @@ -372,10 +333,6 @@ export interface DVPair { delegatorAddress: string; validatorAddress: string; } -export interface ReactiveDVPair { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; -} export interface DVPairProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVPair"; value: Uint8Array; @@ -397,9 +354,6 @@ export interface DVPairAminoMsg { export interface DVPairs { pairs: DVPair[]; } -export interface ReactiveDVPairs { - pairs: ComputedRef; -} export interface DVPairsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVPairs"; value: Uint8Array; @@ -423,11 +377,6 @@ export interface DVVTriplet { validatorSrcAddress: string; validatorDstAddress: string; } -export interface ReactiveDVVTriplet { - delegatorAddress: ComputedRef; - validatorSrcAddress: ComputedRef; - validatorDstAddress: ComputedRef; -} export interface DVVTripletProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVVTriplet"; value: Uint8Array; @@ -451,9 +400,6 @@ export interface DVVTripletAminoMsg { export interface DVVTriplets { triplets: DVVTriplet[]; } -export interface ReactiveDVVTriplets { - triplets: ComputedRef; -} export interface DVVTripletsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DVVTriplets"; value: Uint8Array; @@ -479,11 +425,6 @@ export interface Delegation { /** shares define the delegation shares received. */ shares: string; } -export interface ReactiveDelegation { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - shares: ComputedRef; -} export interface DelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Delegation"; value: Uint8Array; @@ -517,11 +458,6 @@ export interface UnbondingDelegation { /** entries are the unbonding delegation entries. */ entries: UnbondingDelegationEntry[]; } -export interface ReactiveUnbondingDelegation { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - entries: ComputedRef; -} export interface UnbondingDelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation"; value: Uint8Array; @@ -557,14 +493,6 @@ export interface UnbondingDelegationEntry { /** Strictly positive if this entry's unbonding has been stopped by external modules */ unbondingOnHoldRefCount: bigint; } -export interface ReactiveUnbondingDelegationEntry { - creationHeight: ComputedRef; - completionTime: ComputedRef; - initialBalance: ComputedRef; - balance: ComputedRef; - unbondingId: ComputedRef; - unbondingOnHoldRefCount: ComputedRef; -} export interface UnbondingDelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry"; value: Uint8Array; @@ -603,14 +531,6 @@ export interface RedelegationEntry { /** Strictly positive if this entry's unbonding has been stopped by external modules */ unbondingOnHoldRefCount: bigint; } -export interface ReactiveRedelegationEntry { - creationHeight: ComputedRef; - completionTime: ComputedRef; - initialBalance: ComputedRef; - sharesDst: ComputedRef; - unbondingId: ComputedRef; - unbondingOnHoldRefCount: ComputedRef; -} export interface RedelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry"; value: Uint8Array; @@ -648,12 +568,6 @@ export interface Redelegation { /** entries are the redelegation entries. */ entries: RedelegationEntry[]; } -export interface ReactiveRedelegation { - delegatorAddress: ComputedRef; - validatorSrcAddress: ComputedRef; - validatorDstAddress: ComputedRef; - entries: ComputedRef; -} export interface RedelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Redelegation"; value: Uint8Array; @@ -691,14 +605,6 @@ export interface Params { /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ minCommissionRate: string; } -export interface ReactiveParams { - unbondingTime: ComputedRef; - maxValidators: ComputedRef; - maxEntries: ComputedRef; - historicalEntries: ComputedRef; - bondDenom: ComputedRef; - minCommissionRate: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Params"; value: Uint8Array; @@ -730,10 +636,6 @@ export interface DelegationResponse { delegation: Delegation; balance: Coin; } -export interface ReactiveDelegationResponse { - delegation: ComputedRef; - balance: ComputedRef; -} export interface DelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.DelegationResponse"; value: Uint8Array; @@ -759,10 +661,6 @@ export interface RedelegationEntryResponse { redelegationEntry: RedelegationEntry; balance: string; } -export interface ReactiveRedelegationEntryResponse { - redelegationEntry: ComputedRef; - balance: ComputedRef; -} export interface RedelegationEntryResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse"; value: Uint8Array; @@ -789,10 +687,6 @@ export interface RedelegationResponse { redelegation: Redelegation; entries: RedelegationEntryResponse[]; } -export interface ReactiveRedelegationResponse { - redelegation: ComputedRef; - entries: ComputedRef; -} export interface RedelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse"; value: Uint8Array; @@ -818,10 +712,6 @@ export interface Pool { notBondedTokens: string; bondedTokens: string; } -export interface ReactivePool { - notBondedTokens: ComputedRef; - bondedTokens: ComputedRef; -} export interface PoolProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Pool"; value: Uint8Array; @@ -845,9 +735,6 @@ export interface PoolAminoMsg { export interface ValidatorUpdates { updates: ValidatorUpdate[]; } -export interface ReactiveValidatorUpdates { - updates: ComputedRef; -} export interface ValidatorUpdatesProtoMsg { typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.amino.ts deleted file mode 100644 index ab2985b9..00000000 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/cosmos.staking.v1beta1.MsgCreateValidator": { - aminoType: "cosmos-sdk/MsgCreateValidator", - toAmino: MsgCreateValidator.toAmino, - fromAmino: MsgCreateValidator.fromAmino - }, - "/cosmos.staking.v1beta1.MsgEditValidator": { - aminoType: "cosmos-sdk/MsgEditValidator", - toAmino: MsgEditValidator.toAmino, - fromAmino: MsgEditValidator.fromAmino - }, - "/cosmos.staking.v1beta1.MsgDelegate": { - aminoType: "cosmos-sdk/MsgDelegate", - toAmino: MsgDelegate.toAmino, - fromAmino: MsgDelegate.fromAmino - }, - "/cosmos.staking.v1beta1.MsgBeginRedelegate": { - aminoType: "cosmos-sdk/MsgBeginRedelegate", - toAmino: MsgBeginRedelegate.toAmino, - fromAmino: MsgBeginRedelegate.fromAmino - }, - "/cosmos.staking.v1beta1.MsgUndelegate": { - aminoType: "cosmos-sdk/MsgUndelegate", - toAmino: MsgUndelegate.toAmino, - fromAmino: MsgUndelegate.fromAmino - }, - "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": { - aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", - toAmino: MsgCancelUnbondingDelegation.toAmino, - fromAmino: MsgCancelUnbondingDelegation.fromAmino - }, - "/cosmos.staking.v1beta1.MsgUpdateParams": { - aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..81244bbe --- /dev/null +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +export const createCreateValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateValidator.typeUrl, + encoders: toEncoders(MsgCreateValidator), + converters: toConverters(MsgCreateValidator) +}); +export const createEditValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgEditValidator.typeUrl, + encoders: toEncoders(MsgEditValidator), + converters: toConverters(MsgEditValidator) +}); +export const createDelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDelegate.typeUrl, + encoders: toEncoders(MsgDelegate), + converters: toConverters(MsgDelegate) +}); +export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBeginRedelegate.typeUrl, + encoders: toEncoders(MsgBeginRedelegate), + converters: toConverters(MsgBeginRedelegate) +}); +export const createUndelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUndelegate.typeUrl, + encoders: toEncoders(MsgUndelegate), + converters: toConverters(MsgUndelegate) +}); +export const createCancelUnbondingDelegation = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelUnbondingDelegation.typeUrl, + encoders: toEncoders(MsgCancelUnbondingDelegation), + converters: toConverters(MsgCancelUnbondingDelegation) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index fa4b898f..00000000 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the staking Msg service. */ -export interface Msg { - /** CreateValidator defines a method for creating a new validator. */ - createValidator(request: MsgCreateValidator): Promise; - /** EditValidator defines a method for editing an existing validator. */ - editValidator(request: MsgEditValidator): Promise; - /** - * Delegate defines a method for performing a delegation of coins - * from a delegator to a validator. - */ - delegate(request: MsgDelegate): Promise; - /** - * BeginRedelegate defines a method for performing a redelegation - * of coins from a delegator and source validator to a destination validator. - */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateValidator defines a method for creating a new validator. */ - createValidator = async (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 BinaryReader(data))); - }; - /* EditValidator defines a method for editing an existing validator. */ - editValidator = async (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 BinaryReader(data))); - }; - /* Delegate defines a method for performing a delegation of coins - from a delegator to a validator. */ - delegate = async (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 BinaryReader(data))); - }; - /* BeginRedelegate defines a method for performing a redelegation - of coins from a delegator and source validator to a destination validator. */ - beginRedelegate = async (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 BinaryReader(data))); - }; - /* Undelegate defines a method for performing an undelegation from a - delegate and a validator. */ - undelegate = async (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 BinaryReader(data))); - }; - /* CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - and delegate back to previous validator. - - Since: cosmos-sdk 0.46 */ - cancelUnbondingDelegation = async (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 BinaryReader(data))); - }; - /* UpdateParams defines an operation for updating the x/staking module - parameters. - Since: cosmos-sdk 0.47 */ - updateParams = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..57a83c0e --- /dev/null +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +export const useCreateValidator = buildUseVueMutation({ + builderMutationFn: createCreateValidator +}); +export const useEditValidator = buildUseVueMutation({ + builderMutationFn: createEditValidator +}); +export const useDelegate = buildUseVueMutation({ + builderMutationFn: createDelegate +}); +export const useBeginRedelegate = buildUseVueMutation({ + builderMutationFn: createBeginRedelegate +}); +export const useUndelegate = buildUseVueMutation({ + builderMutationFn: createUndelegate +}); +export const useCancelUnbondingDelegation = buildUseVueMutation({ + builderMutationFn: createCancelUnbondingDelegation +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.ts index 02daad17..f533f6f9 100644 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.ts @@ -6,7 +6,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; -import { ComputedRef } from "vue"; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { description: Description; @@ -23,15 +22,6 @@ export interface MsgCreateValidator { pubkey?: Any | undefined; value: Coin; } -export interface ReactiveMsgCreateValidator { - description: ComputedRef; - commission: ComputedRef; - minSelfDelegation: ComputedRef; - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - pubkey?: ComputedRef; - value: ComputedRef; -} export interface MsgCreateValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator"; value: Uint8Array; @@ -61,7 +51,6 @@ export interface MsgCreateValidatorAminoMsg { } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ export interface MsgCreateValidatorResponse {} -export interface ReactiveMsgCreateValidatorResponse {} export interface MsgCreateValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse"; value: Uint8Array; @@ -85,12 +74,6 @@ export interface MsgEditValidator { commissionRate: string; minSelfDelegation: string; } -export interface ReactiveMsgEditValidator { - description: ComputedRef; - validatorAddress: ComputedRef; - commissionRate: ComputedRef; - minSelfDelegation: ComputedRef; -} export interface MsgEditValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator"; value: Uint8Array; @@ -114,7 +97,6 @@ export interface MsgEditValidatorAminoMsg { } /** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ export interface MsgEditValidatorResponse {} -export interface ReactiveMsgEditValidatorResponse {} export interface MsgEditValidatorResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse"; value: Uint8Array; @@ -134,11 +116,6 @@ export interface MsgDelegate { validatorAddress: string; amount: Coin; } -export interface ReactiveMsgDelegate { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgDelegateProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate"; value: Uint8Array; @@ -158,7 +135,6 @@ export interface MsgDelegateAminoMsg { } /** MsgDelegateResponse defines the Msg/Delegate response type. */ export interface MsgDelegateResponse {} -export interface ReactiveMsgDelegateResponse {} export interface MsgDelegateResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse"; value: Uint8Array; @@ -179,12 +155,6 @@ export interface MsgBeginRedelegate { validatorDstAddress: string; amount: Coin; } -export interface ReactiveMsgBeginRedelegate { - delegatorAddress: ComputedRef; - validatorSrcAddress: ComputedRef; - validatorDstAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgBeginRedelegateProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate"; value: Uint8Array; @@ -207,9 +177,6 @@ export interface MsgBeginRedelegateAminoMsg { export interface MsgBeginRedelegateResponse { completionTime: Date; } -export interface ReactiveMsgBeginRedelegateResponse { - completionTime: ComputedRef; -} export interface MsgBeginRedelegateResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse"; value: Uint8Array; @@ -231,11 +198,6 @@ export interface MsgUndelegate { validatorAddress: string; amount: Coin; } -export interface ReactiveMsgUndelegate { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgUndelegateProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate"; value: Uint8Array; @@ -263,10 +225,6 @@ export interface MsgUndelegateResponse { */ amount: Coin; } -export interface ReactiveMsgUndelegateResponse { - completionTime: ComputedRef; - amount: ComputedRef; -} export interface MsgUndelegateResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse"; value: Uint8Array; @@ -298,12 +256,6 @@ export interface MsgCancelUnbondingDelegation { /** creation_height is the height which the unbonding took place. */ creationHeight: bigint; } -export interface ReactiveMsgCancelUnbondingDelegation { - delegatorAddress: ComputedRef; - validatorAddress: ComputedRef; - amount: ComputedRef; - creationHeight: ComputedRef; -} export interface MsgCancelUnbondingDelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"; value: Uint8Array; @@ -331,7 +283,6 @@ export interface MsgCancelUnbondingDelegationAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCancelUnbondingDelegationResponse {} -export interface ReactiveMsgCancelUnbondingDelegationResponse {} export interface MsgCancelUnbondingDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse"; value: Uint8Array; @@ -361,10 +312,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams"; value: Uint8Array; @@ -395,7 +342,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/store/internal/kv/v1beta1/kv.ts b/libs/interchain-vue/src/cosmos/store/internal/kv/v1beta1/kv.ts index ddbff1c9..1d853e0e 100644 --- a/libs/interchain-vue/src/cosmos/store/internal/kv/v1beta1/kv.ts +++ b/libs/interchain-vue/src/cosmos/store/internal/kv/v1beta1/kv.ts @@ -1,14 +1,10 @@ import { BinaryReader, BinaryWriter } from "../../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../../registry"; -import { ComputedRef } from "vue"; /** Pairs defines a repeated slice of Pair objects. */ export interface Pairs { pairs: Pair[]; } -export interface ReactivePairs { - pairs: ComputedRef; -} export interface PairsProtoMsg { typeUrl: "/cosmos.store.internal.kv.v1beta1.Pairs"; value: Uint8Array; @@ -26,10 +22,6 @@ export interface Pair { key: Uint8Array; value: Uint8Array; } -export interface ReactivePair { - key: ComputedRef; - value: ComputedRef; -} export interface PairProtoMsg { typeUrl: "/cosmos.store.internal.kv.v1beta1.Pair"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/store/snapshots/v1/snapshot.ts b/libs/interchain-vue/src/cosmos/store/snapshots/v1/snapshot.ts index 0c474dbf..870ddd6f 100644 --- a/libs/interchain-vue/src/cosmos/store/snapshots/v1/snapshot.ts +++ b/libs/interchain-vue/src/cosmos/store/snapshots/v1/snapshot.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** Snapshot contains Tendermint state sync snapshot info. */ export interface Snapshot { height: bigint; @@ -10,13 +9,6 @@ export interface Snapshot { hash: Uint8Array; metadata: Metadata; } -export interface ReactiveSnapshot { - height: ComputedRef; - format: ComputedRef; - chunks: ComputedRef; - hash: ComputedRef; - metadata: ComputedRef; -} export interface SnapshotProtoMsg { typeUrl: "/cosmos.store.snapshots.v1.Snapshot"; value: Uint8Array; @@ -38,9 +30,6 @@ export interface Metadata { /** SHA-256 chunk hashes */ chunkHashes: Uint8Array[]; } -export interface ReactiveMetadata { - chunkHashes: ComputedRef; -} export interface MetadataProtoMsg { typeUrl: "/cosmos.store.snapshots.v1.Metadata"; value: Uint8Array; @@ -65,12 +54,6 @@ export interface SnapshotItem { extension?: SnapshotExtensionMeta; extensionPayload?: SnapshotExtensionPayload; } -export interface ReactiveSnapshotItem { - store?: ComputedRef; - iavl?: ComputedRef; - extension?: ComputedRef; - extensionPayload?: ComputedRef; -} export interface SnapshotItemProtoMsg { typeUrl: "/cosmos.store.snapshots.v1.SnapshotItem"; value: Uint8Array; @@ -98,9 +81,6 @@ export interface SnapshotItemAminoMsg { export interface SnapshotStoreItem { name: string; } -export interface ReactiveSnapshotStoreItem { - name: ComputedRef; -} export interface SnapshotStoreItemProtoMsg { typeUrl: "/cosmos.store.snapshots.v1.SnapshotStoreItem"; value: Uint8Array; @@ -130,12 +110,6 @@ export interface SnapshotIAVLItem { /** height is depth of the tree. */ height: number; } -export interface ReactiveSnapshotIAVLItem { - key: ComputedRef; - value: ComputedRef; - version: ComputedRef; - height: ComputedRef; -} export interface SnapshotIAVLItemProtoMsg { typeUrl: "/cosmos.store.snapshots.v1.SnapshotIAVLItem"; value: Uint8Array; @@ -166,10 +140,6 @@ export interface SnapshotExtensionMeta { name: string; format: number; } -export interface ReactiveSnapshotExtensionMeta { - name: ComputedRef; - format: ComputedRef; -} export interface SnapshotExtensionMetaProtoMsg { typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionMeta"; value: Uint8Array; @@ -195,9 +165,6 @@ export interface SnapshotExtensionMetaAminoMsg { export interface SnapshotExtensionPayload { payload: Uint8Array; } -export interface ReactiveSnapshotExtensionPayload { - payload: ComputedRef; -} export interface SnapshotExtensionPayloadProtoMsg { typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionPayload"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/store/snapshots/v2/snapshot.ts b/libs/interchain-vue/src/cosmos/store/snapshots/v2/snapshot.ts index f825cdcd..a7d1a341 100644 --- a/libs/interchain-vue/src/cosmos/store/snapshots/v2/snapshot.ts +++ b/libs/interchain-vue/src/cosmos/store/snapshots/v2/snapshot.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** Snapshot contains Tendermint state sync snapshot info. */ export interface Snapshot { height: bigint; @@ -10,13 +9,6 @@ export interface Snapshot { hash: Uint8Array; metadata: Metadata; } -export interface ReactiveSnapshot { - height: ComputedRef; - format: ComputedRef; - chunks: ComputedRef; - hash: ComputedRef; - metadata: ComputedRef; -} export interface SnapshotProtoMsg { typeUrl: "/cosmos.store.snapshots.v2.Snapshot"; value: Uint8Array; @@ -38,9 +30,6 @@ export interface Metadata { /** SHA-256 chunk hashes */ chunkHashes: Uint8Array[]; } -export interface ReactiveMetadata { - chunkHashes: ComputedRef; -} export interface MetadataProtoMsg { typeUrl: "/cosmos.store.snapshots.v2.Metadata"; value: Uint8Array; @@ -61,12 +50,6 @@ export interface SnapshotItem { extension?: SnapshotExtensionMeta; extensionPayload?: SnapshotExtensionPayload; } -export interface ReactiveSnapshotItem { - store?: ComputedRef; - iavl?: ComputedRef; - extension?: ComputedRef; - extensionPayload?: ComputedRef; -} export interface SnapshotItemProtoMsg { typeUrl: "/cosmos.store.snapshots.v2.SnapshotItem"; value: Uint8Array; @@ -86,9 +69,6 @@ export interface SnapshotItemAminoMsg { export interface SnapshotStoreItem { name: string; } -export interface ReactiveSnapshotStoreItem { - name: ComputedRef; -} export interface SnapshotStoreItemProtoMsg { typeUrl: "/cosmos.store.snapshots.v2.SnapshotStoreItem"; value: Uint8Array; @@ -110,12 +90,6 @@ export interface SnapshotIAVLItem { /** height is depth of the tree. */ height: number; } -export interface ReactiveSnapshotIAVLItem { - key: ComputedRef; - value: ComputedRef; - version: ComputedRef; - height: ComputedRef; -} export interface SnapshotIAVLItemProtoMsg { typeUrl: "/cosmos.store.snapshots.v2.SnapshotIAVLItem"; value: Uint8Array; @@ -138,10 +112,6 @@ export interface SnapshotExtensionMeta { name: string; format: number; } -export interface ReactiveSnapshotExtensionMeta { - name: ComputedRef; - format: ComputedRef; -} export interface SnapshotExtensionMetaProtoMsg { typeUrl: "/cosmos.store.snapshots.v2.SnapshotExtensionMeta"; value: Uint8Array; @@ -159,9 +129,6 @@ export interface SnapshotExtensionMetaAminoMsg { export interface SnapshotExtensionPayload { payload: Uint8Array; } -export interface ReactiveSnapshotExtensionPayload { - payload: ComputedRef; -} export interface SnapshotExtensionPayloadProtoMsg { typeUrl: "/cosmos.store.snapshots.v2.SnapshotExtensionPayload"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/store/streaming/abci/grpc.ts b/libs/interchain-vue/src/cosmos/store/streaming/abci/grpc.ts index 637154ee..dc006716 100644 --- a/libs/interchain-vue/src/cosmos/store/streaming/abci/grpc.ts +++ b/libs/interchain-vue/src/cosmos/store/streaming/abci/grpc.ts @@ -3,16 +3,11 @@ import { StoreKVPair, StoreKVPairAmino } from "../../v1beta1/listening"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** ListenEndBlockRequest is the request type for the ListenEndBlock RPC method */ export interface ListenFinalizeBlockRequest { req?: RequestFinalizeBlock; res?: ResponseFinalizeBlock; } -export interface ReactiveListenFinalizeBlockRequest { - req?: ComputedRef; - res?: ComputedRef; -} export interface ListenFinalizeBlockRequestProtoMsg { typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockRequest"; value: Uint8Array; @@ -28,7 +23,6 @@ export interface ListenFinalizeBlockRequestAminoMsg { } /** ListenEndBlockResponse is the response type for the ListenEndBlock RPC method */ export interface ListenFinalizeBlockResponse {} -export interface ReactiveListenFinalizeBlockResponse {} export interface ListenFinalizeBlockResponseProtoMsg { typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockResponse"; value: Uint8Array; @@ -46,11 +40,6 @@ export interface ListenCommitRequest { res?: ResponseCommit; changeSet: StoreKVPair[]; } -export interface ReactiveListenCommitRequest { - blockHeight: ComputedRef; - res?: ComputedRef; - changeSet: ComputedRef; -} export interface ListenCommitRequestProtoMsg { typeUrl: "/cosmos.store.streaming.abci.ListenCommitRequest"; value: Uint8Array; @@ -68,7 +57,6 @@ export interface ListenCommitRequestAminoMsg { } /** ListenCommitResponse is the response type for the ListenCommit RPC method */ export interface ListenCommitResponse {} -export interface ReactiveListenCommitResponse {} export interface ListenCommitResponseProtoMsg { typeUrl: "/cosmos.store.streaming.abci.ListenCommitResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/store/v1beta1/commit_info.ts b/libs/interchain-vue/src/cosmos/store/v1beta1/commit_info.ts index f507546d..12b6beee 100644 --- a/libs/interchain-vue/src/cosmos/store/v1beta1/commit_info.ts +++ b/libs/interchain-vue/src/cosmos/store/v1beta1/commit_info.ts @@ -2,7 +2,6 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * CommitInfo defines commit information used by the multi-store when committing * a version/height. @@ -12,11 +11,6 @@ export interface CommitInfo { storeInfos: StoreInfo[]; timestamp: Date; } -export interface ReactiveCommitInfo { - version: ComputedRef; - storeInfos: ComputedRef; - timestamp: ComputedRef; -} export interface CommitInfoProtoMsg { typeUrl: "/cosmos.store.v1beta1.CommitInfo"; value: Uint8Array; @@ -42,10 +36,6 @@ export interface StoreInfo { name: string; commitId: CommitID; } -export interface ReactiveStoreInfo { - name: ComputedRef; - commitId: ComputedRef; -} export interface StoreInfoProtoMsg { typeUrl: "/cosmos.store.v1beta1.StoreInfo"; value: Uint8Array; @@ -70,10 +60,6 @@ export interface CommitID { version: bigint; hash: Uint8Array; } -export interface ReactiveCommitID { - version: ComputedRef; - hash: ComputedRef; -} export interface CommitIDProtoMsg { typeUrl: "/cosmos.store.v1beta1.CommitID"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/store/v1beta1/listening.ts b/libs/interchain-vue/src/cosmos/store/v1beta1/listening.ts index 07c32a5d..1d5bdfbc 100644 --- a/libs/interchain-vue/src/cosmos/store/v1beta1/listening.ts +++ b/libs/interchain-vue/src/cosmos/store/v1beta1/listening.ts @@ -2,7 +2,6 @@ import { ResponseCommit, ResponseCommitAmino, RequestFinalizeBlock, RequestFinal import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) * It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and @@ -18,12 +17,6 @@ export interface StoreKVPair { key: Uint8Array; value: Uint8Array; } -export interface ReactiveStoreKVPair { - storeKey: ComputedRef; - delete: ComputedRef; - key: ComputedRef; - value: ComputedRef; -} export interface StoreKVPairProtoMsg { typeUrl: "/cosmos.store.v1beta1.StoreKVPair"; value: Uint8Array; @@ -57,11 +50,6 @@ export interface BlockMetadata { /** TODO: should we renumber this? */ responseFinalizeBlock?: ResponseFinalizeBlock; } -export interface ReactiveBlockMetadata { - responseCommit?: ComputedRef; - requestFinalizeBlock?: ComputedRef; - responseFinalizeBlock?: ComputedRef; -} export interface BlockMetadataProtoMsg { typeUrl: "/cosmos.store.v1beta1.BlockMetadata"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/streaming/v1/grpc.ts b/libs/interchain-vue/src/cosmos/streaming/v1/grpc.ts index 73c9881c..3fd0bbe9 100644 --- a/libs/interchain-vue/src/cosmos/streaming/v1/grpc.ts +++ b/libs/interchain-vue/src/cosmos/streaming/v1/grpc.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** ListenDeliverBlockRequest is the request type for the ListenDeliverBlock RPC method */ export interface ListenDeliverBlockRequest { blockHeight: bigint; @@ -9,12 +8,6 @@ export interface ListenDeliverBlockRequest { events: Event[]; txResults: ExecTxResult[]; } -export interface ReactiveListenDeliverBlockRequest { - blockHeight: ComputedRef; - txs: ComputedRef; - events: ComputedRef; - txResults: ComputedRef; -} export interface ListenDeliverBlockRequestProtoMsg { typeUrl: "/cosmos.streaming.v1.ListenDeliverBlockRequest"; value: Uint8Array; @@ -32,7 +25,6 @@ export interface ListenDeliverBlockRequestAminoMsg { } /** ListenDeliverBlockResponse is the response type for the ListenDeliverBlock RPC method */ export interface ListenDeliverBlockResponse {} -export interface ReactiveListenDeliverBlockResponse {} export interface ListenDeliverBlockResponseProtoMsg { typeUrl: "/cosmos.streaming.v1.ListenDeliverBlockResponse"; value: Uint8Array; @@ -49,11 +41,6 @@ export interface ListenStateChangesRequest { changeSet: StoreKVPair[]; appHash: Uint8Array; } -export interface ReactiveListenStateChangesRequest { - blockHeight: ComputedRef; - changeSet: ComputedRef; - appHash: ComputedRef; -} export interface ListenStateChangesRequestProtoMsg { typeUrl: "/cosmos.streaming.v1.ListenStateChangesRequest"; value: Uint8Array; @@ -70,7 +57,6 @@ export interface ListenStateChangesRequestAminoMsg { } /** ListenStateChangesResponse is the response type for the ListenStateChanges RPC method */ export interface ListenStateChangesResponse {} -export interface ReactiveListenStateChangesResponse {} export interface ListenStateChangesResponseProtoMsg { typeUrl: "/cosmos.streaming.v1.ListenStateChangesResponse"; value: Uint8Array; @@ -95,12 +81,6 @@ export interface StoreKVPair { /** delete defines if the key was removed. */ delete: boolean; } -export interface ReactiveStoreKVPair { - address: ComputedRef; - key: ComputedRef; - value: ComputedRef; - delete: ComputedRef; -} export interface StoreKVPairProtoMsg { typeUrl: "/cosmos.streaming.v1.StoreKVPair"; value: Uint8Array; @@ -128,10 +108,6 @@ export interface Event { type: string; attributes: EventAttribute[]; } -export interface ReactiveEvent { - type: ComputedRef; - attributes: ComputedRef; -} export interface EventProtoMsg { typeUrl: "/cosmos.streaming.v1.Event"; value: Uint8Array; @@ -150,10 +126,6 @@ export interface EventAttribute { key: string; value: string; } -export interface ReactiveEventAttribute { - key: ComputedRef; - value: ComputedRef; -} export interface EventAttributeProtoMsg { typeUrl: "/cosmos.streaming.v1.EventAttribute"; value: Uint8Array; @@ -178,16 +150,6 @@ export interface ExecTxResult { events: Event[]; codespace: string; } -export interface ReactiveExecTxResult { - code: ComputedRef; - data: ComputedRef; - log: ComputedRef; - info: ComputedRef; - gasWanted: ComputedRef; - gasUsed: ComputedRef; - events: ComputedRef; - codespace: ComputedRef; -} export interface ExecTxResultProtoMsg { typeUrl: "/cosmos.streaming.v1.ExecTxResult"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/tx/config/v1/config.ts b/libs/interchain-vue/src/cosmos/tx/config/v1/config.ts index 7e4a21dd..f6d4f089 100644 --- a/libs/interchain-vue/src/cosmos/tx/config/v1/config.ts +++ b/libs/interchain-vue/src/cosmos/tx/config/v1/config.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Config is the config object of the x/auth/tx package. */ export interface Config { /** @@ -15,10 +14,6 @@ export interface Config { */ skipPostHandler: boolean; } -export interface ReactiveConfig { - skipAnteHandler: ComputedRef; - skipPostHandler: ComputedRef; -} export interface ConfigProtoMsg { typeUrl: "/cosmos.tx.config.v1.Config"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/tx/signing/v1beta1/signing.ts b/libs/interchain-vue/src/cosmos/tx/signing/v1beta1/signing.ts index a9eaac18..8c90655f 100644 --- a/libs/interchain-vue/src/cosmos/tx/signing/v1beta1/signing.ts +++ b/libs/interchain-vue/src/cosmos/tx/signing/v1beta1/signing.ts @@ -3,7 +3,6 @@ import { Any, AnyAmino } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * SignMode represents a signing mode with its own security guarantees. * @@ -112,9 +111,6 @@ export interface SignatureDescriptors { /** signatures are the signature descriptors */ signatures: SignatureDescriptor[]; } -export interface ReactiveSignatureDescriptors { - signatures: ComputedRef; -} export interface SignatureDescriptorsProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors"; value: Uint8Array; @@ -145,11 +141,6 @@ export interface SignatureDescriptor { */ sequence: bigint; } -export interface ReactiveSignatureDescriptor { - publicKey?: ComputedRef; - data?: ComputedRef; - sequence: ComputedRef; -} export interface SignatureDescriptorProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor"; value: Uint8Array; @@ -182,10 +173,6 @@ export interface SignatureDescriptor_Data { /** multi represents a multisig signer */ multi?: SignatureDescriptor_Data_Multi; } -export interface ReactiveSignatureDescriptor_Data { - single?: ComputedRef; - multi?: ComputedRef; -} export interface SignatureDescriptor_DataProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.Data"; value: Uint8Array; @@ -208,10 +195,6 @@ export interface SignatureDescriptor_Data_Single { /** signature is the raw signature bytes */ signature: Uint8Array; } -export interface ReactiveSignatureDescriptor_Data_Single { - mode: ComputedRef; - signature: ComputedRef; -} export interface SignatureDescriptor_Data_SingleProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.Single"; value: Uint8Array; @@ -234,10 +217,6 @@ export interface SignatureDescriptor_Data_Multi { /** signatures is the signatures of the multi-signature */ signatures: SignatureDescriptor_Data[]; } -export interface ReactiveSignatureDescriptor_Data_Multi { - bitarray?: ComputedRef; - signatures: ComputedRef; -} export interface SignatureDescriptor_Data_MultiProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.Multi"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts deleted file mode 100644 index fca7a223..00000000 --- a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.Service.ts +++ /dev/null @@ -1,455 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; -/** Service defines a gRPC service for interacting with transactions. */ -export interface Service { - /** Simulate simulates executing a transaction for estimating gas usage. */ - simulate(request: SimulateRequest): Promise; - /** GetTx fetches a tx by hash. */ - getTx(request: GetTxRequest): Promise; - /** BroadcastTx broadcast transaction. */ - broadcastTx(request: BroadcastTxRequest): Promise; - /** GetTxsEvent fetches txs by event. */ - getTxsEvent(request: GetTxsEventRequest): Promise; - /** - * GetBlockWithTxs fetches a block with decoded txs. - * - * Since: cosmos-sdk 0.45.2 - */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Simulate simulates executing a transaction for estimating gas usage. */ - simulate = async (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 BinaryReader(data))); - }; - /* GetTx fetches a tx by hash. */ - getTx = async (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 BinaryReader(data))); - }; - /* BroadcastTx broadcast transaction. */ - broadcastTx = async (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 BinaryReader(data))); - }; - /* GetTxsEvent fetches txs by event. */ - getTxsEvent = async (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 BinaryReader(data))); - }; - /* GetBlockWithTxs fetches a block with decoded txs. - - Since: cosmos-sdk 0.45.2 */ - getBlockWithTxs = async (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 BinaryReader(data))); - }; - /* TxDecode decodes the transaction. - - Since: cosmos-sdk 0.47 */ - txDecode = async (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 BinaryReader(data))); - }; - /* TxEncode encodes the transaction. - - Since: cosmos-sdk 0.47 */ - txEncode = async (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 BinaryReader(data))); - }; - /* TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - - Since: cosmos-sdk 0.47 */ - txEncodeAmino = async (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 BinaryReader(data))); - }; - /* TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - - Since: cosmos-sdk 0.47 */ - txDecodeAmino = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new ServiceClientImpl(rpc); - return { - simulate(request: SimulateRequest): Promise { - return queryService.simulate(request); - }, - getTx(request: GetTxRequest): Promise { - return queryService.getTx(request); - }, - broadcastTx(request: BroadcastTxRequest): Promise { - return queryService.broadcastTx(request); - }, - getTxsEvent(request: GetTxsEventRequest): Promise { - return queryService.getTxsEvent(request); - }, - getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { - return queryService.getBlockWithTxs(request); - }, - txDecode(request: TxDecodeRequest): Promise { - return queryService.txDecode(request); - }, - txEncode(request: TxEncodeRequest): Promise { - return queryService.txEncode(request); - }, - txEncodeAmino(request: TxEncodeAminoRequest): Promise { - return queryService.txEncodeAmino(request); - }, - txDecodeAmino(request: TxDecodeAminoRequest): Promise { - return queryService.txDecodeAmino(request); - } - }; -}; -export interface UseSimulateQuery extends VueQueryParams { - request: ReactiveSimulateRequest; -} -export interface UseGetTxQuery extends VueQueryParams { - request: ReactiveGetTxRequest; -} -export interface UseBroadcastTxQuery extends VueQueryParams { - request: ReactiveBroadcastTxRequest; -} -export interface UseGetTxsEventQuery extends VueQueryParams { - request: ReactiveGetTxsEventRequest; -} -export interface UseGetBlockWithTxsQuery extends VueQueryParams { - request: ReactiveGetBlockWithTxsRequest; -} -export interface UseTxDecodeQuery extends VueQueryParams { - request: ReactiveTxDecodeRequest; -} -export interface UseTxEncodeQuery extends VueQueryParams { - request: ReactiveTxEncodeRequest; -} -export interface UseTxEncodeAminoQuery extends VueQueryParams { - request: ReactiveTxEncodeAminoRequest; -} -export interface UseTxDecodeAminoQuery extends VueQueryParams { - request: ReactiveTxDecodeAminoRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new ServiceClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useSimulate = ({ - request, - options - }: UseSimulateQuery) => { - const queryKey = ["simulateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.simulate(params); - }, - ...options - }); - }; - const useGetTx = ({ - request, - options - }: UseGetTxQuery) => { - const queryKey = ["getTxQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getTx(params); - }, - ...options - }); - }; - const useBroadcastTx = ({ - request, - options - }: UseBroadcastTxQuery) => { - const queryKey = ["broadcastTxQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.broadcastTx(params); - }, - ...options - }); - }; - const useGetTxsEvent = ({ - request, - options - }: UseGetTxsEventQuery) => { - const queryKey = ["getTxsEventQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getTxsEvent(params); - }, - ...options - }); - }; - const useGetBlockWithTxs = ({ - request, - options - }: UseGetBlockWithTxsQuery) => { - const queryKey = ["getBlockWithTxsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.getBlockWithTxs(params); - }, - ...options - }); - }; - const useTxDecode = ({ - request, - options - }: UseTxDecodeQuery) => { - const queryKey = ["txDecodeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txDecode(params); - }, - ...options - }); - }; - const useTxEncode = ({ - request, - options - }: UseTxEncodeQuery) => { - const queryKey = ["txEncodeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txEncode(params); - }, - ...options - }); - }; - const useTxEncodeAmino = ({ - request, - options - }: UseTxEncodeAminoQuery) => { - const queryKey = ["txEncodeAminoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txEncodeAmino(params); - }, - ...options - }); - }; - const useTxDecodeAmino = ({ - request, - options - }: UseTxDecodeAminoQuery) => { - const queryKey = ["txDecodeAminoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.txDecodeAmino(params); - }, - ...options - }); - }; - return { - /** Simulate simulates executing a transaction for estimating gas usage. */useSimulate, - /** GetTx fetches a tx by hash. */useGetTx, - /** BroadcastTx broadcast transaction. */useBroadcastTx, - /** GetTxsEvent fetches txs by event. */useGetTxsEvent, - /** - * GetBlockWithTxs fetches a block with decoded txs. - * - * Since: cosmos-sdk 0.45.2 - */ - useGetBlockWithTxs, - /** - * TxDecode decodes the transaction. - * - * Since: cosmos-sdk 0.47 - */ - useTxDecode, - /** - * TxEncode encodes the transaction. - * - * Since: cosmos-sdk 0.47 - */ - useTxEncode, - /** - * TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - * - * Since: cosmos-sdk 0.47 - */ - useTxEncodeAmino, - /** - * TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - * - * Since: cosmos-sdk 0.47 - */ - useTxDecodeAmino - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts new file mode 100644 index 00000000..a13635e1 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.func.ts @@ -0,0 +1,65 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ + encode: SimulateRequest.encode, + decode: SimulateResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "Simulate", + clientResolver +}); +export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxRequest.encode, + decode: GetTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTx", + clientResolver +}); +export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: BroadcastTxRequest.encode, + decode: BroadcastTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "BroadcastTx", + clientResolver +}); +export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxsEventRequest.encode, + decode: GetTxsEventResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTxsEvent", + clientResolver +}); +export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetBlockWithTxsRequest.encode, + decode: GetBlockWithTxsResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetBlockWithTxs", + clientResolver +}); +export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeRequest.encode, + decode: TxDecodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecode", + clientResolver +}); +export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeRequest.encode, + decode: TxEncodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncode", + clientResolver +}); +export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeAminoRequest.encode, + decode: TxEncodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncodeAmino", + clientResolver +}); +export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeAminoRequest.encode, + decode: TxDecodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecodeAmino", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts new file mode 100644 index 00000000..c3e8714b --- /dev/null +++ b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts @@ -0,0 +1,39 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +export const useGetSimulate = buildUseVueQuery({ + builderQueryFn: createGetSimulate, + queryKeyPrefix: "SimulateQuery" +}); +export const useGetGetTx = buildUseVueQuery({ + builderQueryFn: createGetGetTx, + queryKeyPrefix: "GetTxQuery" +}); +export const useGetBroadcastTx = buildUseVueQuery({ + builderQueryFn: createGetBroadcastTx, + queryKeyPrefix: "BroadcastTxQuery" +}); +export const useGetGetTxsEvent = buildUseVueQuery({ + builderQueryFn: createGetGetTxsEvent, + queryKeyPrefix: "GetTxsEventQuery" +}); +export const useGetGetBlockWithTxs = buildUseVueQuery({ + builderQueryFn: createGetGetBlockWithTxs, + queryKeyPrefix: "GetBlockWithTxsQuery" +}); +export const useGetTxDecode = buildUseVueQuery({ + builderQueryFn: createGetTxDecode, + queryKeyPrefix: "TxDecodeQuery" +}); +export const useGetTxEncode = buildUseVueQuery({ + builderQueryFn: createGetTxEncode, + queryKeyPrefix: "TxEncodeQuery" +}); +export const useGetTxEncodeAmino = buildUseVueQuery({ + builderQueryFn: createGetTxEncodeAmino, + queryKeyPrefix: "TxEncodeAminoQuery" +}); +export const useGetTxDecodeAmino = buildUseVueQuery({ + builderQueryFn: createGetTxDecodeAmino, + queryKeyPrefix: "TxDecodeAminoQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.ts b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.ts index fe1d7763..9c0eaf31 100644 --- a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.ts +++ b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.ts @@ -6,7 +6,6 @@ import { Block, BlockAmino } from "../../../tendermint/types/block"; import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** OrderBy defines the sorting order */ export enum OrderBy { /** @@ -148,14 +147,6 @@ export interface GetTxsEventRequest { */ query: string; } -export interface ReactiveGetTxsEventRequest { - events: ComputedRef; - pagination?: ComputedRef; - orderBy: ComputedRef; - page: ComputedRef; - limit: ComputedRef; - query: ComputedRef; -} export interface GetTxsEventRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest"; value: Uint8Array; @@ -219,12 +210,6 @@ export interface GetTxsEventResponse { /** total is total number of results available */ total: bigint; } -export interface ReactiveGetTxsEventResponse { - txs: ComputedRef; - txResponses: ComputedRef; - pagination?: ComputedRef; - total: ComputedRef; -} export interface GetTxsEventResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse"; value: Uint8Array; @@ -260,10 +245,6 @@ export interface BroadcastTxRequest { txBytes: Uint8Array; mode: BroadcastMode; } -export interface ReactiveBroadcastTxRequest { - txBytes: ComputedRef; - mode: ComputedRef; -} export interface BroadcastTxRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest"; value: Uint8Array; @@ -289,9 +270,6 @@ export interface BroadcastTxResponse { /** tx_response is the queried TxResponses. */ txResponse?: TxResponse; } -export interface ReactiveBroadcastTxResponse { - txResponse?: ComputedRef; -} export interface BroadcastTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; value: Uint8Array; @@ -326,10 +304,6 @@ export interface SimulateRequest { */ txBytes: Uint8Array; } -export interface ReactiveSimulateRequest { - tx?: ComputedRef; - txBytes: ComputedRef; -} export interface SimulateRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SimulateRequest"; value: Uint8Array; @@ -366,10 +340,6 @@ export interface SimulateResponse { /** result is the result of the simulation. */ result?: Result; } -export interface ReactiveSimulateResponse { - gasInfo?: ComputedRef; - result?: ComputedRef; -} export interface SimulateResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; value: Uint8Array; @@ -396,9 +366,6 @@ export interface GetTxRequest { /** hash is the tx hash to query, encoded as a hex string. */ hash: string; } -export interface ReactiveGetTxRequest { - hash: ComputedRef; -} export interface GetTxRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxRequest"; value: Uint8Array; @@ -422,10 +389,6 @@ export interface GetTxResponse { /** tx_response is the queried TxResponses. */ txResponse?: TxResponse; } -export interface ReactiveGetTxResponse { - tx?: ComputedRef; - txResponse?: ComputedRef; -} export interface GetTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; value: Uint8Array; @@ -453,10 +416,6 @@ export interface GetBlockWithTxsRequest { /** pagination defines a pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveGetBlockWithTxsRequest { - height: ComputedRef; - pagination?: ComputedRef; -} export interface GetBlockWithTxsRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; value: Uint8Array; @@ -491,12 +450,6 @@ export interface GetBlockWithTxsResponse { /** pagination defines a pagination for the response. */ pagination?: PageResponse; } -export interface ReactiveGetBlockWithTxsResponse { - txs: ComputedRef; - blockId?: ComputedRef; - block?: ComputedRef; - pagination?: ComputedRef; -} export interface GetBlockWithTxsResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; value: Uint8Array; @@ -529,9 +482,6 @@ export interface TxDecodeRequest { /** tx_bytes is the raw transaction. */ txBytes: Uint8Array; } -export interface ReactiveTxDecodeRequest { - txBytes: ComputedRef; -} export interface TxDecodeRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest"; value: Uint8Array; @@ -560,9 +510,6 @@ export interface TxDecodeResponse { /** tx is the decoded transaction. */ tx?: Tx; } -export interface ReactiveTxDecodeResponse { - tx?: ComputedRef; -} export interface TxDecodeResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse"; value: Uint8Array; @@ -591,9 +538,6 @@ export interface TxEncodeRequest { /** tx is the transaction to encode. */ tx?: Tx; } -export interface ReactiveTxEncodeRequest { - tx?: ComputedRef; -} export interface TxEncodeRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest"; value: Uint8Array; @@ -622,9 +566,6 @@ export interface TxEncodeResponse { /** tx_bytes is the encoded transaction bytes. */ txBytes: Uint8Array; } -export interface ReactiveTxEncodeResponse { - txBytes: ComputedRef; -} export interface TxEncodeResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse"; value: Uint8Array; @@ -652,9 +593,6 @@ export interface TxEncodeResponseAminoMsg { export interface TxEncodeAminoRequest { aminoJson: string; } -export interface ReactiveTxEncodeAminoRequest { - aminoJson: ComputedRef; -} export interface TxEncodeAminoRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest"; value: Uint8Array; @@ -681,9 +619,6 @@ export interface TxEncodeAminoRequestAminoMsg { export interface TxEncodeAminoResponse { aminoBinary: Uint8Array; } -export interface ReactiveTxEncodeAminoResponse { - aminoBinary: ComputedRef; -} export interface TxEncodeAminoResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse"; value: Uint8Array; @@ -710,9 +645,6 @@ export interface TxEncodeAminoResponseAminoMsg { export interface TxDecodeAminoRequest { aminoBinary: Uint8Array; } -export interface ReactiveTxDecodeAminoRequest { - aminoBinary: ComputedRef; -} export interface TxDecodeAminoRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest"; value: Uint8Array; @@ -739,9 +671,6 @@ export interface TxDecodeAminoRequestAminoMsg { export interface TxDecodeAminoResponse { aminoJson: string; } -export interface ReactiveTxDecodeAminoResponse { - aminoJson: ComputedRef; -} export interface TxDecodeAminoResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/tx/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/tx/v1beta1/tx.ts index 480c8921..904ccf41 100644 --- a/libs/interchain-vue/src/cosmos/tx/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/tx/v1beta1/tx.ts @@ -5,7 +5,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; -import { ComputedRef } from "vue"; /** Tx is the standard type used for broadcasting transactions. */ export interface Tx { /** body is the processable content of the transaction */ @@ -22,11 +21,6 @@ export interface Tx { */ signatures: Uint8Array[]; } -export interface ReactiveTx { - body?: ComputedRef; - authInfo?: ComputedRef; - signatures: ComputedRef; -} export interface TxProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Tx"; value: Uint8Array; @@ -76,11 +70,6 @@ export interface TxRaw { */ signatures: Uint8Array[]; } -export interface ReactiveTxRaw { - bodyBytes: ComputedRef; - authInfoBytes: ComputedRef; - signatures: ComputedRef; -} export interface TxRawProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxRaw"; value: Uint8Array; @@ -135,12 +124,6 @@ export interface SignDoc { /** account_number is the account number of the account in state */ accountNumber: bigint; } -export interface ReactiveSignDoc { - bodyBytes: ComputedRef; - authInfoBytes: ComputedRef; - chainId: ComputedRef; - accountNumber: ComputedRef; -} export interface SignDocProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignDoc"; value: Uint8Array; @@ -198,14 +181,6 @@ export interface SignDocDirectAux { /** @deprecated */ tip?: Tip; } -export interface ReactiveSignDocDirectAux { - bodyBytes: ComputedRef; - publicKey?: ComputedRef; - chainId: ComputedRef; - accountNumber: ComputedRef; - sequence: ComputedRef; - tip?: ComputedRef; -} export interface SignDocDirectAuxProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux"; value: Uint8Array; @@ -278,13 +253,6 @@ export interface TxBody { */ nonCriticalExtensionOptions: Any[]; } -export interface ReactiveTxBody { - messages: ComputedRef; - memo: ComputedRef; - timeoutHeight: ComputedRef; - extensionOptions: ComputedRef; - nonCriticalExtensionOptions: ComputedRef; -} export interface TxBodyProtoMsg { typeUrl: "/cosmos.tx.v1beta1.TxBody"; value: Uint8Array; @@ -359,11 +327,6 @@ export interface AuthInfo { /** @deprecated */ tip?: Tip; } -export interface ReactiveAuthInfo { - signerInfos: ComputedRef; - fee?: ComputedRef; - tip?: ComputedRef; -} export interface AuthInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuthInfo"; value: Uint8Array; @@ -425,11 +388,6 @@ export interface SignerInfo { */ sequence: bigint; } -export interface ReactiveSignerInfo { - publicKey?: ComputedRef; - modeInfo?: ComputedRef; - sequence: ComputedRef; -} export interface SignerInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignerInfo"; value: Uint8Array; @@ -468,10 +426,6 @@ export interface ModeInfo { /** multi represents a nested multisig signer */ multi?: ModeInfo_Multi; } -export interface ReactiveModeInfo { - single?: ComputedRef; - multi?: ComputedRef; -} export interface ModeInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.ModeInfo"; value: Uint8Array; @@ -496,9 +450,6 @@ export interface ModeInfo_Single { /** mode is the signing mode of the single signer */ mode: SignMode; } -export interface ReactiveModeInfo_Single { - mode: ComputedRef; -} export interface ModeInfo_SingleProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Single"; value: Uint8Array; @@ -526,10 +477,6 @@ export interface ModeInfo_Multi { */ modeInfos: ModeInfo[]; } -export interface ReactiveModeInfo_Multi { - bitarray?: ComputedRef; - modeInfos: ComputedRef; -} export interface ModeInfo_MultiProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Multi"; value: Uint8Array; @@ -574,12 +521,6 @@ export interface Fee { */ granter: string; } -export interface ReactiveFee { - amount: ComputedRef; - gasLimit: ComputedRef; - payer: ComputedRef; - granter: ComputedRef; -} export interface FeeProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Fee"; value: Uint8Array; @@ -626,10 +567,6 @@ export interface Tip { /** tipper is the address of the account paying for the tip */ tipper: string; } -export interface ReactiveTip { - amount: ComputedRef; - tipper: ComputedRef; -} export interface TipProtoMsg { typeUrl: "/cosmos.tx.v1beta1.Tip"; value: Uint8Array; @@ -676,12 +613,6 @@ export interface AuxSignerData { /** sig is the signature of the sign doc. */ sig: Uint8Array; } -export interface ReactiveAuxSignerData { - address: ComputedRef; - signDoc?: ComputedRef; - mode: ComputedRef; - sig: ComputedRef; -} export interface AuxSignerDataProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuxSignerData"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/upgrade/module/v1/module.ts b/libs/interchain-vue/src/cosmos/upgrade/module/v1/module.ts index 0511ccc3..5f143765 100644 --- a/libs/interchain-vue/src/cosmos/upgrade/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/upgrade/module/v1/module.ts @@ -1,15 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** Module is the config object of the upgrade module. */ export interface Module { /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } -export interface ReactiveModule { - authority: ComputedRef; -} export interface ModuleProtoMsg { typeUrl: "/cosmos.upgrade.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.Query.ts deleted file mode 100644 index aa39d478..00000000 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,282 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse, ReactiveQueryCurrentPlanRequest, ReactiveQueryAppliedPlanRequest, ReactiveQueryUpgradedConsensusStateRequest, ReactiveQueryModuleVersionsRequest, ReactiveQueryAuthorityRequest } from "./query"; -/** Query defines the gRPC upgrade querier service. */ -export interface Query { - /** CurrentPlan queries the current upgrade plan. */ - currentPlan(request?: QueryCurrentPlanRequest): Promise; - /** AppliedPlan queries a previously applied upgrade plan by its name. */ - 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 - * stored at the last height of this chain. - * UpgradedConsensusState RPC not supported with legacy querier - * 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) - */ - upgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise; - /** - * ModuleVersions queries the list of module versions from state. - * - * Since: cosmos-sdk 0.43 - */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CurrentPlan queries the current upgrade plan. */ - currentPlan = async (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 BinaryReader(data))); - }; - /* AppliedPlan queries a previously applied upgrade plan by its name. */ - appliedPlan = async (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 BinaryReader(data))); - }; - /* UpgradedConsensusState queries the consensus state that will serve - as a trusted kernel for the next version of this chain. It will only be - stored at the last height of this chain. - UpgradedConsensusState RPC not supported with legacy querier - 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) */ - upgradedConsensusState = async (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 BinaryReader(data))); - }; - /* ModuleVersions queries the list of module versions from state. - - Since: cosmos-sdk 0.43 */ - moduleVersions = async (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 BinaryReader(data))); - }; - /* Returns the account with authority to conduct upgrades - - Since: cosmos-sdk 0.46 */ - authority = async (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 BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - currentPlan(request?: QueryCurrentPlanRequest): Promise { - return queryService.currentPlan(request); - }, - appliedPlan(request: QueryAppliedPlanRequest): Promise { - return queryService.appliedPlan(request); - }, - upgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise { - return queryService.upgradedConsensusState(request); - }, - moduleVersions(request: QueryModuleVersionsRequest): Promise { - return queryService.moduleVersions(request); - }, - authority(request?: QueryAuthorityRequest): Promise { - return queryService.authority(request); - } - }; -}; -export interface UseCurrentPlanQuery extends VueQueryParams { - request?: ReactiveQueryCurrentPlanRequest; -} -export interface UseAppliedPlanQuery extends VueQueryParams { - request: ReactiveQueryAppliedPlanRequest; -} -export interface UseUpgradedConsensusStateQuery extends VueQueryParams { - request: ReactiveQueryUpgradedConsensusStateRequest; -} -export interface UseModuleVersionsQuery extends VueQueryParams { - request: ReactiveQueryModuleVersionsRequest; -} -export interface UseAuthorityQuery extends VueQueryParams { - request?: ReactiveQueryAuthorityRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useCurrentPlan = ({ - request, - options - }: UseCurrentPlanQuery) => { - const queryKey = ["currentPlanQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.currentPlan(params); - }, - ...options - }); - }; - const useAppliedPlan = ({ - request, - options - }: UseAppliedPlanQuery) => { - const queryKey = ["appliedPlanQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.appliedPlan(params); - }, - ...options - }); - }; - const useUpgradedConsensusState = ({ - request, - options - }: UseUpgradedConsensusStateQuery) => { - const queryKey = ["upgradedConsensusStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.upgradedConsensusState(params); - }, - ...options - }); - }; - const useModuleVersions = ({ - request, - options - }: UseModuleVersionsQuery) => { - const queryKey = ["moduleVersionsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.moduleVersions(params); - }, - ...options - }); - }; - const useAuthority = ({ - request, - options - }: UseAuthorityQuery) => { - const queryKey = ["authorityQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.authority(params); - }, - ...options - }); - }; - return { - /** CurrentPlan queries the current upgrade plan. */useCurrentPlan, - /** AppliedPlan queries a previously applied upgrade plan by its name. */useAppliedPlan, - /** - * UpgradedConsensusState queries the consensus state that will serve - * as a trusted kernel for the next version of this chain. It will only be - * stored at the last height of this chain. - * UpgradedConsensusState RPC not supported with legacy querier - * 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) - */ - useUpgradedConsensusState, - /** - * ModuleVersions queries the list of module versions from state. - * - * Since: cosmos-sdk 0.43 - */ - useModuleVersions, - /** - * Returns the account with authority to conduct upgrades - * - * Since: cosmos-sdk 0.46 - */ - useAuthority - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.func.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..82a1af0a --- /dev/null +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.func.ts @@ -0,0 +1,37 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; +export const createGetCurrentPlan = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCurrentPlanRequest.encode, + decode: QueryCurrentPlanResponse.decode, + service: "cosmos.upgrade.v1beta1.Query", + method: "CurrentPlan", + clientResolver +}); +export const createGetAppliedPlan = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAppliedPlanRequest.encode, + decode: QueryAppliedPlanResponse.decode, + service: "cosmos.upgrade.v1beta1.Query", + method: "AppliedPlan", + clientResolver +}); +export const createGetUpgradedConsensusState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryUpgradedConsensusStateRequest.encode, + decode: QueryUpgradedConsensusStateResponse.decode, + service: "cosmos.upgrade.v1beta1.Query", + method: "UpgradedConsensusState", + clientResolver +}); +export const createGetModuleVersions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleVersionsRequest.encode, + decode: QueryModuleVersionsResponse.decode, + service: "cosmos.upgrade.v1beta1.Query", + method: "ModuleVersions", + clientResolver +}); +export const createGetAuthority = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAuthorityRequest.encode, + decode: QueryAuthorityResponse.decode, + service: "cosmos.upgrade.v1beta1.Query", + method: "Authority", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts new file mode 100644 index 00000000..e8a93ccc --- /dev/null +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts @@ -0,0 +1,23 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; +import { createGetCurrentPlan, createGetAppliedPlan, createGetUpgradedConsensusState, createGetModuleVersions, createGetAuthority } from "./query.rpc.func.ts"; +export const useGetCurrentPlan = buildUseVueQuery({ + builderQueryFn: createGetCurrentPlan, + queryKeyPrefix: "CurrentPlanQuery" +}); +export const useGetAppliedPlan = buildUseVueQuery({ + builderQueryFn: createGetAppliedPlan, + queryKeyPrefix: "AppliedPlanQuery" +}); +export const useGetUpgradedConsensusState = buildUseVueQuery({ + builderQueryFn: createGetUpgradedConsensusState, + queryKeyPrefix: "UpgradedConsensusStateQuery" +}); +export const useGetModuleVersions = buildUseVueQuery({ + builderQueryFn: createGetModuleVersions, + queryKeyPrefix: "ModuleVersionsQuery" +}); +export const useGetAuthority = buildUseVueQuery({ + builderQueryFn: createGetAuthority, + queryKeyPrefix: "AuthorityQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.ts index 6f293ad0..162c61f9 100644 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.ts +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.ts @@ -2,13 +2,11 @@ import { Plan, PlanAmino, ModuleVersion, ModuleVersionAmino } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC * method. */ export interface QueryCurrentPlanRequest {} -export interface ReactiveQueryCurrentPlanRequest {} export interface QueryCurrentPlanRequestProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest"; value: Uint8Array; @@ -30,9 +28,6 @@ export interface QueryCurrentPlanResponse { /** plan is the current upgrade plan. */ plan?: Plan; } -export interface ReactiveQueryCurrentPlanResponse { - plan?: ComputedRef; -} export interface QueryCurrentPlanResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse"; value: Uint8Array; @@ -57,9 +52,6 @@ export interface QueryAppliedPlanRequest { /** name is the name of the applied plan to query for. */ name: string; } -export interface ReactiveQueryAppliedPlanRequest { - name: ComputedRef; -} export interface QueryAppliedPlanRequestProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest"; value: Uint8Array; @@ -84,9 +76,6 @@ export interface QueryAppliedPlanResponse { /** height is the block height at which the plan was applied. */ height: bigint; } -export interface ReactiveQueryAppliedPlanResponse { - height: ComputedRef; -} export interface QueryAppliedPlanResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse"; value: Uint8Array; @@ -115,9 +104,6 @@ export interface QueryUpgradedConsensusStateRequest { */ lastHeight: bigint; } -export interface ReactiveQueryUpgradedConsensusStateRequest { - lastHeight: ComputedRef; -} export interface QueryUpgradedConsensusStateRequestProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest"; value: Uint8Array; @@ -147,9 +133,6 @@ export interface QueryUpgradedConsensusStateResponse { /** Since: cosmos-sdk 0.43 */ upgradedConsensusState: Uint8Array; } -export interface ReactiveQueryUpgradedConsensusStateResponse { - upgradedConsensusState: ComputedRef; -} export interface QueryUpgradedConsensusStateResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse"; value: Uint8Array; @@ -181,9 +164,6 @@ export interface QueryModuleVersionsRequest { */ moduleName: string; } -export interface ReactiveQueryModuleVersionsRequest { - moduleName: ComputedRef; -} export interface QueryModuleVersionsRequestProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest"; value: Uint8Array; @@ -216,9 +196,6 @@ export interface QueryModuleVersionsResponse { /** module_versions is a list of module names with their consensus versions. */ moduleVersions: ModuleVersion[]; } -export interface ReactiveQueryModuleVersionsResponse { - moduleVersions: ComputedRef; -} export interface QueryModuleVersionsResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse"; value: Uint8Array; @@ -243,7 +220,6 @@ export interface QueryModuleVersionsResponseAminoMsg { * Since: cosmos-sdk 0.46 */ export interface QueryAuthorityRequest {} -export interface ReactiveQueryAuthorityRequest {} export interface QueryAuthorityRequestProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest"; value: Uint8Array; @@ -266,9 +242,6 @@ export interface QueryAuthorityRequestAminoMsg { export interface QueryAuthorityResponse { address: string; } -export interface ReactiveQueryAuthorityResponse { - address: ComputedRef; -} export interface QueryAuthorityResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.amino.ts deleted file mode 100644 index 1734b0fa..00000000 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.amino.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; -export const AminoConverter = { - "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": { - aminoType: "cosmos-sdk/MsgSoftwareUpgrade", - toAmino: MsgSoftwareUpgrade.toAmino, - fromAmino: MsgSoftwareUpgrade.fromAmino - }, - "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": { - aminoType: "cosmos-sdk/MsgCancelUpgrade", - toAmino: MsgCancelUpgrade.toAmino, - fromAmino: MsgCancelUpgrade.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..74f704a8 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const createSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSoftwareUpgrade.typeUrl, + encoders: toEncoders(MsgSoftwareUpgrade), + converters: toConverters(MsgSoftwareUpgrade) +}); +export const createCancelUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelUpgrade.typeUrl, + encoders: toEncoders(MsgCancelUpgrade), + converters: toConverters(MsgCancelUpgrade) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 990cd1bf..00000000 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgSoftwareUpgrade, MsgSoftwareUpgradeResponse, MsgCancelUpgrade, MsgCancelUpgradeResponse } from "./tx"; -/** 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* SoftwareUpgrade is a governance operation for initiating a software upgrade. - - Since: cosmos-sdk 0.46 */ - softwareUpgrade = async (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 BinaryReader(data))); - }; - /* CancelUpgrade is a governance operation for cancelling a previously - approved software upgrade. - - Since: cosmos-sdk 0.46 */ - cancelUpgrade = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..a57a6b6d --- /dev/null +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,9 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +import { createSoftwareUpgrade, createCancelUpgrade } from "./tx.rpc.func.ts"; +export const useSoftwareUpgrade = buildUseVueMutation({ + builderMutationFn: createSoftwareUpgrade +}); +export const useCancelUpgrade = buildUseVueMutation({ + builderMutationFn: createCancelUpgrade +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.ts index d66cd681..87959bec 100644 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.ts @@ -2,7 +2,6 @@ import { Plan, PlanAmino } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. * @@ -14,10 +13,6 @@ export interface MsgSoftwareUpgrade { /** plan is the upgrade plan. */ plan: Plan; } -export interface ReactiveMsgSoftwareUpgrade { - authority: ComputedRef; - plan: ComputedRef; -} export interface MsgSoftwareUpgradeProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade"; value: Uint8Array; @@ -43,7 +38,6 @@ export interface MsgSoftwareUpgradeAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgSoftwareUpgradeResponse {} -export interface ReactiveMsgSoftwareUpgradeResponse {} export interface MsgSoftwareUpgradeResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse"; value: Uint8Array; @@ -67,9 +61,6 @@ export interface MsgCancelUpgrade { /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ authority: string; } -export interface ReactiveMsgCancelUpgrade { - authority: ComputedRef; -} export interface MsgCancelUpgradeProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade"; value: Uint8Array; @@ -93,7 +84,6 @@ export interface MsgCancelUpgradeAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCancelUpgradeResponse {} -export interface ReactiveMsgCancelUpgradeResponse {} export interface MsgCancelUpgradeResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/upgrade.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/upgrade.ts index a4795bc0..c2adfcb7 100644 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/upgrade.ts +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -3,7 +3,6 @@ import { Any, AnyAmino } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp, DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** Plan specifies information about a planned upgrade and when it should occur. */ export interface Plan { /** @@ -38,13 +37,6 @@ export interface Plan { /** @deprecated */ upgradedClientState?: Any; } -export interface ReactivePlan { - name: ComputedRef; - time: ComputedRef; - height: ComputedRef; - info: ComputedRef; - upgradedClientState?: ComputedRef; -} export interface PlanProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.Plan"; value: Uint8Array; @@ -102,11 +94,6 @@ export interface SoftwareUpgradeProposal { /** plan of the proposal */ plan: Plan; } -export interface ReactiveSoftwareUpgradeProposal { - title: ComputedRef; - description: ComputedRef; - plan: ComputedRef; -} export interface SoftwareUpgradeProposalProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; value: Uint8Array; @@ -143,10 +130,6 @@ export interface CancelSoftwareUpgradeProposal { /** description of the proposal */ description: string; } -export interface ReactiveCancelSoftwareUpgradeProposal { - title: ComputedRef; - description: ComputedRef; -} export interface CancelSoftwareUpgradeProposalProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; value: Uint8Array; @@ -179,10 +162,6 @@ export interface ModuleVersion { /** consensus version of the app module */ version: bigint; } -export interface ReactiveModuleVersion { - name: ComputedRef; - version: ComputedRef; -} export interface ModuleVersionProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/validate/module/v1/module.ts b/libs/interchain-vue/src/cosmos/validate/module/v1/module.ts index 6a0da9dc..ebbed907 100644 --- a/libs/interchain-vue/src/cosmos/validate/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/validate/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object of the x/validate module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.validate.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/vesting/module/v1/module.ts b/libs/interchain-vue/src/cosmos/vesting/module/v1/module.ts index a31b61b1..cfa267ec 100644 --- a/libs/interchain-vue/src/cosmos/vesting/module/v1/module.ts +++ b/libs/interchain-vue/src/cosmos/vesting/module/v1/module.ts @@ -3,7 +3,6 @@ import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; /** Module is the config object of the vesting module. */ export interface Module {} -export interface ReactiveModule {} export interface ModuleProtoMsg { typeUrl: "/cosmos.vesting.module.v1.Module"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.amino.ts b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.amino.ts deleted file mode 100644 index 3085e0b1..00000000 --- a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; -export const AminoConverter = { - "/cosmos.vesting.v1beta1.MsgCreateVestingAccount": { - aminoType: "cosmos-sdk/MsgCreateVestingAccount", - toAmino: MsgCreateVestingAccount.toAmino, - fromAmino: MsgCreateVestingAccount.fromAmino - }, - "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount": { - aminoType: "cosmos-sdk/MsgCreatePermLockedAccount", - toAmino: MsgCreatePermanentLockedAccount.toAmino, - fromAmino: MsgCreatePermanentLockedAccount.fromAmino - }, - "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount": { - aminoType: "cosmos-sdk/MsgCreatePeriodVestAccount", - toAmino: MsgCreatePeriodicVestingAccount.toAmino, - fromAmino: MsgCreatePeriodicVestingAccount.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..49328086 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +export const createCreateVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateVestingAccount.typeUrl, + encoders: toEncoders(MsgCreateVestingAccount), + converters: toConverters(MsgCreateVestingAccount) +}); +export const createCreatePermanentLockedAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePermanentLockedAccount.typeUrl, + encoders: toEncoders(MsgCreatePermanentLockedAccount), + converters: toConverters(MsgCreatePermanentLockedAccount) +}); +export const createCreatePeriodicVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePeriodicVestingAccount.typeUrl, + encoders: toEncoders(MsgCreatePeriodicVestingAccount), + converters: toConverters(MsgCreatePeriodicVestingAccount) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index fba8f175..00000000 --- a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgCreateVestingAccount, MsgCreateVestingAccountResponse, MsgCreatePermanentLockedAccount, MsgCreatePermanentLockedAccountResponse, MsgCreatePeriodicVestingAccount, MsgCreatePeriodicVestingAccountResponse } from "./tx"; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** - * CreateVestingAccount defines a method that enables creating a vesting - * account. - */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateVestingAccount defines a method that enables creating a vesting - account. */ - createVestingAccount = async (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 BinaryReader(data))); - }; - /* CreatePermanentLockedAccount defines a method that enables creating a permanent - locked account. - - Since: cosmos-sdk 0.46 */ - createPermanentLockedAccount = async (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 BinaryReader(data))); - }; - /* CreatePeriodicVestingAccount defines a method that enables creating a - periodic vesting account. - - Since: cosmos-sdk 0.46 */ - createPeriodicVestingAccount = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts new file mode 100644 index 00000000..a5ff2e80 --- /dev/null +++ b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts @@ -0,0 +1,12 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +export const useCreateVestingAccount = buildUseVueMutation({ + builderMutationFn: createCreateVestingAccount +}); +export const useCreatePermanentLockedAccount = buildUseVueMutation({ + builderMutationFn: createCreatePermanentLockedAccount +}); +export const useCreatePeriodicVestingAccount = buildUseVueMutation({ + builderMutationFn: createCreatePeriodicVestingAccount +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.ts b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.ts index 59f9c356..4e9fcb3f 100644 --- a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.ts +++ b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Period, PeriodAmino } from "./vesting"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; -import { ComputedRef } from "vue"; /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. @@ -16,13 +15,6 @@ export interface MsgCreateVestingAccount { endTime: bigint; delayed: boolean; } -export interface ReactiveMsgCreateVestingAccount { - fromAddress: ComputedRef; - toAddress: ComputedRef; - amount: ComputedRef; - endTime: ComputedRef; - delayed: ComputedRef; -} export interface MsgCreateVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount"; value: Uint8Array; @@ -45,7 +37,6 @@ export interface MsgCreateVestingAccountAminoMsg { } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ export interface MsgCreateVestingAccountResponse {} -export interface ReactiveMsgCreateVestingAccountResponse {} export interface MsgCreateVestingAccountResponseProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse"; value: Uint8Array; @@ -67,11 +58,6 @@ export interface MsgCreatePermanentLockedAccount { toAddress: string; amount: Coin[]; } -export interface ReactiveMsgCreatePermanentLockedAccount { - fromAddress: ComputedRef; - toAddress: ComputedRef; - amount: ComputedRef; -} export interface MsgCreatePermanentLockedAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount"; value: Uint8Array; @@ -97,7 +83,6 @@ export interface MsgCreatePermanentLockedAccountAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCreatePermanentLockedAccountResponse {} -export interface ReactiveMsgCreatePermanentLockedAccountResponse {} export interface MsgCreatePermanentLockedAccountResponseProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse"; value: Uint8Array; @@ -125,12 +110,6 @@ export interface MsgCreatePeriodicVestingAccount { startTime: bigint; vestingPeriods: Period[]; } -export interface ReactiveMsgCreatePeriodicVestingAccount { - fromAddress: ComputedRef; - toAddress: ComputedRef; - startTime: ComputedRef; - vestingPeriods: ComputedRef; -} export interface MsgCreatePeriodicVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount"; value: Uint8Array; @@ -159,7 +138,6 @@ export interface MsgCreatePeriodicVestingAccountAminoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCreatePeriodicVestingAccountResponse {} -export interface ReactiveMsgCreatePeriodicVestingAccountResponse {} export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos/vesting/v1beta1/vesting.ts b/libs/interchain-vue/src/cosmos/vesting/v1beta1/vesting.ts index 3e4118c2..47cbe3b6 100644 --- a/libs/interchain-vue/src/cosmos/vesting/v1beta1/vesting.ts +++ b/libs/interchain-vue/src/cosmos/vesting/v1beta1/vesting.ts @@ -3,7 +3,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * BaseVestingAccount implements the VestingAccount interface. It contains all * the necessary fields needed for any vesting account implementation. @@ -16,13 +15,6 @@ export interface BaseVestingAccount { /** Vesting end time, as unix timestamp (in seconds). */ endTime: bigint; } -export interface ReactiveBaseVestingAccount { - baseAccount?: ComputedRef; - originalVesting: ComputedRef; - delegatedFree: ComputedRef; - delegatedVesting: ComputedRef; - endTime: ComputedRef; -} export interface BaseVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount"; value: Uint8Array; @@ -52,10 +44,6 @@ export interface ContinuousVestingAccount { /** Vesting start time, as unix timestamp (in seconds). */ startTime: bigint; } -export interface ReactiveContinuousVestingAccount { - baseVestingAccount?: ComputedRef; - startTime: ComputedRef; -} export interface ContinuousVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount"; value: Uint8Array; @@ -81,9 +69,6 @@ export interface ContinuousVestingAccountAminoMsg { export interface DelayedVestingAccount { baseVestingAccount?: BaseVestingAccount; } -export interface ReactiveDelayedVestingAccount { - baseVestingAccount?: ComputedRef; -} export interface DelayedVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount"; value: Uint8Array; @@ -106,10 +91,6 @@ export interface Period { length: bigint; amount: Coin[]; } -export interface ReactivePeriod { - length: ComputedRef; - amount: ComputedRef; -} export interface PeriodProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.Period"; value: Uint8Array; @@ -133,11 +114,6 @@ export interface PeriodicVestingAccount { startTime: bigint; vestingPeriods: Period[]; } -export interface ReactivePeriodicVestingAccount { - baseVestingAccount?: ComputedRef; - startTime: ComputedRef; - vestingPeriods: ComputedRef; -} export interface PeriodicVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount"; value: Uint8Array; @@ -165,9 +141,6 @@ export interface PeriodicVestingAccountAminoMsg { export interface PermanentLockedAccount { baseVestingAccount?: BaseVestingAccount; } -export interface ReactivePermanentLockedAccount { - baseVestingAccount?: ComputedRef; -} export interface PermanentLockedAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmos_proto/cosmos.ts b/libs/interchain-vue/src/cosmos_proto/cosmos.ts index d558ab50..0a97877f 100644 --- a/libs/interchain-vue/src/cosmos_proto/cosmos.ts +++ b/libs/interchain-vue/src/cosmos_proto/cosmos.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../binary"; import { DeepPartial } from "../helpers"; import { GlobalDecoderRegistry } from "../registry"; -import { ComputedRef } from "vue"; export enum ScalarType { SCALAR_TYPE_UNSPECIFIED = 0, SCALAR_TYPE_STRING = 1, @@ -57,10 +56,6 @@ export interface InterfaceDescriptor { */ description: string; } -export interface ReactiveInterfaceDescriptor { - name: ComputedRef; - description: ComputedRef; -} export interface InterfaceDescriptorProtoMsg { typeUrl: "/cosmos_proto.InterfaceDescriptor"; value: Uint8Array; @@ -118,11 +113,6 @@ export interface ScalarDescriptor { */ fieldType: ScalarType[]; } -export interface ReactiveScalarDescriptor { - name: ComputedRef; - description: ComputedRef; - fieldType: ComputedRef; -} export interface ScalarDescriptorProtoMsg { typeUrl: "/cosmos_proto.ScalarDescriptor"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmwasm/rpc.query.ts b/libs/interchain-vue/src/cosmwasm/rpc.query.ts deleted file mode 100644 index 166f2c6b..00000000 --- a/libs/interchain-vue/src/cosmwasm/rpc.query.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import { QueryClient } from "@cosmjs/stargate"; -export const createRPCQueryClient = async ({ - rpcEndpoint -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - cosmos: { - app: { - v1alpha1: (await import("../cosmos/app/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) - }, - auth: { - v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - authz: { - v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - autocli: { - v1: (await import("../cosmos/autocli/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - bank: { - v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - base: { - grpc: { - v2: (await import("../cosmos/base/grpc/v2/service.rpc.Service")).createRpcQueryExtension(client) - }, - node: { - v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client), - v2: (await import("../cosmos/base/node/v2/query.rpc.Service")).createRpcQueryExtension(client) - }, - tendermint: { - v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) - } - }, - circuit: { - v1: (await import("../cosmos/circuit/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - consensus: { - v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - distribution: { - v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - evidence: { - v1beta1: (await import("../cosmos/evidence/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - feegrant: { - v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - gov: { - v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), - v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - group: { - v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - mint: { - v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - nft: { - v1beta1: (await import("../cosmos/nft/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - orm: { - query: { - v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) - } - }, - params: { - v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - slashing: { - v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - staking: { - v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - tx: { - v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) - }, - upgrade: { - v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - } - }, - cosmwasm: { - wasm: { - v1: (await import("./wasm/v1/query.rpc.Query")).createRpcQueryExtension(client) - } - } - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/rpc.tx.ts b/libs/interchain-vue/src/cosmwasm/rpc.tx.ts deleted file mode 100644 index 41775ec7..00000000 --- a/libs/interchain-vue/src/cosmwasm/rpc.tx.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - auth: { - v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - authz: { - v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - circuit: { - v1: new (await import("../cosmos/circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - consensus: { - v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - crisis: { - v1beta1: new (await import("../cosmos/crisis/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - evidence: { - v1beta1: new (await import("../cosmos/evidence/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - mint: { - v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - nft: { - v1beta1: new (await import("../cosmos/nft/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - slashing: { - v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - upgrade: { - v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - cosmwasm: { - wasm: { - v1: new (await import("./wasm/v1/tx.rpc.msg")).MsgClientImpl(rpc) - } - } -}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts deleted file mode 100644 index 2120533e..00000000 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.Query.ts +++ /dev/null @@ -1,612 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { VueQueryParams } from "../../../vue-query"; -import { ComputedRef, computed, Ref } from "vue"; -import { useQuery } from "@tanstack/vue-query"; -import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse, ReactiveQueryContractInfoRequest, ReactiveQueryContractHistoryRequest, ReactiveQueryContractsByCodeRequest, ReactiveQueryAllContractStateRequest, ReactiveQueryRawContractStateRequest, ReactiveQuerySmartContractStateRequest, ReactiveQueryCodeRequest, ReactiveQueryCodesRequest, ReactiveQueryCodeInfoRequest, ReactiveQueryPinnedCodesRequest, ReactiveQueryParamsRequest, ReactiveQueryContractsByCreatorRequest, ReactiveQueryWasmLimitsConfigRequest, ReactiveQueryBuildAddressRequest } from "./query"; -/** Query provides defines the gRPC querier service */ -export interface Query { - /** ContractInfo gets the contract meta data */ - contractInfo(request: QueryContractInfoRequest): Promise; - /** ContractHistory gets the contract code history */ - contractHistory(request: QueryContractHistoryRequest): Promise; - /** ContractsByCode lists all smart contracts for a code id */ - contractsByCode(request: QueryContractsByCodeRequest): Promise; - /** AllContractState gets all raw store data for a single contract */ - allContractState(request: QueryAllContractStateRequest): Promise; - /** RawContractState gets single key from the raw store data of a contract */ - rawContractState(request: QueryRawContractStateRequest): Promise; - /** SmartContractState get smart query result from the contract */ - smartContractState(request: QuerySmartContractStateRequest): Promise; - /** Code gets the binary code and metadata for a single wasm code */ - code(request: QueryCodeRequest): Promise; - /** Codes gets the metadata for all stored wasm codes */ - codes(request?: QueryCodesRequest): Promise; - /** CodeInfo gets the metadata for a single wasm code */ - codeInfo(request: QueryCodeInfoRequest): Promise; - /** PinnedCodes gets the pinned code ids */ - pinnedCodes(request?: QueryPinnedCodesRequest): Promise; - /** Params gets the module params */ - params(request?: QueryParamsRequest): Promise; - /** ContractsByCreator gets the contracts by creator */ - contractsByCreator(request: QueryContractsByCreatorRequest): Promise; - /** - * WasmLimitsConfig gets the configured limits for static validation of Wasm - * files, encoded in JSON. - */ - wasmLimitsConfig(request?: QueryWasmLimitsConfigRequest): Promise; - /** BuildAddress builds a contract address */ - buildAddress(request: QueryBuildAddressRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* ContractInfo gets the contract meta data */ - contractInfo = async (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 BinaryReader(data))); - }; - /* ContractHistory gets the contract code history */ - contractHistory = async (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 BinaryReader(data))); - }; - /* ContractsByCode lists all smart contracts for a code id */ - contractsByCode = async (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 BinaryReader(data))); - }; - /* AllContractState gets all raw store data for a single contract */ - allContractState = async (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 BinaryReader(data))); - }; - /* RawContractState gets single key from the raw store data of a contract */ - rawContractState = async (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 BinaryReader(data))); - }; - /* SmartContractState get smart query result from the contract */ - smartContractState = async (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 BinaryReader(data))); - }; - /* Code gets the binary code and metadata for a single wasm code */ - code = async (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 BinaryReader(data))); - }; - /* Codes gets the metadata for all stored wasm codes */ - codes = async (request: QueryCodesRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* CodeInfo gets the metadata for a single wasm code */ - codeInfo = async (request: QueryCodeInfoRequest): Promise => { - const data = QueryCodeInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "CodeInfo", data); - return promise.then(data => QueryCodeInfoResponse.decode(new BinaryReader(data))); - }; - /* PinnedCodes gets the pinned code ids */ - pinnedCodes = async (request: QueryPinnedCodesRequest = { - pagination: undefined - }): 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 BinaryReader(data))); - }; - /* Params gets the module params */ - params = async (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 BinaryReader(data))); - }; - /* ContractsByCreator gets the contracts by creator */ - contractsByCreator = async (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 BinaryReader(data))); - }; - /* WasmLimitsConfig gets the configured limits for static validation of Wasm - files, encoded in JSON. */ - wasmLimitsConfig = async (request: QueryWasmLimitsConfigRequest = {}): Promise => { - const data = QueryWasmLimitsConfigRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "WasmLimitsConfig", data); - return promise.then(data => QueryWasmLimitsConfigResponse.decode(new BinaryReader(data))); - }; - /* BuildAddress builds a contract address */ - buildAddress = async (request: QueryBuildAddressRequest): Promise => { - const data = QueryBuildAddressRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "BuildAddress", data); - return promise.then(data => QueryBuildAddressResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - contractInfo(request: QueryContractInfoRequest): Promise { - return queryService.contractInfo(request); - }, - contractHistory(request: QueryContractHistoryRequest): Promise { - return queryService.contractHistory(request); - }, - contractsByCode(request: QueryContractsByCodeRequest): Promise { - return queryService.contractsByCode(request); - }, - allContractState(request: QueryAllContractStateRequest): Promise { - return queryService.allContractState(request); - }, - rawContractState(request: QueryRawContractStateRequest): Promise { - return queryService.rawContractState(request); - }, - smartContractState(request: QuerySmartContractStateRequest): Promise { - return queryService.smartContractState(request); - }, - code(request: QueryCodeRequest): Promise { - return queryService.code(request); - }, - codes(request?: QueryCodesRequest): Promise { - return queryService.codes(request); - }, - codeInfo(request: QueryCodeInfoRequest): Promise { - return queryService.codeInfo(request); - }, - pinnedCodes(request?: QueryPinnedCodesRequest): Promise { - return queryService.pinnedCodes(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - contractsByCreator(request: QueryContractsByCreatorRequest): Promise { - return queryService.contractsByCreator(request); - }, - wasmLimitsConfig(request?: QueryWasmLimitsConfigRequest): Promise { - return queryService.wasmLimitsConfig(request); - }, - buildAddress(request: QueryBuildAddressRequest): Promise { - return queryService.buildAddress(request); - } - }; -}; -export interface UseContractInfoQuery extends VueQueryParams { - request: ReactiveQueryContractInfoRequest; -} -export interface UseContractHistoryQuery extends VueQueryParams { - request: ReactiveQueryContractHistoryRequest; -} -export interface UseContractsByCodeQuery extends VueQueryParams { - request: ReactiveQueryContractsByCodeRequest; -} -export interface UseAllContractStateQuery extends VueQueryParams { - request: ReactiveQueryAllContractStateRequest; -} -export interface UseRawContractStateQuery extends VueQueryParams { - request: ReactiveQueryRawContractStateRequest; -} -export interface UseSmartContractStateQuery extends VueQueryParams { - request: ReactiveQuerySmartContractStateRequest; -} -export interface UseCodeQuery extends VueQueryParams { - request: ReactiveQueryCodeRequest; -} -export interface UseCodesQuery extends VueQueryParams { - request?: ReactiveQueryCodesRequest; -} -export interface UseCodeInfoQuery extends VueQueryParams { - request: ReactiveQueryCodeInfoRequest; -} -export interface UsePinnedCodesQuery extends VueQueryParams { - request?: ReactiveQueryPinnedCodesRequest; -} -export interface UseParamsQuery extends VueQueryParams { - request?: ReactiveQueryParamsRequest; -} -export interface UseContractsByCreatorQuery extends VueQueryParams { - request: ReactiveQueryContractsByCreatorRequest; -} -export interface UseWasmLimitsConfigQuery extends VueQueryParams { - request?: ReactiveQueryWasmLimitsConfigRequest; -} -export interface UseBuildAddressQuery extends VueQueryParams { - request: ReactiveQueryBuildAddressRequest; -} -export const useQueryService = (rpc: Ref): ComputedRef => { - const _queryClients = new WeakMap(); - return computed(() => { - if (rpc.value) { - if (_queryClients.has(rpc.value)) { - return _queryClients.get(rpc.value); - } - const queryService = new QueryClientImpl(rpc.value); - _queryClients.set(rpc.value, queryService); - return queryService; - } - }); -}; -export const createRpcQueryHooks = (rpc: Ref) => { - const queryService = useQueryService(rpc); - const useContractInfo = ({ - request, - options - }: UseContractInfoQuery) => { - const queryKey = ["contractInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractInfo(params); - }, - ...options - }); - }; - const useContractHistory = ({ - request, - options - }: UseContractHistoryQuery) => { - const queryKey = ["contractHistoryQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractHistory(params); - }, - ...options - }); - }; - const useContractsByCode = ({ - request, - options - }: UseContractsByCodeQuery) => { - const queryKey = ["contractsByCodeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractsByCode(params); - }, - ...options - }); - }; - const useAllContractState = ({ - request, - options - }: UseAllContractStateQuery) => { - const queryKey = ["allContractStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.allContractState(params); - }, - ...options - }); - }; - const useRawContractState = ({ - request, - options - }: UseRawContractStateQuery) => { - const queryKey = ["rawContractStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.rawContractState(params); - }, - ...options - }); - }; - const useSmartContractState = ({ - request, - options - }: UseSmartContractStateQuery) => { - const queryKey = ["smartContractStateQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.smartContractState(params); - }, - ...options - }); - }; - const useCode = ({ - request, - options - }: UseCodeQuery) => { - const queryKey = ["codeQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.code(params); - }, - ...options - }); - }; - const useCodes = ({ - request, - options - }: UseCodesQuery) => { - const queryKey = ["codesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.codes(params); - }, - ...options - }); - }; - const useCodeInfo = ({ - request, - options - }: UseCodeInfoQuery) => { - const queryKey = ["codeInfoQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.codeInfo(params); - }, - ...options - }); - }; - const usePinnedCodes = ({ - request, - options - }: UsePinnedCodesQuery) => { - const queryKey = ["pinnedCodesQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.pinnedCodes(params); - }, - ...options - }); - }; - const useParams = ({ - request, - options - }: UseParamsQuery) => { - const queryKey = ["paramsQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.params(params); - }, - ...options - }); - }; - const useContractsByCreator = ({ - request, - options - }: UseContractsByCreatorQuery) => { - const queryKey = ["contractsByCreatorQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.contractsByCreator(params); - }, - ...options - }); - }; - const useWasmLimitsConfig = ({ - request, - options - }: UseWasmLimitsConfigQuery) => { - const queryKey = ["wasmLimitsConfigQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.wasmLimitsConfig(params); - }, - ...options - }); - }; - const useBuildAddress = ({ - request, - options - }: UseBuildAddressQuery) => { - const queryKey = ["buildAddressQuery", queryService]; - if (request) { - Object.values(request).forEach((val: any) => { - queryKey.push(val); - }); - } - return useQuery({ - queryKey, - queryFn: () => { - if (!queryService.value) throw new Error("Query Service not initialized"); - let params = ({} as any); - if (request) { - Object.entries(request).forEach(([key, val]) => { - params[key] = val.value; - }); - } - return queryService.value.buildAddress(params); - }, - ...options - }); - }; - return { - /** ContractInfo gets the contract meta data */useContractInfo, - /** ContractHistory gets the contract code history */useContractHistory, - /** ContractsByCode lists all smart contracts for a code id */useContractsByCode, - /** AllContractState gets all raw store data for a single contract */useAllContractState, - /** RawContractState gets single key from the raw store data of a contract */useRawContractState, - /** SmartContractState get smart query result from the contract */useSmartContractState, - /** Code gets the binary code and metadata for a single wasm code */useCode, - /** Codes gets the metadata for all stored wasm codes */useCodes, - /** CodeInfo gets the metadata for a single wasm code */useCodeInfo, - /** PinnedCodes gets the pinned code ids */usePinnedCodes, - /** Params gets the module params */useParams, - /** ContractsByCreator gets the contracts by creator */useContractsByCreator, - /** - * WasmLimitsConfig gets the configured limits for static validation of Wasm - * files, encoded in JSON. - */ - useWasmLimitsConfig, - /** BuildAddress builds a contract address */useBuildAddress - }; -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts new file mode 100644 index 00000000..8a0c89f5 --- /dev/null +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.func.ts @@ -0,0 +1,100 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractInfoRequest.encode, + decode: QueryContractInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractInfo", + clientResolver +}); +export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractHistoryRequest.encode, + decode: QueryContractHistoryResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractHistory", + clientResolver +}); +export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCodeRequest.encode, + decode: QueryContractsByCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCode", + clientResolver +}); +export const createGetAllContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllContractStateRequest.encode, + decode: QueryAllContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "AllContractState", + clientResolver +}); +export const createGetRawContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRawContractStateRequest.encode, + decode: QueryRawContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "RawContractState", + clientResolver +}); +export const createGetSmartContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySmartContractStateRequest.encode, + decode: QuerySmartContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "SmartContractState", + clientResolver +}); +export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeRequest.encode, + decode: QueryCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Code", + clientResolver +}); +export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodesRequest.encode, + decode: QueryCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Codes", + clientResolver +}); +export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeInfoRequest.encode, + decode: QueryCodeInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "CodeInfo", + clientResolver +}); +export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPinnedCodesRequest.encode, + decode: QueryPinnedCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "PinnedCodes", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Params", + clientResolver +}); +export const createGetContractsByCreator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCreatorRequest.encode, + decode: QueryContractsByCreatorResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCreator", + clientResolver +}); +export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmLimitsConfigRequest.encode, + decode: QueryWasmLimitsConfigResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "WasmLimitsConfig", + clientResolver +}); +export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBuildAddressRequest.encode, + decode: QueryBuildAddressResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "BuildAddress", + clientResolver +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts new file mode 100644 index 00000000..d021b1a4 --- /dev/null +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts @@ -0,0 +1,59 @@ +import { buildUseVueQuery } from "../../../vue-query"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +export const useGetContractInfo = buildUseVueQuery({ + builderQueryFn: createGetContractInfo, + queryKeyPrefix: "ContractInfoQuery" +}); +export const useGetContractHistory = buildUseVueQuery({ + builderQueryFn: createGetContractHistory, + queryKeyPrefix: "ContractHistoryQuery" +}); +export const useGetContractsByCode = buildUseVueQuery({ + builderQueryFn: createGetContractsByCode, + queryKeyPrefix: "ContractsByCodeQuery" +}); +export const useGetAllContractState = buildUseVueQuery({ + builderQueryFn: createGetAllContractState, + queryKeyPrefix: "AllContractStateQuery" +}); +export const useGetRawContractState = buildUseVueQuery({ + builderQueryFn: createGetRawContractState, + queryKeyPrefix: "RawContractStateQuery" +}); +export const useGetSmartContractState = buildUseVueQuery({ + builderQueryFn: createGetSmartContractState, + queryKeyPrefix: "SmartContractStateQuery" +}); +export const useGetCode = buildUseVueQuery({ + builderQueryFn: createGetCode, + queryKeyPrefix: "CodeQuery" +}); +export const useGetCodes = buildUseVueQuery({ + builderQueryFn: createGetCodes, + queryKeyPrefix: "CodesQuery" +}); +export const useGetCodeInfo = buildUseVueQuery({ + builderQueryFn: createGetCodeInfo, + queryKeyPrefix: "CodeInfoQuery" +}); +export const useGetPinnedCodes = buildUseVueQuery({ + builderQueryFn: createGetPinnedCodes, + queryKeyPrefix: "PinnedCodesQuery" +}); +export const useGetParams = buildUseVueQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const useGetContractsByCreator = buildUseVueQuery({ + builderQueryFn: createGetContractsByCreator, + queryKeyPrefix: "ContractsByCreatorQuery" +}); +export const useGetWasmLimitsConfig = buildUseVueQuery({ + builderQueryFn: createGetWasmLimitsConfig, + queryKeyPrefix: "WasmLimitsConfigQuery" +}); +export const useGetBuildAddress = buildUseVueQuery({ + builderQueryFn: createGetBuildAddress, + queryKeyPrefix: "BuildAddressQuery" +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.ts index 339f1680..cd8c0b8e 100644 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.ts +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.ts @@ -4,7 +4,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; -import { ComputedRef } from "vue"; /** * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC * method @@ -13,9 +12,6 @@ export interface QueryContractInfoRequest { /** address is the address of the contract to query */ address: string; } -export interface ReactiveQueryContractInfoRequest { - address: ComputedRef; -} export interface QueryContractInfoRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest"; value: Uint8Array; @@ -41,10 +37,6 @@ export interface QueryContractInfoResponse { address: string; contractInfo: ContractInfo; } -export interface ReactiveQueryContractInfoResponse { - address: ComputedRef; - contractInfo: ComputedRef; -} export interface QueryContractInfoResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse"; value: Uint8Array; @@ -72,10 +64,6 @@ export interface QueryContractHistoryRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryContractHistoryRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractHistoryRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest"; value: Uint8Array; @@ -103,10 +91,6 @@ export interface QueryContractHistoryResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryContractHistoryResponse { - entries: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractHistoryResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse"; value: Uint8Array; @@ -134,10 +118,6 @@ export interface QueryContractsByCodeRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryContractsByCodeRequest { - codeId: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCodeRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest"; value: Uint8Array; @@ -166,10 +146,6 @@ export interface QueryContractsByCodeResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryContractsByCodeResponse { - contracts: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse"; value: Uint8Array; @@ -198,10 +174,6 @@ export interface QueryAllContractStateRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryAllContractStateRequest { - address: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest"; value: Uint8Array; @@ -229,10 +201,6 @@ export interface QueryAllContractStateResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryAllContractStateResponse { - models: ComputedRef; - pagination?: ComputedRef; -} export interface QueryAllContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse"; value: Uint8Array; @@ -259,10 +227,6 @@ export interface QueryRawContractStateRequest { address: string; queryData: Uint8Array; } -export interface ReactiveQueryRawContractStateRequest { - address: ComputedRef; - queryData: ComputedRef; -} export interface QueryRawContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest"; value: Uint8Array; @@ -288,9 +252,6 @@ export interface QueryRawContractStateResponse { /** Data contains the raw store data */ data: Uint8Array; } -export interface ReactiveQueryRawContractStateResponse { - data: ComputedRef; -} export interface QueryRawContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse"; value: Uint8Array; @@ -317,10 +278,6 @@ export interface QuerySmartContractStateRequest { /** QueryData contains the query data passed to the contract */ queryData: Uint8Array; } -export interface ReactiveQuerySmartContractStateRequest { - address: ComputedRef; - queryData: ComputedRef; -} export interface QuerySmartContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest"; value: Uint8Array; @@ -347,9 +304,6 @@ export interface QuerySmartContractStateResponse { /** Data contains the json data returned from the smart contract */ data: Uint8Array; } -export interface ReactiveQuerySmartContractStateResponse { - data: ComputedRef; -} export interface QuerySmartContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse"; value: Uint8Array; @@ -371,9 +325,6 @@ export interface QueryCodeRequest { /** grpc-gateway_out does not support Go style CodeID */ codeId: bigint; } -export interface ReactiveQueryCodeRequest { - codeId: ComputedRef; -} export interface QueryCodeRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest"; value: Uint8Array; @@ -392,9 +343,6 @@ export interface QueryCodeInfoRequest { /** grpc-gateway_out does not support Go style CodeID */ codeId: bigint; } -export interface ReactiveQueryCodeInfoRequest { - codeId: ComputedRef; -} export interface QueryCodeInfoRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest"; value: Uint8Array; @@ -415,12 +363,6 @@ export interface QueryCodeInfoResponse { checksum: Uint8Array; instantiatePermission: AccessConfig; } -export interface ReactiveQueryCodeInfoResponse { - codeId: ComputedRef; - creator: ComputedRef; - checksum: ComputedRef; - instantiatePermission: ComputedRef; -} export interface QueryCodeInfoResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse"; value: Uint8Array; @@ -443,12 +385,6 @@ export interface CodeInfoResponse { dataHash: Uint8Array; instantiatePermission: AccessConfig; } -export interface ReactiveCodeInfoResponse { - codeId: ComputedRef; - creator: ComputedRef; - dataHash: ComputedRef; - instantiatePermission: ComputedRef; -} export interface CodeInfoResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse"; value: Uint8Array; @@ -469,10 +405,6 @@ export interface QueryCodeResponse { codeInfo?: CodeInfoResponse; data: Uint8Array; } -export interface ReactiveQueryCodeResponse { - codeInfo?: ComputedRef; - data: ComputedRef; -} export interface QueryCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse"; value: Uint8Array; @@ -491,9 +423,6 @@ export interface QueryCodesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryCodesRequest { - pagination?: ComputedRef; -} export interface QueryCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest"; value: Uint8Array; @@ -513,10 +442,6 @@ export interface QueryCodesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryCodesResponse { - codeInfos: ComputedRef; - pagination?: ComputedRef; -} export interface QueryCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse"; value: Uint8Array; @@ -539,9 +464,6 @@ export interface QueryPinnedCodesRequest { /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryPinnedCodesRequest { - pagination?: ComputedRef; -} export interface QueryPinnedCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest"; value: Uint8Array; @@ -567,10 +489,6 @@ export interface QueryPinnedCodesResponse { /** pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryPinnedCodesResponse { - codeIds: ComputedRef; - pagination?: ComputedRef; -} export interface QueryPinnedCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse"; value: Uint8Array; @@ -590,7 +508,6 @@ export interface QueryPinnedCodesResponseAminoMsg { } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -export interface ReactiveQueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest"; value: Uint8Array; @@ -606,9 +523,6 @@ export interface QueryParamsResponse { /** params defines the parameters of the module. */ params: Params; } -export interface ReactiveQueryParamsResponse { - params: ComputedRef; -} export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse"; value: Uint8Array; @@ -632,10 +546,6 @@ export interface QueryContractsByCreatorRequest { /** Pagination defines an optional pagination for the request. */ pagination?: PageRequest; } -export interface ReactiveQueryContractsByCreatorRequest { - creatorAddress: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCreatorRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest"; value: Uint8Array; @@ -664,10 +574,6 @@ export interface QueryContractsByCreatorResponse { /** Pagination defines the pagination in the response. */ pagination?: PageResponse; } -export interface ReactiveQueryContractsByCreatorResponse { - contractAddresses: ComputedRef; - pagination?: ComputedRef; -} export interface QueryContractsByCreatorResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse"; value: Uint8Array; @@ -691,7 +597,6 @@ export interface QueryContractsByCreatorResponseAminoMsg { * Query/WasmLimitsConfig RPC method. */ export interface QueryWasmLimitsConfigRequest {} -export interface ReactiveQueryWasmLimitsConfigRequest {} export interface QueryWasmLimitsConfigRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest"; value: Uint8Array; @@ -713,9 +618,6 @@ export interface QueryWasmLimitsConfigRequestAminoMsg { export interface QueryWasmLimitsConfigResponse { config: string; } -export interface ReactiveQueryWasmLimitsConfigResponse { - config: ComputedRef; -} export interface QueryWasmLimitsConfigResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse"; value: Uint8Array; @@ -749,12 +651,6 @@ export interface QueryBuildAddressRequest { */ initArgs: Uint8Array; } -export interface ReactiveQueryBuildAddressRequest { - codeHash: ComputedRef; - creatorAddress: ComputedRef; - salt: ComputedRef; - initArgs: ComputedRef; -} export interface QueryBuildAddressRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressRequest"; value: Uint8Array; @@ -788,9 +684,6 @@ export interface QueryBuildAddressResponse { /** Address is the contract address */ address: string; } -export interface ReactiveQueryBuildAddressResponse { - address: ComputedRef; -} export interface QueryBuildAddressResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.amino.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.amino.ts deleted file mode 100644 index bdd72ab7..00000000 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.amino.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; -export const AminoConverter = { - "/cosmwasm.wasm.v1.MsgStoreCode": { - aminoType: "wasm/MsgStoreCode", - toAmino: MsgStoreCode.toAmino, - fromAmino: MsgStoreCode.fromAmino - }, - "/cosmwasm.wasm.v1.MsgInstantiateContract": { - aminoType: "wasm/MsgInstantiateContract", - toAmino: MsgInstantiateContract.toAmino, - fromAmino: MsgInstantiateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgInstantiateContract2": { - aminoType: "wasm/MsgInstantiateContract2", - toAmino: MsgInstantiateContract2.toAmino, - fromAmino: MsgInstantiateContract2.fromAmino - }, - "/cosmwasm.wasm.v1.MsgExecuteContract": { - aminoType: "wasm/MsgExecuteContract", - toAmino: MsgExecuteContract.toAmino, - fromAmino: MsgExecuteContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgMigrateContract": { - aminoType: "wasm/MsgMigrateContract", - toAmino: MsgMigrateContract.toAmino, - fromAmino: MsgMigrateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateAdmin": { - aminoType: "wasm/MsgUpdateAdmin", - toAmino: MsgUpdateAdmin.toAmino, - fromAmino: MsgUpdateAdmin.fromAmino - }, - "/cosmwasm.wasm.v1.MsgClearAdmin": { - aminoType: "wasm/MsgClearAdmin", - toAmino: MsgClearAdmin.toAmino, - fromAmino: MsgClearAdmin.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig": { - aminoType: "wasm/MsgUpdateInstantiateConfig", - toAmino: MsgUpdateInstantiateConfig.toAmino, - fromAmino: MsgUpdateInstantiateConfig.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateParams": { - aminoType: "wasm/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/cosmwasm.wasm.v1.MsgSudoContract": { - aminoType: "wasm/MsgSudoContract", - toAmino: MsgSudoContract.toAmino, - fromAmino: MsgSudoContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgPinCodes": { - aminoType: "wasm/MsgPinCodes", - toAmino: MsgPinCodes.toAmino, - fromAmino: MsgPinCodes.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUnpinCodes": { - aminoType: "wasm/MsgUnpinCodes", - toAmino: MsgUnpinCodes.toAmino, - fromAmino: MsgUnpinCodes.fromAmino - }, - "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract": { - aminoType: "wasm/MsgStoreAndInstantiateContract", - toAmino: MsgStoreAndInstantiateContract.toAmino, - fromAmino: MsgStoreAndInstantiateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses": { - aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", - toAmino: MsgRemoveCodeUploadParamsAddresses.toAmino, - fromAmino: MsgRemoveCodeUploadParamsAddresses.fromAmino - }, - "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses": { - aminoType: "wasm/MsgAddCodeUploadParamsAddresses", - toAmino: MsgAddCodeUploadParamsAddresses.toAmino, - fromAmino: MsgAddCodeUploadParamsAddresses.fromAmino - }, - "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract": { - aminoType: "wasm/MsgStoreAndMigrateContract", - toAmino: MsgStoreAndMigrateContract.toAmino, - fromAmino: MsgStoreAndMigrateContract.fromAmino - }, - "/cosmwasm.wasm.v1.MsgUpdateContractLabel": { - aminoType: "wasm/MsgUpdateContractLabel", - toAmino: MsgUpdateContractLabel.toAmino, - fromAmino: MsgUpdateContractLabel.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts new file mode 100644 index 00000000..61f2ed80 --- /dev/null +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.func.ts @@ -0,0 +1,105 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +export const createStoreCode = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreCode.typeUrl, + encoders: toEncoders(MsgStoreCode), + converters: toConverters(MsgStoreCode) +}); +export const createInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract.typeUrl, + encoders: toEncoders(MsgInstantiateContract), + converters: toConverters(MsgInstantiateContract) +}); +export const createInstantiateContract2 = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract2.typeUrl, + encoders: toEncoders(MsgInstantiateContract2), + converters: toConverters(MsgInstantiateContract2) +}); +export const createExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecuteContract.typeUrl, + encoders: toEncoders(MsgExecuteContract), + converters: toConverters(MsgExecuteContract) +}); +export const createMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMigrateContract.typeUrl, + encoders: toEncoders(MsgMigrateContract), + converters: toConverters(MsgMigrateContract) +}); +export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateAdmin.typeUrl, + encoders: toEncoders(MsgUpdateAdmin), + converters: toConverters(MsgUpdateAdmin) +}); +export const createClearAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgClearAdmin.typeUrl, + encoders: toEncoders(MsgClearAdmin), + converters: toConverters(MsgClearAdmin) +}); +export const createUpdateInstantiateConfig = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateInstantiateConfig.typeUrl, + encoders: toEncoders(MsgUpdateInstantiateConfig), + converters: toConverters(MsgUpdateInstantiateConfig) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createSudoContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSudoContract.typeUrl, + encoders: toEncoders(MsgSudoContract), + converters: toConverters(MsgSudoContract) +}); +export const createPinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPinCodes.typeUrl, + encoders: toEncoders(MsgPinCodes), + converters: toConverters(MsgPinCodes) +}); +export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnpinCodes.typeUrl, + encoders: toEncoders(MsgUnpinCodes), + converters: toConverters(MsgUnpinCodes) +}); +export const createStoreAndInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndInstantiateContract.typeUrl, + encoders: toEncoders(MsgStoreAndInstantiateContract), + converters: toConverters(MsgStoreAndInstantiateContract) +}); +export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRemoveCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgRemoveCodeUploadParamsAddresses), + converters: toConverters(MsgRemoveCodeUploadParamsAddresses) +}); +export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAddCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgAddCodeUploadParamsAddresses), + converters: toConverters(MsgAddCodeUploadParamsAddresses) +}); +export const createStoreAndMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndMigrateContract.typeUrl, + encoders: toEncoders(MsgStoreAndMigrateContract), + converters: toConverters(MsgStoreAndMigrateContract) +}); +export const createUpdateContractLabel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateContractLabel.typeUrl, + encoders: toEncoders(MsgUpdateContractLabel), + converters: toConverters(MsgUpdateContractLabel) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts deleted file mode 100644 index a5181ebb..00000000 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { TxRpc } from "../../../types"; -import { BinaryReader } from "../../../binary"; -import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSudoContract, MsgSudoContractResponse, MsgPinCodes, MsgPinCodesResponse, MsgUnpinCodes, MsgUnpinCodesResponse, MsgStoreAndInstantiateContract, MsgStoreAndInstantiateContractResponse, MsgRemoveCodeUploadParamsAddresses, MsgRemoveCodeUploadParamsAddressesResponse, MsgAddCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddressesResponse, MsgStoreAndMigrateContract, MsgStoreAndMigrateContractResponse, MsgUpdateContractLabel, MsgUpdateContractLabelResponse } from "./tx"; -/** Msg defines the wasm Msg service. */ -export interface Msg { - /** StoreCode to submit Wasm code to the system */ - storeCode(request: MsgStoreCode): Promise; - /** - * InstantiateContract creates a new smart contract instance for the given - * code id. - */ - instantiateContract(request: MsgInstantiateContract): Promise; - /** - * InstantiateContract2 creates a new smart contract instance for the given - * code id with a predictable address - */ - instantiateContract2(request: MsgInstantiateContract2): Promise; - /** Execute submits the given message data to a smart contract */ - 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 */ - 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: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* StoreCode to submit Wasm code to the system */ - storeCode = async (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 BinaryReader(data))); - }; - /* InstantiateContract creates a new smart contract instance for the given - code id. */ - instantiateContract = async (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 BinaryReader(data))); - }; - /* InstantiateContract2 creates a new smart contract instance for the given - code id with a predictable address */ - instantiateContract2 = async (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 BinaryReader(data))); - }; - /* Execute submits the given message data to a smart contract */ - executeContract = async (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 BinaryReader(data))); - }; - /* Migrate runs a code upgrade/ downgrade for a smart contract */ - migrateContract = async (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 BinaryReader(data))); - }; - /* UpdateAdmin sets a new admin for a smart contract */ - updateAdmin = async (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 BinaryReader(data))); - }; - /* ClearAdmin removes any admin stored for a smart contract */ - clearAdmin = async (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 BinaryReader(data))); - }; - /* UpdateInstantiateConfig updates instantiate config for a smart contract */ - updateInstantiateConfig = async (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 BinaryReader(data))); - }; - /* UpdateParams defines a governance operation for updating the x/wasm - module parameters. The authority is defined in the keeper. - - Since: 0.40 */ - updateParams = async (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 BinaryReader(data))); - }; - /* SudoContract defines a governance operation for calling sudo - on a contract. The authority is defined in the keeper. - - Since: 0.40 */ - sudoContract = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* 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 = async (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 BinaryReader(data))); - }; - /* StoreAndInstantiateContract defines a governance operation for storing - and instantiating the contract. The authority is defined in the keeper. - - Since: 0.40 */ - storeAndInstantiateContract = async (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 BinaryReader(data))); - }; - /* RemoveCodeUploadParamsAddresses defines a governance operation for - removing addresses from code upload params. - The authority is defined in the keeper. */ - removeCodeUploadParamsAddresses = async (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 BinaryReader(data))); - }; - /* AddCodeUploadParamsAddresses defines a governance operation for - adding addresses to code upload params. - The authority is defined in the keeper. */ - addCodeUploadParamsAddresses = async (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 BinaryReader(data))); - }; - /* StoreAndMigrateContract defines a governance operation for storing - and migrating the contract. The authority is defined in the keeper. - - Since: 0.42 */ - storeAndMigrateContract = async (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 BinaryReader(data))); - }; - /* UpdateContractLabel sets a new label for a smart contract - - Since: 0.43 */ - updateContractLabel = async (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 BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..9cf6e9ad --- /dev/null +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts @@ -0,0 +1,54 @@ +import { buildUseVueMutation } from "../../../vue-query"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +export const useStoreCode = buildUseVueMutation({ + builderMutationFn: createStoreCode +}); +export const useInstantiateContract = buildUseVueMutation({ + builderMutationFn: createInstantiateContract +}); +export const useInstantiateContract2 = buildUseVueMutation({ + builderMutationFn: createInstantiateContract2 +}); +export const useExecuteContract = buildUseVueMutation({ + builderMutationFn: createExecuteContract +}); +export const useMigrateContract = buildUseVueMutation({ + builderMutationFn: createMigrateContract +}); +export const useUpdateAdmin = buildUseVueMutation({ + builderMutationFn: createUpdateAdmin +}); +export const useClearAdmin = buildUseVueMutation({ + builderMutationFn: createClearAdmin +}); +export const useUpdateInstantiateConfig = buildUseVueMutation({ + builderMutationFn: createUpdateInstantiateConfig +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); +export const useSudoContract = buildUseVueMutation({ + builderMutationFn: createSudoContract +}); +export const usePinCodes = buildUseVueMutation({ + builderMutationFn: createPinCodes +}); +export const useUnpinCodes = buildUseVueMutation({ + builderMutationFn: createUnpinCodes +}); +export const useStoreAndInstantiateContract = buildUseVueMutation({ + builderMutationFn: createStoreAndInstantiateContract +}); +export const useRemoveCodeUploadParamsAddresses = buildUseVueMutation({ + builderMutationFn: createRemoveCodeUploadParamsAddresses +}); +export const useAddCodeUploadParamsAddresses = buildUseVueMutation({ + builderMutationFn: createAddCodeUploadParamsAddresses +}); +export const useStoreAndMigrateContract = buildUseVueMutation({ + builderMutationFn: createStoreAndMigrateContract +}); +export const useUpdateContractLabel = buildUseVueMutation({ + builderMutationFn: createUpdateContractLabel +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.ts index 78684ea0..bf08add4 100644 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.ts +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.ts @@ -4,7 +4,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; -import { ComputedRef } from "vue"; /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCode { /** Sender is the actor that signed the messages */ @@ -17,11 +16,6 @@ export interface MsgStoreCode { */ instantiatePermission?: AccessConfig; } -export interface ReactiveMsgStoreCode { - sender: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; -} export interface MsgStoreCodeProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode"; value: Uint8Array; @@ -49,10 +43,6 @@ export interface MsgStoreCodeResponse { /** Checksum is the sha256 hash of the stored code */ checksum: Uint8Array; } -export interface ReactiveMsgStoreCodeResponse { - codeId: ComputedRef; - checksum: ComputedRef; -} export interface MsgStoreCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse"; value: Uint8Array; @@ -86,14 +76,6 @@ export interface MsgInstantiateContract { /** Funds coins that are transferred to the contract on instantiation */ funds: Coin[]; } -export interface ReactiveMsgInstantiateContract { - sender: ComputedRef; - admin: ComputedRef; - codeId: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; -} export interface MsgInstantiateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract"; value: Uint8Array; @@ -127,10 +109,6 @@ export interface MsgInstantiateContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgInstantiateContractResponse { - address: ComputedRef; - data: ComputedRef; -} export interface MsgInstantiateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; value: Uint8Array; @@ -171,16 +149,6 @@ export interface MsgInstantiateContract2 { */ fixMsg: boolean; } -export interface ReactiveMsgInstantiateContract2 { - sender: ComputedRef; - admin: ComputedRef; - codeId: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; - salt: ComputedRef; - fixMsg: ComputedRef; -} export interface MsgInstantiateContract2ProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2"; value: Uint8Array; @@ -221,10 +189,6 @@ export interface MsgInstantiateContract2Response { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgInstantiateContract2Response { - address: ComputedRef; - data: ComputedRef; -} export interface MsgInstantiateContract2ResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response"; value: Uint8Array; @@ -251,12 +215,6 @@ export interface MsgExecuteContract { /** Funds coins that are transferred to the contract on execution */ funds: Coin[]; } -export interface ReactiveMsgExecuteContract { - sender: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; -} export interface MsgExecuteContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract"; value: Uint8Array; @@ -281,9 +239,6 @@ export interface MsgExecuteContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgExecuteContractResponse { - data: ComputedRef; -} export interface MsgExecuteContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse"; value: Uint8Array; @@ -308,12 +263,6 @@ export interface MsgMigrateContract { /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } -export interface ReactiveMsgMigrateContract { - sender: ComputedRef; - contract: ComputedRef; - codeId: ComputedRef; - msg: ComputedRef; -} export interface MsgMigrateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract"; value: Uint8Array; @@ -341,9 +290,6 @@ export interface MsgMigrateContractResponse { */ data: Uint8Array; } -export interface ReactiveMsgMigrateContractResponse { - data: ComputedRef; -} export interface MsgMigrateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse"; value: Uint8Array; @@ -369,11 +315,6 @@ export interface MsgUpdateAdmin { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveMsgUpdateAdmin { - sender: ComputedRef; - newAdmin: ComputedRef; - contract: ComputedRef; -} export interface MsgUpdateAdminProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin"; value: Uint8Array; @@ -393,7 +334,6 @@ export interface MsgUpdateAdminAminoMsg { } /** MsgUpdateAdminResponse returns empty data */ export interface MsgUpdateAdminResponse {} -export interface ReactiveMsgUpdateAdminResponse {} export interface MsgUpdateAdminResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse"; value: Uint8Array; @@ -411,10 +351,6 @@ export interface MsgClearAdmin { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveMsgClearAdmin { - sender: ComputedRef; - contract: ComputedRef; -} export interface MsgClearAdminProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin"; value: Uint8Array; @@ -432,7 +368,6 @@ export interface MsgClearAdminAminoMsg { } /** MsgClearAdminResponse returns empty data */ export interface MsgClearAdminResponse {} -export interface ReactiveMsgClearAdminResponse {} export interface MsgClearAdminResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse"; value: Uint8Array; @@ -452,11 +387,6 @@ export interface MsgUpdateInstantiateConfig { /** NewInstantiatePermission is the new access control */ newInstantiatePermission?: AccessConfig; } -export interface ReactiveMsgUpdateInstantiateConfig { - sender: ComputedRef; - codeId: ComputedRef; - newInstantiatePermission?: ComputedRef; -} export interface MsgUpdateInstantiateConfigProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig"; value: Uint8Array; @@ -476,7 +406,6 @@ export interface MsgUpdateInstantiateConfigAminoMsg { } /** MsgUpdateInstantiateConfigResponse returns empty data */ export interface MsgUpdateInstantiateConfigResponse {} -export interface ReactiveMsgUpdateInstantiateConfigResponse {} export interface MsgUpdateInstantiateConfigResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse"; value: Uint8Array; @@ -502,10 +431,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams"; value: Uint8Array; @@ -536,7 +461,6 @@ export interface MsgUpdateParamsAminoMsg { * Since: 0.40 */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -565,11 +489,6 @@ export interface MsgSudoContract { /** Msg json encoded message to be passed to the contract as sudo */ msg: Uint8Array; } -export interface ReactiveMsgSudoContract { - authority: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; -} export interface MsgSudoContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract"; value: Uint8Array; @@ -601,9 +520,6 @@ export interface MsgSudoContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgSudoContractResponse { - data: ComputedRef; -} export interface MsgSudoContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse"; value: Uint8Array; @@ -633,10 +549,6 @@ export interface MsgPinCodes { /** CodeIDs references the new WASM codes */ codeIds: bigint[]; } -export interface ReactiveMsgPinCodes { - authority: ComputedRef; - codeIds: ComputedRef; -} export interface MsgPinCodesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes"; value: Uint8Array; @@ -663,7 +575,6 @@ export interface MsgPinCodesAminoMsg { * Since: 0.40 */ export interface MsgPinCodesResponse {} -export interface ReactiveMsgPinCodesResponse {} export interface MsgPinCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse"; value: Uint8Array; @@ -690,10 +601,6 @@ export interface MsgUnpinCodes { /** CodeIDs references the WASM codes */ codeIds: bigint[]; } -export interface ReactiveMsgUnpinCodes { - authority: ComputedRef; - codeIds: ComputedRef; -} export interface MsgUnpinCodesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes"; value: Uint8Array; @@ -720,7 +627,6 @@ export interface MsgUnpinCodesAminoMsg { * Since: 0.40 */ export interface MsgUnpinCodesResponse {} -export interface ReactiveMsgUnpinCodesResponse {} export interface MsgUnpinCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse"; value: Uint8Array; @@ -778,19 +684,6 @@ export interface MsgStoreAndInstantiateContract { */ codeHash: Uint8Array; } -export interface ReactiveMsgStoreAndInstantiateContract { - authority: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; - unpinCode: ComputedRef; - admin: ComputedRef; - label: ComputedRef; - msg: ComputedRef; - funds: ComputedRef; - source: ComputedRef; - builder: ComputedRef; - codeHash: ComputedRef; -} export interface MsgStoreAndInstantiateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract"; value: Uint8Array; @@ -853,10 +746,6 @@ export interface MsgStoreAndInstantiateContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgStoreAndInstantiateContractResponse { - address: ComputedRef; - data: ComputedRef; -} export interface MsgStoreAndInstantiateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse"; value: Uint8Array; @@ -886,10 +775,6 @@ export interface MsgAddCodeUploadParamsAddresses { authority: string; addresses: string[]; } -export interface ReactiveMsgAddCodeUploadParamsAddresses { - authority: ComputedRef; - addresses: ComputedRef; -} export interface MsgAddCodeUploadParamsAddressesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses"; value: Uint8Array; @@ -912,7 +797,6 @@ export interface MsgAddCodeUploadParamsAddressesAminoMsg { * structure for executing a MsgAddCodeUploadParamsAddresses message. */ export interface MsgAddCodeUploadParamsAddressesResponse {} -export interface ReactiveMsgAddCodeUploadParamsAddressesResponse {} export interface MsgAddCodeUploadParamsAddressesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse"; value: Uint8Array; @@ -935,10 +819,6 @@ export interface MsgRemoveCodeUploadParamsAddresses { authority: string; addresses: string[]; } -export interface ReactiveMsgRemoveCodeUploadParamsAddresses { - authority: ComputedRef; - addresses: ComputedRef; -} export interface MsgRemoveCodeUploadParamsAddressesProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses"; value: Uint8Array; @@ -961,7 +841,6 @@ export interface MsgRemoveCodeUploadParamsAddressesAminoMsg { * structure for executing a MsgRemoveCodeUploadParamsAddresses message. */ export interface MsgRemoveCodeUploadParamsAddressesResponse {} -export interface ReactiveMsgRemoveCodeUploadParamsAddressesResponse {} export interface MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse"; value: Uint8Array; @@ -993,13 +872,6 @@ export interface MsgStoreAndMigrateContract { /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } -export interface ReactiveMsgStoreAndMigrateContract { - authority: ComputedRef; - wasmByteCode: ComputedRef; - instantiatePermission?: ComputedRef; - contract: ComputedRef; - msg: ComputedRef; -} export interface MsgStoreAndMigrateContractProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract"; value: Uint8Array; @@ -1040,11 +912,6 @@ export interface MsgStoreAndMigrateContractResponse { /** Data contains bytes to returned from the contract */ data: Uint8Array; } -export interface ReactiveMsgStoreAndMigrateContractResponse { - codeId: ComputedRef; - checksum: ComputedRef; - data: ComputedRef; -} export interface MsgStoreAndMigrateContractResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse"; value: Uint8Array; @@ -1076,11 +943,6 @@ export interface MsgUpdateContractLabel { /** Contract is the address of the smart contract */ contract: string; } -export interface ReactiveMsgUpdateContractLabel { - sender: ComputedRef; - newLabel: ComputedRef; - contract: ComputedRef; -} export interface MsgUpdateContractLabelProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel"; value: Uint8Array; @@ -1100,7 +962,6 @@ export interface MsgUpdateContractLabelAminoMsg { } /** MsgUpdateContractLabelResponse returns empty data */ export interface MsgUpdateContractLabelResponse {} -export interface ReactiveMsgUpdateContractLabelResponse {} export interface MsgUpdateContractLabelResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/types.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/types.ts index f7b43797..3dccb816 100644 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/types.ts +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/types.ts @@ -3,7 +3,6 @@ import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../h import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; -import { ComputedRef } from "vue"; /** AccessType permission types */ export enum AccessType { /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ @@ -104,9 +103,6 @@ export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHisto export interface AccessTypeParam { value: AccessType; } -export interface ReactiveAccessTypeParam { - value: ComputedRef; -} export interface AccessTypeParamProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam"; value: Uint8Array; @@ -124,10 +120,6 @@ export interface AccessConfig { permission: AccessType; addresses: string[]; } -export interface ReactiveAccessConfig { - permission: ComputedRef; - addresses: ComputedRef; -} export interface AccessConfigProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AccessConfig"; value: Uint8Array; @@ -146,10 +138,6 @@ export interface Params { codeUploadAccess: AccessConfig; instantiateDefaultPermission: AccessType; } -export interface ReactiveParams { - codeUploadAccess: ComputedRef; - instantiateDefaultPermission: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/cosmwasm.wasm.v1.Params"; value: Uint8Array; @@ -172,11 +160,6 @@ export interface CodeInfo { /** InstantiateConfig access control to apply on contract creation, optional */ instantiateConfig: AccessConfig; } -export interface ReactiveCodeInfo { - codeHash: ComputedRef; - creator: ComputedRef; - instantiateConfig: ComputedRef; -} export interface CodeInfoProtoMsg { typeUrl: "/cosmwasm.wasm.v1.CodeInfo"; value: Uint8Array; @@ -213,15 +196,6 @@ export interface ContractInfo { */ extension?: Any | undefined; } -export interface ReactiveContractInfo { - codeId: ComputedRef; - creator: ComputedRef; - admin: ComputedRef; - label: ComputedRef; - created?: ComputedRef; - ibcPortId: ComputedRef; - extension?: ComputedRef; -} export interface ContractInfoProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; value: Uint8Array; @@ -265,12 +239,6 @@ export interface ContractCodeHistoryEntry { updated?: AbsoluteTxPosition; msg: Uint8Array; } -export interface ReactiveContractCodeHistoryEntry { - operation: ComputedRef; - codeId: ComputedRef; - updated?: ComputedRef; - msg: ComputedRef; -} export interface ContractCodeHistoryEntryProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry"; value: Uint8Array; @@ -301,10 +269,6 @@ export interface AbsoluteTxPosition { */ txIndex: bigint; } -export interface ReactiveAbsoluteTxPosition { - blockHeight: ComputedRef; - txIndex: ComputedRef; -} export interface AbsoluteTxPositionProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition"; value: Uint8Array; @@ -333,10 +297,6 @@ export interface Model { /** base64-encode raw value */ value: Uint8Array; } -export interface ReactiveModel { - key: ComputedRef; - value: ComputedRef; -} export interface ModelProtoMsg { typeUrl: "/cosmwasm.wasm.v1.Model"; value: Uint8Array; diff --git a/libs/interchain-vue/src/extern.ts b/libs/interchain-vue/src/extern.ts index 5127cb14..eddf067e 100644 --- a/libs/interchain-vue/src/extern.ts +++ b/libs/interchain-vue/src/extern.ts @@ -1,13 +1,17 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from '@cosmjs/stargate' -import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -const _rpcClients: Record = {}; +import { HttpEndpoint } from "@interchainjs/types"; +import { + createQueryRpc, +} from '@interchainjs/cosmos/utils'; +import { Rpc } from "./helpers"; + +const _rpcClients: Record = {}; export const getRpcEndpointKey = (rpcEndpoint: string | HttpEndpoint) => { if (typeof rpcEndpoint === 'string') { @@ -24,10 +28,11 @@ export const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { if (_rpcClients.hasOwnProperty(key)) { return _rpcClients[key]; } - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - //@ts-ignore - const client = new QueryClient(tmClient); - const rpc = createProtobufRpcClient(client); + const rpc = await createRpcClient(rpcEndpoint); _rpcClients[key] = rpc; return rpc; } + +export const createRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { + return createQueryRpc(rpcEndpoint) +} diff --git a/libs/interchain-vue/src/google/api/http.ts b/libs/interchain-vue/src/google/api/http.ts index c8597db5..3fd3a11b 100644 --- a/libs/interchain-vue/src/google/api/http.ts +++ b/libs/interchain-vue/src/google/api/http.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * 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 @@ -24,10 +23,6 @@ export interface Http { */ fullyDecodeReservedExpansion: boolean; } -export interface ReactiveHttp { - rules: ComputedRef; - fullyDecodeReservedExpansion: ComputedRef; -} export interface HttpProtoMsg { typeUrl: "/google.api.Http"; value: Uint8Array; @@ -377,18 +372,6 @@ export interface HttpRule { */ additionalBindings: HttpRule[]; } -export interface ReactiveHttpRule { - selector: ComputedRef; - get?: ComputedRef; - put?: ComputedRef; - post?: ComputedRef; - delete?: ComputedRef; - patch?: ComputedRef; - custom?: ComputedRef; - body: ComputedRef; - responseBody: ComputedRef; - additionalBindings: ComputedRef; -} export interface HttpRuleProtoMsg { typeUrl: "/google.api.HttpRule"; value: Uint8Array; @@ -723,10 +706,6 @@ export interface CustomHttpPattern { /** The path matched by this custom verb. */ path: string; } -export interface ReactiveCustomHttpPattern { - kind: ComputedRef; - path: ComputedRef; -} export interface CustomHttpPatternProtoMsg { typeUrl: "/google.api.CustomHttpPattern"; value: Uint8Array; diff --git a/libs/interchain-vue/src/google/protobuf/any.ts b/libs/interchain-vue/src/google/protobuf/any.ts index 2dd5ed96..bbae1be1 100644 --- a/libs/interchain-vue/src/google/protobuf/any.ts +++ b/libs/interchain-vue/src/google/protobuf/any.ts @@ -1,6 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; -import { ComputedRef } from "vue"; /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. @@ -123,10 +122,6 @@ export interface Any { /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -export interface ReactiveAny { - typeUrl: ComputedRef; - value: ComputedRef; -} export interface AnyProtoMsg { typeUrl: "/google.protobuf.Any"; value: Uint8Array; diff --git a/libs/interchain-vue/src/google/protobuf/descriptor.ts b/libs/interchain-vue/src/google/protobuf/descriptor.ts index 911b9611..53b60923 100644 --- a/libs/interchain-vue/src/google/protobuf/descriptor.ts +++ b/libs/interchain-vue/src/google/protobuf/descriptor.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** The full set of known editions. */ export enum Edition { /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ @@ -917,9 +916,6 @@ export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCod export interface FileDescriptorSet { file: FileDescriptorProto[]; } -export interface ReactiveFileDescriptorSet { - file: ComputedRef; -} export interface FileDescriptorSetProtoMsg { typeUrl: "/google.protobuf.FileDescriptorSet"; value: Uint8Array; @@ -981,21 +977,6 @@ export interface FileDescriptorProto { */ edition: Edition; } -export interface ReactiveFileDescriptorProto { - name: ComputedRef; - package: ComputedRef; - dependency: ComputedRef; - publicDependency: ComputedRef; - weakDependency: ComputedRef; - messageType: ComputedRef; - enumType: ComputedRef; - service: ComputedRef; - extension: ComputedRef; - options?: ComputedRef; - sourceCodeInfo?: ComputedRef; - syntax: ComputedRef; - edition: ComputedRef; -} export interface FileDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.FileDescriptorProto"; value: Uint8Array; @@ -1067,18 +1048,6 @@ export interface DescriptorProto { */ reservedName: string[]; } -export interface ReactiveDescriptorProto { - name: ComputedRef; - field: ComputedRef; - extension: ComputedRef; - nestedType: ComputedRef; - enumType: ComputedRef; - extensionRange: ComputedRef; - oneofDecl: ComputedRef; - options?: ComputedRef; - reservedRange: ComputedRef; - reservedName: ComputedRef; -} export interface DescriptorProtoProtoMsg { typeUrl: "/google.protobuf.DescriptorProto"; value: Uint8Array; @@ -1111,11 +1080,6 @@ export interface DescriptorProto_ExtensionRange { end: number; options?: ExtensionRangeOptions; } -export interface ReactiveDescriptorProto_ExtensionRange { - start: ComputedRef; - end: ComputedRef; - options?: ComputedRef; -} export interface DescriptorProto_ExtensionRangeProtoMsg { typeUrl: "/google.protobuf.ExtensionRange"; value: Uint8Array; @@ -1142,10 +1106,6 @@ export interface DescriptorProto_ReservedRange { /** Exclusive. */ end: number; } -export interface ReactiveDescriptorProto_ReservedRange { - start: ComputedRef; - end: ComputedRef; -} export interface DescriptorProto_ReservedRangeProtoMsg { typeUrl: "/google.protobuf.ReservedRange"; value: Uint8Array; @@ -1183,12 +1143,6 @@ export interface ExtensionRangeOptions { */ verification: ExtensionRangeOptions_VerificationState; } -export interface ReactiveExtensionRangeOptions { - uninterpretedOption: ComputedRef; - declaration: ComputedRef; - features?: ComputedRef; - verification: ComputedRef; -} export interface ExtensionRangeOptionsProtoMsg { typeUrl: "/google.protobuf.ExtensionRangeOptions"; value: Uint8Array; @@ -1241,13 +1195,6 @@ export interface ExtensionRangeOptions_Declaration { */ repeated: boolean; } -export interface ReactiveExtensionRangeOptions_Declaration { - number: ComputedRef; - fullName: ComputedRef; - type: ComputedRef; - reserved: ComputedRef; - repeated: ComputedRef; -} export interface ExtensionRangeOptions_DeclarationProtoMsg { typeUrl: "/google.protobuf.Declaration"; value: Uint8Array; @@ -1350,19 +1297,6 @@ export interface FieldDescriptorProto { */ proto3Optional: boolean; } -export interface ReactiveFieldDescriptorProto { - name: ComputedRef; - number: ComputedRef; - label: ComputedRef; - type: ComputedRef; - typeName: ComputedRef; - extendee: ComputedRef; - defaultValue: ComputedRef; - oneofIndex: ComputedRef; - jsonName: ComputedRef; - options?: ComputedRef; - proto3Optional: ComputedRef; -} export interface FieldDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.FieldDescriptorProto"; value: Uint8Array; @@ -1444,10 +1378,6 @@ export interface OneofDescriptorProto { name: string; options?: OneofOptions; } -export interface ReactiveOneofDescriptorProto { - name: ComputedRef; - options?: ComputedRef; -} export interface OneofDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.OneofDescriptorProto"; value: Uint8Array; @@ -1478,13 +1408,6 @@ export interface EnumDescriptorProto { */ reservedName: string[]; } -export interface ReactiveEnumDescriptorProto { - name: ComputedRef; - value: ComputedRef; - options?: ComputedRef; - reservedRange: ComputedRef; - reservedName: ComputedRef; -} export interface EnumDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.EnumDescriptorProto"; value: Uint8Array; @@ -1524,10 +1447,6 @@ export interface EnumDescriptorProto_EnumReservedRange { /** Inclusive. */ end: number; } -export interface ReactiveEnumDescriptorProto_EnumReservedRange { - start: ComputedRef; - end: ComputedRef; -} export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { typeUrl: "/google.protobuf.EnumReservedRange"; value: Uint8Array; @@ -1556,11 +1475,6 @@ export interface EnumValueDescriptorProto { number: number; options?: EnumValueOptions; } -export interface ReactiveEnumValueDescriptorProto { - name: ComputedRef; - number: ComputedRef; - options?: ComputedRef; -} export interface EnumValueDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.EnumValueDescriptorProto"; value: Uint8Array; @@ -1581,11 +1495,6 @@ export interface ServiceDescriptorProto { method: MethodDescriptorProto[]; options?: ServiceOptions; } -export interface ReactiveServiceDescriptorProto { - name: ComputedRef; - method: ComputedRef; - options?: ComputedRef; -} export interface ServiceDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.ServiceDescriptorProto"; value: Uint8Array; @@ -1615,14 +1524,6 @@ export interface MethodDescriptorProto { /** Identifies if server streams multiple server messages */ serverStreaming: boolean; } -export interface ReactiveMethodDescriptorProto { - name: ComputedRef; - inputType: ComputedRef; - outputType: ComputedRef; - options?: ComputedRef; - clientStreaming: ComputedRef; - serverStreaming: ComputedRef; -} export interface MethodDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.MethodDescriptorProto"; value: Uint8Array; @@ -1773,29 +1674,6 @@ export interface FileOptions { */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveFileOptions { - javaPackage: ComputedRef; - javaOuterClassname: ComputedRef; - javaMultipleFiles: ComputedRef; - javaGenerateEqualsAndHash: ComputedRef; - javaStringCheckUtf8: ComputedRef; - optimizeFor: ComputedRef; - goPackage: ComputedRef; - ccGenericServices: ComputedRef; - javaGenericServices: ComputedRef; - pyGenericServices: ComputedRef; - deprecated: ComputedRef; - ccEnableArenas: ComputedRef; - objcClassPrefix: ComputedRef; - csharpNamespace: ComputedRef; - swiftPrefix: ComputedRef; - phpClassPrefix: ComputedRef; - phpNamespace: ComputedRef; - phpMetadataNamespace: ComputedRef; - rubyPackage: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface FileOptionsProtoMsg { typeUrl: "/google.protobuf.FileOptions"; value: Uint8Array; @@ -2014,15 +1892,6 @@ export interface MessageOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveMessageOptions { - messageSetWireFormat: ComputedRef; - noStandardDescriptorAccessor: ComputedRef; - deprecated: ComputedRef; - mapEntry: ComputedRef; - deprecatedLegacyJsonFieldConflicts: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface MessageOptionsProtoMsg { typeUrl: "/google.protobuf.MessageOptions"; value: Uint8Array; @@ -2208,22 +2077,6 @@ export interface FieldOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveFieldOptions { - ctype: ComputedRef; - packed: ComputedRef; - jstype: ComputedRef; - lazy: ComputedRef; - unverifiedLazy: ComputedRef; - deprecated: ComputedRef; - weak: ComputedRef; - debugRedact: ComputedRef; - retention: ComputedRef; - targets: ComputedRef; - editionDefaults: ComputedRef; - features?: ComputedRef; - featureSupport?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface FieldOptionsProtoMsg { typeUrl: "/google.protobuf.FieldOptions"; value: Uint8Array; @@ -2331,10 +2184,6 @@ export interface FieldOptions_EditionDefault { /** Textproto value. */ value: string; } -export interface ReactiveFieldOptions_EditionDefault { - edition: ComputedRef; - value: ComputedRef; -} export interface FieldOptions_EditionDefaultProtoMsg { typeUrl: "/google.protobuf.EditionDefault"; value: Uint8Array; @@ -2373,12 +2222,6 @@ export interface FieldOptions_FeatureSupport { */ editionRemoved: Edition; } -export interface ReactiveFieldOptions_FeatureSupport { - editionIntroduced: ComputedRef; - editionDeprecated: ComputedRef; - deprecationWarning: ComputedRef; - editionRemoved: ComputedRef; -} export interface FieldOptions_FeatureSupportProtoMsg { typeUrl: "/google.protobuf.FeatureSupport"; value: Uint8Array; @@ -2423,10 +2266,6 @@ export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveOneofOptions { - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface OneofOptionsProtoMsg { typeUrl: "/google.protobuf.OneofOptions"; value: Uint8Array; @@ -2479,13 +2318,6 @@ export interface EnumOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveEnumOptions { - allowAlias: ComputedRef; - deprecated: ComputedRef; - deprecatedLegacyJsonFieldConflicts: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface EnumOptionsProtoMsg { typeUrl: "/google.protobuf.EnumOptions"; value: Uint8Array; @@ -2553,13 +2385,6 @@ export interface EnumValueOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveEnumValueOptions { - deprecated: ComputedRef; - features?: ComputedRef; - debugRedact: ComputedRef; - featureSupport?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface EnumValueOptionsProtoMsg { typeUrl: "/google.protobuf.EnumValueOptions"; value: Uint8Array; @@ -2612,11 +2437,6 @@ export interface ServiceOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveServiceOptions { - features?: ComputedRef; - deprecated: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface ServiceOptionsProtoMsg { typeUrl: "/google.protobuf.ServiceOptions"; value: Uint8Array; @@ -2662,12 +2482,6 @@ export interface MethodOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -export interface ReactiveMethodOptions { - deprecated: ComputedRef; - idempotencyLevel: ComputedRef; - features?: ComputedRef; - uninterpretedOption: ComputedRef; -} export interface MethodOptionsProtoMsg { typeUrl: "/google.protobuf.MethodOptions"; value: Uint8Array; @@ -2716,15 +2530,6 @@ export interface UninterpretedOption { stringValue: Uint8Array; aggregateValue: string; } -export interface ReactiveUninterpretedOption { - name: ComputedRef; - identifierValue: ComputedRef; - positiveIntValue: ComputedRef; - negativeIntValue: ComputedRef; - doubleValue: ComputedRef; - stringValue: ComputedRef; - aggregateValue: ComputedRef; -} export interface UninterpretedOptionProtoMsg { typeUrl: "/google.protobuf.UninterpretedOption"; value: Uint8Array; @@ -2765,10 +2570,6 @@ export interface UninterpretedOption_NamePart { namePart: string; isExtension: boolean; } -export interface ReactiveUninterpretedOption_NamePart { - namePart: ComputedRef; - isExtension: ComputedRef; -} export interface UninterpretedOption_NamePartProtoMsg { typeUrl: "/google.protobuf.NamePart"; value: Uint8Array; @@ -2804,14 +2605,6 @@ export interface FeatureSet { messageEncoding: FeatureSet_MessageEncoding; jsonFormat: FeatureSet_JsonFormat; } -export interface ReactiveFeatureSet { - fieldPresence: ComputedRef; - enumType: ComputedRef; - repeatedFieldEncoding: ComputedRef; - utf8Validation: ComputedRef; - messageEncoding: ComputedRef; - jsonFormat: ComputedRef; -} export interface FeatureSetProtoMsg { typeUrl: "/google.protobuf.FeatureSet"; value: Uint8Array; @@ -2855,11 +2648,6 @@ export interface FeatureSetDefaults { */ maximumEdition: Edition; } -export interface ReactiveFeatureSetDefaults { - defaults: ComputedRef; - minimumEdition: ComputedRef; - maximumEdition: ComputedRef; -} export interface FeatureSetDefaultsProtoMsg { typeUrl: "/google.protobuf.FeatureSetDefaults"; value: Uint8Array; @@ -2900,11 +2688,6 @@ export interface FeatureSetDefaults_FeatureSetEditionDefault { /** Defaults of features that can't be overridden in this edition. */ fixedFeatures?: FeatureSet; } -export interface ReactiveFeatureSetDefaults_FeatureSetEditionDefault { - edition: ComputedRef; - overridableFeatures?: ComputedRef; - fixedFeatures?: ComputedRef; -} export interface FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg { typeUrl: "/google.protobuf.FeatureSetEditionDefault"; value: Uint8Array; @@ -2978,9 +2761,6 @@ export interface SourceCodeInfo { */ location: SourceCodeInfo_Location[]; } -export interface ReactiveSourceCodeInfo { - location: ComputedRef; -} export interface SourceCodeInfoProtoMsg { typeUrl: "/google.protobuf.SourceCodeInfo"; value: Uint8Array; @@ -3129,13 +2909,6 @@ export interface SourceCodeInfo_Location { trailingComments: string; leadingDetachedComments: string[]; } -export interface ReactiveSourceCodeInfo_Location { - path: ComputedRef; - span: ComputedRef; - leadingComments: ComputedRef; - trailingComments: ComputedRef; - leadingDetachedComments: ComputedRef; -} export interface SourceCodeInfo_LocationProtoMsg { typeUrl: "/google.protobuf.Location"; value: Uint8Array; @@ -3244,9 +3017,6 @@ export interface GeneratedCodeInfo { */ annotation: GeneratedCodeInfo_Annotation[]; } -export interface ReactiveGeneratedCodeInfo { - annotation: ComputedRef; -} export interface GeneratedCodeInfoProtoMsg { typeUrl: "/google.protobuf.GeneratedCodeInfo"; value: Uint8Array; @@ -3288,13 +3058,6 @@ export interface GeneratedCodeInfo_Annotation { end: number; semantic: GeneratedCodeInfo_Annotation_Semantic; } -export interface ReactiveGeneratedCodeInfo_Annotation { - path: ComputedRef; - sourceFile: ComputedRef; - begin: ComputedRef; - end: ComputedRef; - semantic: ComputedRef; -} export interface GeneratedCodeInfo_AnnotationProtoMsg { typeUrl: "/google.protobuf.Annotation"; value: Uint8Array; diff --git a/libs/interchain-vue/src/google/protobuf/duration.ts b/libs/interchain-vue/src/google/protobuf/duration.ts index d6a10825..6e3e301a 100644 --- a/libs/interchain-vue/src/google/protobuf/duration.ts +++ b/libs/interchain-vue/src/google/protobuf/duration.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * A Duration represents a signed, fixed-length span of time represented * as a count of seconds and fractions of seconds at nanosecond @@ -79,10 +78,6 @@ export interface Duration { */ nanos: number; } -export interface ReactiveDuration { - seconds: ComputedRef; - nanos: ComputedRef; -} export interface DurationProtoMsg { typeUrl: "/google.protobuf.Duration"; value: Uint8Array; diff --git a/libs/interchain-vue/src/google/protobuf/timestamp.ts b/libs/interchain-vue/src/google/protobuf/timestamp.ts index 31822c7a..d4d255b3 100644 --- a/libs/interchain-vue/src/google/protobuf/timestamp.ts +++ b/libs/interchain-vue/src/google/protobuf/timestamp.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, fromJsonTimestamp, fromTimestamp } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * 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 @@ -108,10 +107,6 @@ export interface Timestamp { */ nanos: number; } -export interface ReactiveTimestamp { - seconds: ComputedRef; - nanos: ComputedRef; -} export interface TimestampProtoMsg { typeUrl: "/google.protobuf.Timestamp"; value: Uint8Array; diff --git a/libs/interchain-vue/src/helper-func-types.ts b/libs/interchain-vue/src/helper-func-types.ts new file mode 100644 index 00000000..4f82736b --- /dev/null +++ b/libs/interchain-vue/src/helper-func-types.ts @@ -0,0 +1,191 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +import { HttpEndpoint } from "@interchainjs/types"; +import { BinaryReader, BinaryWriter } from "./binary"; +import { getRpcClient } from "./extern"; +import { isRpc, Rpc } from "./helpers"; + +export interface QueryBuilderOptions { + encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter + decode: (input: BinaryReader | Uint8Array, length?: number) => TRes + service: string, + method: string, + clientResolver?: RpcResolver +} + +export function buildQuery(opts: QueryBuilderOptions) { + return async (request: TReq) => { + let rpc: Rpc | undefined; + + if(isRpc(opts.clientResolver)) { + rpc = opts.clientResolver; + } else { + rpc = opts.clientResolver ? await getRpcClient(opts.clientResolver) : undefined; + } + + if (!rpc) throw new Error("Query Rpc is not initialized"); + + const data = opts.encode(request).finish(); + const response = await rpc.request(opts.service, opts.method, data); + return opts.decode(response); + }; +} + +export interface ITxArgs { + signerAddress: string; + message: TMsg | TMsg[]; + fee: StdFee | 'auto'; + memo: string; +} + +export function isISigningClient(client: unknown): client is ISigningClient { + return client !== null && client !== undefined + && typeof (client as ISigningClient).signAndBroadcast === 'function' + && typeof (client as ISigningClient).addConverters === 'function' + && typeof (client as ISigningClient).addEncoders === 'function'; +} + +export interface ISigningClient { + /** + * register converters + */ + addConverters: (converters: AminoConverter[]) => void; + /** + * register encoders + */ + addEncoders: (encoders: Encoder[]) => void; + + signAndBroadcast: ( + signerAddress: string, + message: Message[], + fee: StdFee | 'auto', + memo: string + ) => Promise; +} + +export interface TxBuilderOptions { + clientResolver?: SigningClientResolver, + typeUrl: string, + encoders?: Encoder[], + converters?: AminoConverter[], +} + +export function buildTx(opts: TxBuilderOptions) { + return async ( + signerAddress: string, + message: TMsg | TMsg[], + fee: StdFee | 'auto', + memo: string + ): Promise => { + let client: ISigningClient | undefined; + + // if opts.getSigningClient is a function, call it to get the SigningClient instance + if(isISigningClient(opts.clientResolver)) { + client = opts.clientResolver; + } + + if (!client) throw new Error("SigningClient is not initialized"); + + //register all related encoders and converters + client.addEncoders(opts.encoders ?? []); + client.addConverters(opts.converters ?? []); + + const data = [ + { + typeUrl: opts.typeUrl, + value: message, + }, + ]; + return client.signAndBroadcast!(signerAddress, data, fee, memo); + }; +} + +export interface Coin { + denom: string; + amount: string; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +export interface Message { + typeUrl: string; + value: T; +} + +export interface Encoder { + typeUrl: string; + fromPartial: (data: any) => any; + encode: (data: any) => Uint8Array; +} + +export interface AminoConverter { + typeUrl: string; + aminoType: string; + fromAmino: (data: any) => any; + toAmino: (data: any) => any; +} + +export type SigningClientResolver = string | HttpEndpoint | ISigningClient; +export type RpcResolver = string | HttpEndpoint | Rpc ; diff --git a/libs/interchain-vue/src/helpers.ts b/libs/interchain-vue/src/helpers.ts index 64d3444c..ba68bbdb 100644 --- a/libs/interchain-vue/src/helpers.ts +++ b/libs/interchain-vue/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/ibc/applications/transfer/v1/transfer.ts b/libs/interchain-vue/src/ibc/applications/transfer/v1/transfer.ts index 1b156e21..12d6526c 100644 --- a/libs/interchain-vue/src/ibc/applications/transfer/v1/transfer.ts +++ b/libs/interchain-vue/src/ibc/applications/transfer/v1/transfer.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * Params defines the set of IBC transfer parameters. * NOTE: To prevent a single token from being transferred, set the @@ -20,10 +19,6 @@ export interface Params { */ receiveEnabled: boolean; } -export interface ReactiveParams { - sendEnabled: ComputedRef; - receiveEnabled: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Params"; value: Uint8Array; @@ -61,10 +56,6 @@ export interface Forwarding { /** optional intermediate path through which packet will be forwarded */ hops: Hop[]; } -export interface ReactiveForwarding { - unwind: ComputedRef; - hops: ComputedRef; -} export interface ForwardingProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Forwarding"; value: Uint8Array; @@ -92,10 +83,6 @@ export interface Hop { portId: string; channelId: string; } -export interface ReactiveHop { - portId: ComputedRef; - channelId: ComputedRef; -} export interface HopProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Hop"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.amino.ts b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.amino.ts deleted file mode 100644 index 0ebb51c7..00000000 --- a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.amino.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MsgTransfer, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/ibc.applications.transfer.v1.MsgTransfer": { - aminoType: "cosmos-sdk/MsgTransfer", - toAmino: MsgTransfer.toAmino, - fromAmino: MsgTransfer.fromAmino - }, - "/ibc.applications.transfer.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts new file mode 100644 index 00000000..72028384 --- /dev/null +++ b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +export const createTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransfer.typeUrl, + encoders: toEncoders(MsgTransfer), + converters: toConverters(MsgTransfer) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts deleted file mode 100644 index 228d27d9..00000000 --- a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgTransfer, MsgTransferResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** Msg defines the ibc/transfer Msg service. */ -export interface Msg { - /** Transfer defines a rpc handler method for MsgTransfer. */ - transfer(request: MsgTransfer): Promise; - /** UpdateParams defines a rpc handler for MsgUpdateParams. */ - updateParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* Transfer defines a rpc handler method for MsgTransfer. */ - transfer = async (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 BinaryReader(data))); - }; - /* UpdateParams defines a rpc handler for MsgUpdateParams. */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..ab0c0e79 --- /dev/null +++ b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts @@ -0,0 +1,9 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +export const useTransfer = buildUseVueMutation({ + builderMutationFn: createTransfer +}); +export const useUpdateParams = buildUseVueMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.ts b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.ts index 756b7b69..e3be1579 100644 --- a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.ts +++ b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.ts @@ -4,7 +4,6 @@ import { Forwarding, ForwardingAmino } from "./transfer"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between * ICS20 enabled chains. See ICS Spec here: @@ -39,18 +38,6 @@ export interface MsgTransfer { /** optional forwarding information */ forwarding?: Forwarding; } -export interface ReactiveMsgTransfer { - sourcePort: ComputedRef; - sourceChannel: ComputedRef; - token: ComputedRef; - sender: ComputedRef; - receiver: ComputedRef; - timeoutHeight: ComputedRef; - timeoutTimestamp: ComputedRef; - memo: ComputedRef; - tokens: ComputedRef; - forwarding?: ComputedRef; -} export interface MsgTransferProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer"; value: Uint8Array; @@ -98,9 +85,6 @@ export interface MsgTransferResponse { /** sequence number of the transfer packet sent */ sequence: bigint; } -export interface ReactiveMsgTransferResponse { - sequence: ComputedRef; -} export interface MsgTransferResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse"; value: Uint8Array; @@ -125,10 +109,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - signer: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams"; value: Uint8Array; @@ -153,7 +133,6 @@ export interface MsgUpdateParamsAminoMsg { * MsgUpdateParams message. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/channel.ts b/libs/interchain-vue/src/ibc/core/channel/v1/channel.ts index 74813efd..6965c083 100644 --- a/libs/interchain-vue/src/ibc/core/channel/v1/channel.ts +++ b/libs/interchain-vue/src/ibc/core/channel/v1/channel.ts @@ -2,7 +2,6 @@ import { Height, HeightAmino } from "../../client/v1/client"; import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * State defines if a channel is in one of the following states: * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. @@ -150,14 +149,6 @@ export interface Channel { */ upgradeSequence: bigint; } -export interface ReactiveChannel { - state: ComputedRef; - ordering: ComputedRef; - counterparty: ComputedRef; - connectionHops: ComputedRef; - version: ComputedRef; - upgradeSequence: ComputedRef; -} export interface ChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.Channel"; value: Uint8Array; @@ -219,16 +210,6 @@ export interface IdentifiedChannel { */ upgradeSequence: bigint; } -export interface ReactiveIdentifiedChannel { - state: ComputedRef; - ordering: ComputedRef; - counterparty: ComputedRef; - connectionHops: ComputedRef; - version: ComputedRef; - portId: ComputedRef; - channelId: ComputedRef; - upgradeSequence: ComputedRef; -} export interface IdentifiedChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.IdentifiedChannel"; value: Uint8Array; @@ -272,10 +253,6 @@ export interface Counterparty { /** channel end on the counterparty chain */ channelId: string; } -export interface ReactiveCounterparty { - portId: ComputedRef; - channelId: ComputedRef; -} export interface CounterpartyProtoMsg { typeUrl: "/ibc.core.channel.v1.Counterparty"; value: Uint8Array; @@ -314,16 +291,6 @@ export interface Packet { /** block timestamp (in nanoseconds) after which the packet times out */ timeoutTimestamp: bigint; } -export interface ReactivePacket { - sequence: ComputedRef; - sourcePort: ComputedRef; - sourceChannel: ComputedRef; - destinationPort: ComputedRef; - destinationChannel: ComputedRef; - data: ComputedRef; - timeoutHeight: ComputedRef; - timeoutTimestamp: ComputedRef; -} export interface PacketProtoMsg { typeUrl: "/ibc.core.channel.v1.Packet"; value: Uint8Array; @@ -371,12 +338,6 @@ export interface PacketState { /** embedded data that represents packet state. */ data: Uint8Array; } -export interface ReactivePacketState { - portId: ComputedRef; - channelId: ComputedRef; - sequence: ComputedRef; - data: ComputedRef; -} export interface PacketStateProtoMsg { typeUrl: "/ibc.core.channel.v1.PacketState"; value: Uint8Array; @@ -414,11 +375,6 @@ export interface PacketId { /** packet sequence */ sequence: bigint; } -export interface ReactivePacketId { - portId: ComputedRef; - channelId: ComputedRef; - sequence: ComputedRef; -} export interface PacketIdProtoMsg { typeUrl: "/ibc.core.channel.v1.PacketId"; value: Uint8Array; @@ -453,10 +409,6 @@ export interface Acknowledgement { result?: Uint8Array; error?: string; } -export interface ReactiveAcknowledgement { - result?: ComputedRef; - error?: ComputedRef; -} export interface AcknowledgementProtoMsg { typeUrl: "/ibc.core.channel.v1.Acknowledgement"; value: Uint8Array; @@ -489,10 +441,6 @@ export interface Timeout { /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ timestamp: bigint; } -export interface ReactiveTimeout { - height: ComputedRef; - timestamp: ComputedRef; -} export interface TimeoutProtoMsg { typeUrl: "/ibc.core.channel.v1.Timeout"; value: Uint8Array; @@ -517,9 +465,6 @@ export interface Params { /** the relative timeout after which channel upgrades will time out. */ upgradeTimeout: Timeout; } -export interface ReactiveParams { - upgradeTimeout: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.core.channel.v1.Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/tx.amino.ts b/libs/interchain-vue/src/ibc/core/channel/v1/tx.amino.ts deleted file mode 100644 index fb58cb04..00000000 --- a/libs/interchain-vue/src/ibc/core/channel/v1/tx.amino.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; -export const AminoConverter = { - "/ibc.core.channel.v1.MsgChannelOpenInit": { - aminoType: "cosmos-sdk/MsgChannelOpenInit", - toAmino: MsgChannelOpenInit.toAmino, - fromAmino: MsgChannelOpenInit.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelOpenTry": { - aminoType: "cosmos-sdk/MsgChannelOpenTry", - toAmino: MsgChannelOpenTry.toAmino, - fromAmino: MsgChannelOpenTry.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelOpenAck": { - aminoType: "cosmos-sdk/MsgChannelOpenAck", - toAmino: MsgChannelOpenAck.toAmino, - fromAmino: MsgChannelOpenAck.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelOpenConfirm": { - aminoType: "cosmos-sdk/MsgChannelOpenConfirm", - toAmino: MsgChannelOpenConfirm.toAmino, - fromAmino: MsgChannelOpenConfirm.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelCloseInit": { - aminoType: "cosmos-sdk/MsgChannelCloseInit", - toAmino: MsgChannelCloseInit.toAmino, - fromAmino: MsgChannelCloseInit.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelCloseConfirm": { - aminoType: "cosmos-sdk/MsgChannelCloseConfirm", - toAmino: MsgChannelCloseConfirm.toAmino, - fromAmino: MsgChannelCloseConfirm.fromAmino - }, - "/ibc.core.channel.v1.MsgRecvPacket": { - aminoType: "cosmos-sdk/MsgRecvPacket", - toAmino: MsgRecvPacket.toAmino, - fromAmino: MsgRecvPacket.fromAmino - }, - "/ibc.core.channel.v1.MsgTimeout": { - aminoType: "cosmos-sdk/MsgTimeout", - toAmino: MsgTimeout.toAmino, - fromAmino: MsgTimeout.fromAmino - }, - "/ibc.core.channel.v1.MsgTimeoutOnClose": { - aminoType: "cosmos-sdk/MsgTimeoutOnClose", - toAmino: MsgTimeoutOnClose.toAmino, - fromAmino: MsgTimeoutOnClose.fromAmino - }, - "/ibc.core.channel.v1.MsgAcknowledgement": { - aminoType: "cosmos-sdk/MsgAcknowledgement", - toAmino: MsgAcknowledgement.toAmino, - fromAmino: MsgAcknowledgement.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeInit": { - aminoType: "cosmos-sdk/MsgChannelUpgradeInit", - toAmino: MsgChannelUpgradeInit.toAmino, - fromAmino: MsgChannelUpgradeInit.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeTry": { - aminoType: "cosmos-sdk/MsgChannelUpgradeTry", - toAmino: MsgChannelUpgradeTry.toAmino, - fromAmino: MsgChannelUpgradeTry.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeAck": { - aminoType: "cosmos-sdk/MsgChannelUpgradeAck", - toAmino: MsgChannelUpgradeAck.toAmino, - fromAmino: MsgChannelUpgradeAck.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeConfirm": { - aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", - toAmino: MsgChannelUpgradeConfirm.toAmino, - fromAmino: MsgChannelUpgradeConfirm.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeOpen": { - aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", - toAmino: MsgChannelUpgradeOpen.toAmino, - fromAmino: MsgChannelUpgradeOpen.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeTimeout": { - aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", - toAmino: MsgChannelUpgradeTimeout.toAmino, - fromAmino: MsgChannelUpgradeTimeout.fromAmino - }, - "/ibc.core.channel.v1.MsgChannelUpgradeCancel": { - aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", - toAmino: MsgChannelUpgradeCancel.toAmino, - fromAmino: MsgChannelUpgradeCancel.fromAmino - }, - "/ibc.core.channel.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/ibc.core.channel.v1.MsgPruneAcknowledgements": { - aminoType: "cosmos-sdk/MsgPruneAcknowledgements", - toAmino: MsgPruneAcknowledgements.toAmino, - fromAmino: MsgPruneAcknowledgements.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.func.ts b/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.func.ts new file mode 100644 index 00000000..92917fb9 --- /dev/null +++ b/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.func.ts @@ -0,0 +1,117 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenInit.typeUrl, + encoders: toEncoders(MsgChannelOpenInit), + converters: toConverters(MsgChannelOpenInit) +}); +export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenTry.typeUrl, + encoders: toEncoders(MsgChannelOpenTry), + converters: toConverters(MsgChannelOpenTry) +}); +export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenAck.typeUrl, + encoders: toEncoders(MsgChannelOpenAck), + converters: toConverters(MsgChannelOpenAck) +}); +export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenConfirm.typeUrl, + encoders: toEncoders(MsgChannelOpenConfirm), + converters: toConverters(MsgChannelOpenConfirm) +}); +export const createChannelCloseInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseInit.typeUrl, + encoders: toEncoders(MsgChannelCloseInit), + converters: toConverters(MsgChannelCloseInit) +}); +export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseConfirm.typeUrl, + encoders: toEncoders(MsgChannelCloseConfirm), + converters: toConverters(MsgChannelCloseConfirm) +}); +export const createRecvPacket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecvPacket.typeUrl, + encoders: toEncoders(MsgRecvPacket), + converters: toConverters(MsgRecvPacket) +}); +export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeout.typeUrl, + encoders: toEncoders(MsgTimeout), + converters: toConverters(MsgTimeout) +}); +export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeoutOnClose.typeUrl, + encoders: toEncoders(MsgTimeoutOnClose), + converters: toConverters(MsgTimeoutOnClose) +}); +export const createAcknowledgement = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAcknowledgement.typeUrl, + encoders: toEncoders(MsgAcknowledgement), + converters: toConverters(MsgAcknowledgement) +}); +export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeInit.typeUrl, + encoders: toEncoders(MsgChannelUpgradeInit), + converters: toConverters(MsgChannelUpgradeInit) +}); +export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTry.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTry), + converters: toConverters(MsgChannelUpgradeTry) +}); +export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeAck.typeUrl, + encoders: toEncoders(MsgChannelUpgradeAck), + converters: toConverters(MsgChannelUpgradeAck) +}); +export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeConfirm.typeUrl, + encoders: toEncoders(MsgChannelUpgradeConfirm), + converters: toConverters(MsgChannelUpgradeConfirm) +}); +export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeOpen.typeUrl, + encoders: toEncoders(MsgChannelUpgradeOpen), + converters: toConverters(MsgChannelUpgradeOpen) +}); +export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTimeout.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTimeout), + converters: toConverters(MsgChannelUpgradeTimeout) +}); +export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeCancel.typeUrl, + encoders: toEncoders(MsgChannelUpgradeCancel), + converters: toConverters(MsgChannelUpgradeCancel) +}); +export const createUpdateChannelParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createPruneAcknowledgements = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAcknowledgements.typeUrl, + encoders: toEncoders(MsgPruneAcknowledgements), + converters: toConverters(MsgPruneAcknowledgements) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts deleted file mode 100644 index 315e7e3a..00000000 --- a/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse, MsgChannelUpgradeInit, MsgChannelUpgradeInitResponse, MsgChannelUpgradeTry, MsgChannelUpgradeTryResponse, MsgChannelUpgradeAck, MsgChannelUpgradeAckResponse, MsgChannelUpgradeConfirm, MsgChannelUpgradeConfirmResponse, MsgChannelUpgradeOpen, MsgChannelUpgradeOpenResponse, MsgChannelUpgradeTimeout, MsgChannelUpgradeTimeoutResponse, MsgChannelUpgradeCancel, MsgChannelUpgradeCancelResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgPruneAcknowledgements, MsgPruneAcknowledgementsResponse } from "./tx"; -/** 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; - /** ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. */ - channelUpgradeInit(request: MsgChannelUpgradeInit): Promise; - /** ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. */ - channelUpgradeTry(request: MsgChannelUpgradeTry): Promise; - /** ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. */ - channelUpgradeAck(request: MsgChannelUpgradeAck): Promise; - /** ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. */ - channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise; - /** ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. */ - channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise; - /** ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. */ - channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise; - /** ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. */ - channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise; - /** UpdateChannelParams defines a rpc handler method for MsgUpdateParams. */ - updateChannelParams(request: MsgUpdateParams): Promise; - /** PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. */ - pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ - channelOpenInit = async (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 BinaryReader(data))); - }; - /* ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. */ - channelOpenTry = async (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 BinaryReader(data))); - }; - /* ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. */ - channelOpenAck = async (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 BinaryReader(data))); - }; - /* ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. */ - channelOpenConfirm = async (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 BinaryReader(data))); - }; - /* ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. */ - channelCloseInit = async (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 BinaryReader(data))); - }; - /* ChannelCloseConfirm defines a rpc handler method for - MsgChannelCloseConfirm. */ - channelCloseConfirm = async (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 BinaryReader(data))); - }; - /* RecvPacket defines a rpc handler method for MsgRecvPacket. */ - recvPacket = async (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 BinaryReader(data))); - }; - /* Timeout defines a rpc handler method for MsgTimeout. */ - timeout = async (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 BinaryReader(data))); - }; - /* TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. */ - timeoutOnClose = async (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 BinaryReader(data))); - }; - /* Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ - acknowledgement = async (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 BinaryReader(data))); - }; - /* ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. */ - channelUpgradeInit = async (request: MsgChannelUpgradeInit): Promise => { - const data = MsgChannelUpgradeInit.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeInit", data); - return promise.then(data => MsgChannelUpgradeInitResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. */ - channelUpgradeTry = async (request: MsgChannelUpgradeTry): Promise => { - const data = MsgChannelUpgradeTry.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTry", data); - return promise.then(data => MsgChannelUpgradeTryResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. */ - channelUpgradeAck = async (request: MsgChannelUpgradeAck): Promise => { - const data = MsgChannelUpgradeAck.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeAck", data); - return promise.then(data => MsgChannelUpgradeAckResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. */ - channelUpgradeConfirm = async (request: MsgChannelUpgradeConfirm): Promise => { - const data = MsgChannelUpgradeConfirm.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm", data); - return promise.then(data => MsgChannelUpgradeConfirmResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. */ - channelUpgradeOpen = async (request: MsgChannelUpgradeOpen): Promise => { - const data = MsgChannelUpgradeOpen.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen", data); - return promise.then(data => MsgChannelUpgradeOpenResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. */ - channelUpgradeTimeout = async (request: MsgChannelUpgradeTimeout): Promise => { - const data = MsgChannelUpgradeTimeout.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout", data); - return promise.then(data => MsgChannelUpgradeTimeoutResponse.decode(new BinaryReader(data))); - }; - /* ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. */ - channelUpgradeCancel = async (request: MsgChannelUpgradeCancel): Promise => { - const data = MsgChannelUpgradeCancel.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel", data); - return promise.then(data => MsgChannelUpgradeCancelResponse.decode(new BinaryReader(data))); - }; - /* UpdateChannelParams defines a rpc handler method for MsgUpdateParams. */ - updateChannelParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "UpdateChannelParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; - /* PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. */ - pruneAcknowledgements = async (request: MsgPruneAcknowledgements): Promise => { - const data = MsgPruneAcknowledgements.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Msg", "PruneAcknowledgements", data); - return promise.then(data => MsgPruneAcknowledgementsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..106d8e60 --- /dev/null +++ b/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts @@ -0,0 +1,60 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +export const useChannelOpenInit = buildUseVueMutation({ + builderMutationFn: createChannelOpenInit +}); +export const useChannelOpenTry = buildUseVueMutation({ + builderMutationFn: createChannelOpenTry +}); +export const useChannelOpenAck = buildUseVueMutation({ + builderMutationFn: createChannelOpenAck +}); +export const useChannelOpenConfirm = buildUseVueMutation({ + builderMutationFn: createChannelOpenConfirm +}); +export const useChannelCloseInit = buildUseVueMutation({ + builderMutationFn: createChannelCloseInit +}); +export const useChannelCloseConfirm = buildUseVueMutation({ + builderMutationFn: createChannelCloseConfirm +}); +export const useRecvPacket = buildUseVueMutation({ + builderMutationFn: createRecvPacket +}); +export const useTimeout = buildUseVueMutation({ + builderMutationFn: createTimeout +}); +export const useTimeoutOnClose = buildUseVueMutation({ + builderMutationFn: createTimeoutOnClose +}); +export const useAcknowledgement = buildUseVueMutation({ + builderMutationFn: createAcknowledgement +}); +export const useChannelUpgradeInit = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeInit +}); +export const useChannelUpgradeTry = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeTry +}); +export const useChannelUpgradeAck = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeAck +}); +export const useChannelUpgradeConfirm = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeConfirm +}); +export const useChannelUpgradeOpen = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeOpen +}); +export const useChannelUpgradeTimeout = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeTimeout +}); +export const useChannelUpgradeCancel = buildUseVueMutation({ + builderMutationFn: createChannelUpgradeCancel +}); +export const useUpdateChannelParams = buildUseVueMutation({ + builderMutationFn: createUpdateChannelParams +}); +export const usePruneAcknowledgements = buildUseVueMutation({ + builderMutationFn: createPruneAcknowledgements +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/tx.ts b/libs/interchain-vue/src/ibc/core/channel/v1/tx.ts index 5584dc8a..365ac98b 100644 --- a/libs/interchain-vue/src/ibc/core/channel/v1/tx.ts +++ b/libs/interchain-vue/src/ibc/core/channel/v1/tx.ts @@ -4,7 +4,6 @@ import { UpgradeFields, UpgradeFieldsAmino, Upgrade, UpgradeAmino, ErrorReceipt, import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** ResponseResultType defines the possible outcomes of the execution of a message */ export enum ResponseResultType { /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ @@ -62,11 +61,6 @@ export interface MsgChannelOpenInit { channel: Channel; signer: string; } -export interface ReactiveMsgChannelOpenInit { - portId: ComputedRef; - channel: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenInitProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit"; value: Uint8Array; @@ -89,10 +83,6 @@ export interface MsgChannelOpenInitResponse { channelId: string; version: string; } -export interface ReactiveMsgChannelOpenInitResponse { - channelId: ComputedRef; - version: ComputedRef; -} export interface MsgChannelOpenInitResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse"; value: Uint8Array; @@ -123,15 +113,6 @@ export interface MsgChannelOpenTry { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelOpenTry { - portId: ComputedRef; - previousChannelId: ComputedRef; - channel: ComputedRef; - counterpartyVersion: ComputedRef; - proofInit: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenTryProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry"; value: Uint8Array; @@ -162,10 +143,6 @@ export interface MsgChannelOpenTryResponse { version: string; channelId: string; } -export interface ReactiveMsgChannelOpenTryResponse { - version: ComputedRef; - channelId: ComputedRef; -} export interface MsgChannelOpenTryResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse"; value: Uint8Array; @@ -195,15 +172,6 @@ export interface MsgChannelOpenAck { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelOpenAck { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannelId: ComputedRef; - counterpartyVersion: ComputedRef; - proofTry: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenAckProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck"; value: Uint8Array; @@ -230,7 +198,6 @@ export interface MsgChannelOpenAckAminoMsg { } /** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ export interface MsgChannelOpenAckResponse {} -export interface ReactiveMsgChannelOpenAckResponse {} export interface MsgChannelOpenAckResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse"; value: Uint8Array; @@ -252,13 +219,6 @@ export interface MsgChannelOpenConfirm { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelOpenConfirm { - portId: ComputedRef; - channelId: ComputedRef; - proofAck: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelOpenConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm"; value: Uint8Array; @@ -283,7 +243,6 @@ export interface MsgChannelOpenConfirmAminoMsg { * type. */ export interface MsgChannelOpenConfirmResponse {} -export interface ReactiveMsgChannelOpenConfirmResponse {} export interface MsgChannelOpenConfirmResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse"; value: Uint8Array; @@ -306,11 +265,6 @@ export interface MsgChannelCloseInit { channelId: string; signer: string; } -export interface ReactiveMsgChannelCloseInit { - portId: ComputedRef; - channelId: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelCloseInitProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit"; value: Uint8Array; @@ -330,7 +284,6 @@ export interface MsgChannelCloseInitAminoMsg { } /** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ export interface MsgChannelCloseInitResponse {} -export interface ReactiveMsgChannelCloseInitResponse {} export interface MsgChannelCloseInitResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse"; value: Uint8Array; @@ -353,14 +306,6 @@ export interface MsgChannelCloseConfirm { signer: string; counterpartyUpgradeSequence: bigint; } -export interface ReactiveMsgChannelCloseConfirm { - portId: ComputedRef; - channelId: ComputedRef; - proofInit: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; -} export interface MsgChannelCloseConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; value: Uint8Array; @@ -386,7 +331,6 @@ export interface MsgChannelCloseConfirmAminoMsg { * type. */ export interface MsgChannelCloseConfirmResponse {} -export interface ReactiveMsgChannelCloseConfirmResponse {} export interface MsgChannelCloseConfirmResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse"; value: Uint8Array; @@ -407,12 +351,6 @@ export interface MsgRecvPacket { proofHeight: Height; signer: string; } -export interface ReactiveMsgRecvPacket { - packet: ComputedRef; - proofCommitment: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgRecvPacketProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgRecvPacket"; value: Uint8Array; @@ -432,9 +370,6 @@ export interface MsgRecvPacketAminoMsg { export interface MsgRecvPacketResponse { result: ResponseResultType; } -export interface ReactiveMsgRecvPacketResponse { - result: ComputedRef; -} export interface MsgRecvPacketResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse"; value: Uint8Array; @@ -455,13 +390,6 @@ export interface MsgTimeout { nextSequenceRecv: bigint; signer: string; } -export interface ReactiveMsgTimeout { - packet: ComputedRef; - proofUnreceived: ComputedRef; - proofHeight: ComputedRef; - nextSequenceRecv: ComputedRef; - signer: ComputedRef; -} export interface MsgTimeoutProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeout"; value: Uint8Array; @@ -482,9 +410,6 @@ export interface MsgTimeoutAminoMsg { export interface MsgTimeoutResponse { result: ResponseResultType; } -export interface ReactiveMsgTimeoutResponse { - result: ComputedRef; -} export interface MsgTimeoutResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse"; value: Uint8Array; @@ -507,15 +432,6 @@ export interface MsgTimeoutOnClose { signer: string; counterpartyUpgradeSequence: bigint; } -export interface ReactiveMsgTimeoutOnClose { - packet: ComputedRef; - proofUnreceived: ComputedRef; - proofClose: ComputedRef; - proofHeight: ComputedRef; - nextSequenceRecv: ComputedRef; - signer: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; -} export interface MsgTimeoutOnCloseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; value: Uint8Array; @@ -538,9 +454,6 @@ export interface MsgTimeoutOnCloseAminoMsg { export interface MsgTimeoutOnCloseResponse { result: ResponseResultType; } -export interface ReactiveMsgTimeoutOnCloseResponse { - result: ComputedRef; -} export interface MsgTimeoutOnCloseResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse"; value: Uint8Array; @@ -561,13 +474,6 @@ export interface MsgAcknowledgement { proofHeight: Height; signer: string; } -export interface ReactiveMsgAcknowledgement { - packet: ComputedRef; - acknowledgement: ComputedRef; - proofAcked: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgAcknowledgementProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement"; value: Uint8Array; @@ -588,9 +494,6 @@ export interface MsgAcknowledgementAminoMsg { export interface MsgAcknowledgementResponse { result: ResponseResultType; } -export interface ReactiveMsgAcknowledgementResponse { - result: ComputedRef; -} export interface MsgAcknowledgementResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse"; value: Uint8Array; @@ -614,12 +517,6 @@ export interface MsgChannelUpgradeInit { fields: UpgradeFields; signer: string; } -export interface ReactiveMsgChannelUpgradeInit { - portId: ComputedRef; - channelId: ComputedRef; - fields: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeInitProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit"; value: Uint8Array; @@ -644,10 +541,6 @@ export interface MsgChannelUpgradeInitResponse { upgrade: Upgrade; upgradeSequence: bigint; } -export interface ReactiveMsgChannelUpgradeInitResponse { - upgrade: ComputedRef; - upgradeSequence: ComputedRef; -} export interface MsgChannelUpgradeInitResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse"; value: Uint8Array; @@ -673,17 +566,6 @@ export interface MsgChannelUpgradeTry { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeTry { - portId: ComputedRef; - channelId: ComputedRef; - proposedUpgradeConnectionHops: ComputedRef; - counterpartyUpgradeFields: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; - proofChannel: ComputedRef; - proofUpgrade: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeTryProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry"; value: Uint8Array; @@ -710,11 +592,6 @@ export interface MsgChannelUpgradeTryResponse { upgradeSequence: bigint; result: ResponseResultType; } -export interface ReactiveMsgChannelUpgradeTryResponse { - upgrade: ComputedRef; - upgradeSequence: ComputedRef; - result: ComputedRef; -} export interface MsgChannelUpgradeTryResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse"; value: Uint8Array; @@ -739,15 +616,6 @@ export interface MsgChannelUpgradeAck { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeAck { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyUpgrade: ComputedRef; - proofChannel: ComputedRef; - proofUpgrade: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeAckProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck"; value: Uint8Array; @@ -770,9 +638,6 @@ export interface MsgChannelUpgradeAckAminoMsg { export interface MsgChannelUpgradeAckResponse { result: ResponseResultType; } -export interface ReactiveMsgChannelUpgradeAckResponse { - result: ComputedRef; -} export interface MsgChannelUpgradeAckResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse"; value: Uint8Array; @@ -796,16 +661,6 @@ export interface MsgChannelUpgradeConfirm { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeConfirm { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannelState: ComputedRef; - counterpartyUpgrade: ComputedRef; - proofChannel: ComputedRef; - proofUpgrade: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm"; value: Uint8Array; @@ -829,9 +684,6 @@ export interface MsgChannelUpgradeConfirmAminoMsg { export interface MsgChannelUpgradeConfirmResponse { result: ResponseResultType; } -export interface ReactiveMsgChannelUpgradeConfirmResponse { - result: ComputedRef; -} export interface MsgChannelUpgradeConfirmResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse"; value: Uint8Array; @@ -854,15 +706,6 @@ export interface MsgChannelUpgradeOpen { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeOpen { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannelState: ComputedRef; - counterpartyUpgradeSequence: ComputedRef; - proofChannel: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeOpenProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen"; value: Uint8Array; @@ -883,7 +726,6 @@ export interface MsgChannelUpgradeOpenAminoMsg { } /** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ export interface MsgChannelUpgradeOpenResponse {} -export interface ReactiveMsgChannelUpgradeOpenResponse {} export interface MsgChannelUpgradeOpenResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse"; value: Uint8Array; @@ -903,14 +745,6 @@ export interface MsgChannelUpgradeTimeout { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeTimeout { - portId: ComputedRef; - channelId: ComputedRef; - counterpartyChannel: ComputedRef; - proofChannel: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeTimeoutProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout"; value: Uint8Array; @@ -930,7 +764,6 @@ export interface MsgChannelUpgradeTimeoutAminoMsg { } /** MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type */ export interface MsgChannelUpgradeTimeoutResponse {} -export interface ReactiveMsgChannelUpgradeTimeoutResponse {} export interface MsgChannelUpgradeTimeoutResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse"; value: Uint8Array; @@ -950,14 +783,6 @@ export interface MsgChannelUpgradeCancel { proofHeight: Height; signer: string; } -export interface ReactiveMsgChannelUpgradeCancel { - portId: ComputedRef; - channelId: ComputedRef; - errorReceipt: ComputedRef; - proofErrorReceipt: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgChannelUpgradeCancelProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel"; value: Uint8Array; @@ -977,7 +802,6 @@ export interface MsgChannelUpgradeCancelAminoMsg { } /** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ export interface MsgChannelUpgradeCancelResponse {} -export interface ReactiveMsgChannelUpgradeCancelResponse {} export interface MsgChannelUpgradeCancelResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse"; value: Uint8Array; @@ -999,10 +823,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - authority: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgUpdateParams"; value: Uint8Array; @@ -1024,7 +844,6 @@ export interface MsgUpdateParamsAminoMsg { } /** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse"; value: Uint8Array; @@ -1042,12 +861,6 @@ export interface MsgPruneAcknowledgements { limit: bigint; signer: string; } -export interface ReactiveMsgPruneAcknowledgements { - portId: ComputedRef; - channelId: ComputedRef; - limit: ComputedRef; - signer: ComputedRef; -} export interface MsgPruneAcknowledgementsProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements"; value: Uint8Array; @@ -1070,10 +883,6 @@ export interface MsgPruneAcknowledgementsResponse { /** Number of sequences left after pruning. */ totalRemainingSequences: bigint; } -export interface ReactiveMsgPruneAcknowledgementsResponse { - totalPrunedSequences: ComputedRef; - totalRemainingSequences: ComputedRef; -} export interface MsgPruneAcknowledgementsResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/upgrade.ts b/libs/interchain-vue/src/ibc/core/channel/v1/upgrade.ts index 91185340..150fa5b9 100644 --- a/libs/interchain-vue/src/ibc/core/channel/v1/upgrade.ts +++ b/libs/interchain-vue/src/ibc/core/channel/v1/upgrade.ts @@ -2,7 +2,6 @@ import { Timeout, TimeoutAmino, Order } from "./channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, isSet } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * Upgrade is a verifiable type which contains the relevant information * for an attempted upgrade. It provides the proposed changes to the channel @@ -15,11 +14,6 @@ export interface Upgrade { timeout: Timeout; nextSequenceSend: bigint; } -export interface ReactiveUpgrade { - fields: ComputedRef; - timeout: ComputedRef; - nextSequenceSend: ComputedRef; -} export interface UpgradeProtoMsg { typeUrl: "/ibc.core.channel.v1.Upgrade"; value: Uint8Array; @@ -49,11 +43,6 @@ export interface UpgradeFields { connectionHops: string[]; version: string; } -export interface ReactiveUpgradeFields { - ordering: ComputedRef; - connectionHops: ComputedRef; - version: ComputedRef; -} export interface UpgradeFieldsProtoMsg { typeUrl: "/ibc.core.channel.v1.UpgradeFields"; value: Uint8Array; @@ -82,10 +71,6 @@ export interface ErrorReceipt { /** the error message detailing the cause of failure */ message: string; } -export interface ReactiveErrorReceipt { - sequence: ComputedRef; - message: ComputedRef; -} export interface ErrorReceiptProtoMsg { typeUrl: "/ibc.core.channel.v1.ErrorReceipt"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/client/v1/client.ts b/libs/interchain-vue/src/ibc/core/client/v1/client.ts index 4846cb86..542424cb 100644 --- a/libs/interchain-vue/src/ibc/core/client/v1/client.ts +++ b/libs/interchain-vue/src/ibc/core/client/v1/client.ts @@ -2,7 +2,6 @@ import { Any, AnyAmino } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * IdentifiedClientState defines a client state with an additional client * identifier field. @@ -13,10 +12,6 @@ export interface IdentifiedClientState { /** client state */ clientState?: Any; } -export interface ReactiveIdentifiedClientState { - clientId: ComputedRef; - clientState?: ComputedRef; -} export interface IdentifiedClientStateProtoMsg { typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; value: Uint8Array; @@ -45,10 +40,6 @@ export interface ConsensusStateWithHeight { /** consensus state */ consensusState?: Any; } -export interface ReactiveConsensusStateWithHeight { - height: ComputedRef; - consensusState?: ComputedRef; -} export interface ConsensusStateWithHeightProtoMsg { typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; value: Uint8Array; @@ -77,10 +68,6 @@ export interface ClientConsensusStates { /** consensus states and their heights associated with the client */ consensusStates: ConsensusStateWithHeight[]; } -export interface ReactiveClientConsensusStates { - clientId: ComputedRef; - consensusStates: ComputedRef; -} export interface ClientConsensusStatesProtoMsg { typeUrl: "/ibc.core.client.v1.ClientConsensusStates"; value: Uint8Array; @@ -120,10 +107,6 @@ export interface Height { /** the height within the given revision */ revisionHeight: bigint; } -export interface ReactiveHeight { - revisionNumber: ComputedRef; - revisionHeight: ComputedRef; -} export interface HeightProtoMsg { typeUrl: "/ibc.core.client.v1.Height"; value: Uint8Array; @@ -162,9 +145,6 @@ export interface Params { */ allowedClients: string[]; } -export interface ReactiveParams { - allowedClients: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.core.client.v1.Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/client/v1/tx.amino.ts b/libs/interchain-vue/src/ibc/core/client/v1/tx.amino.ts deleted file mode 100644 index dc80a575..00000000 --- a/libs/interchain-vue/src/ibc/core/client/v1/tx.amino.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/ibc.core.client.v1.MsgCreateClient": { - aminoType: "cosmos-sdk/MsgCreateClient", - toAmino: MsgCreateClient.toAmino, - fromAmino: MsgCreateClient.fromAmino - }, - "/ibc.core.client.v1.MsgUpdateClient": { - aminoType: "cosmos-sdk/MsgUpdateClient", - toAmino: MsgUpdateClient.toAmino, - fromAmino: MsgUpdateClient.fromAmino - }, - "/ibc.core.client.v1.MsgUpgradeClient": { - aminoType: "cosmos-sdk/MsgUpgradeClient", - toAmino: MsgUpgradeClient.toAmino, - fromAmino: MsgUpgradeClient.fromAmino - }, - "/ibc.core.client.v1.MsgSubmitMisbehaviour": { - aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", - toAmino: MsgSubmitMisbehaviour.toAmino, - fromAmino: MsgSubmitMisbehaviour.fromAmino - }, - "/ibc.core.client.v1.MsgRecoverClient": { - aminoType: "cosmos-sdk/MsgRecoverClient", - toAmino: MsgRecoverClient.toAmino, - fromAmino: MsgRecoverClient.fromAmino - }, - "/ibc.core.client.v1.MsgIBCSoftwareUpgrade": { - aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", - toAmino: MsgIBCSoftwareUpgrade.toAmino, - fromAmino: MsgIBCSoftwareUpgrade.fromAmino - }, - "/ibc.core.client.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.func.ts b/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.func.ts new file mode 100644 index 00000000..a178d5d2 --- /dev/null +++ b/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +export const createCreateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateClient.typeUrl, + encoders: toEncoders(MsgCreateClient), + converters: toConverters(MsgCreateClient) +}); +export const createUpdateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateClient.typeUrl, + encoders: toEncoders(MsgUpdateClient), + converters: toConverters(MsgUpdateClient) +}); +export const createUpgradeClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpgradeClient.typeUrl, + encoders: toEncoders(MsgUpgradeClient), + converters: toConverters(MsgUpgradeClient) +}); +export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitMisbehaviour.typeUrl, + encoders: toEncoders(MsgSubmitMisbehaviour), + converters: toConverters(MsgSubmitMisbehaviour) +}); +export const createRecoverClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecoverClient.typeUrl, + encoders: toEncoders(MsgRecoverClient), + converters: toConverters(MsgRecoverClient) +}); +export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgIBCSoftwareUpgrade.typeUrl, + encoders: toEncoders(MsgIBCSoftwareUpgrade), + converters: toConverters(MsgIBCSoftwareUpgrade) +}); +export const createUpdateClientParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.msg.ts deleted file mode 100644 index f338de2a..00000000 --- a/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse, MsgRecoverClient, MsgRecoverClientResponse, MsgIBCSoftwareUpgrade, MsgIBCSoftwareUpgradeResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** 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; - /** RecoverClient defines a rpc handler method for MsgRecoverClient. */ - recoverClient(request: MsgRecoverClient): Promise; - /** IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. */ - iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise; - /** UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ - updateClientParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* CreateClient defines a rpc handler method for MsgCreateClient. */ - createClient = async (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 BinaryReader(data))); - }; - /* UpdateClient defines a rpc handler method for MsgUpdateClient. */ - updateClient = async (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 BinaryReader(data))); - }; - /* UpgradeClient defines a rpc handler method for MsgUpgradeClient. */ - upgradeClient = async (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 BinaryReader(data))); - }; - /* SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ - submitMisbehaviour = async (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 BinaryReader(data))); - }; - /* RecoverClient defines a rpc handler method for MsgRecoverClient. */ - recoverClient = async (request: MsgRecoverClient): Promise => { - const data = MsgRecoverClient.encode(request).finish(); - const promise = this.rpc.request("ibc.core.client.v1.Msg", "RecoverClient", data); - return promise.then(data => MsgRecoverClientResponse.decode(new BinaryReader(data))); - }; - /* IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. */ - iBCSoftwareUpgrade = async (request: MsgIBCSoftwareUpgrade): Promise => { - const data = MsgIBCSoftwareUpgrade.encode(request).finish(); - const promise = this.rpc.request("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade", data); - return promise.then(data => MsgIBCSoftwareUpgradeResponse.decode(new BinaryReader(data))); - }; - /* UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ - updateClientParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClientParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..e58f7de8 --- /dev/null +++ b/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts @@ -0,0 +1,24 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +export const useCreateClient = buildUseVueMutation({ + builderMutationFn: createCreateClient +}); +export const useUpdateClient = buildUseVueMutation({ + builderMutationFn: createUpdateClient +}); +export const useUpgradeClient = buildUseVueMutation({ + builderMutationFn: createUpgradeClient +}); +export const useSubmitMisbehaviour = buildUseVueMutation({ + builderMutationFn: createSubmitMisbehaviour +}); +export const useRecoverClient = buildUseVueMutation({ + builderMutationFn: createRecoverClient +}); +export const useIBCSoftwareUpgrade = buildUseVueMutation({ + builderMutationFn: createIBCSoftwareUpgrade +}); +export const useUpdateClientParams = buildUseVueMutation({ + builderMutationFn: createUpdateClientParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/client/v1/tx.ts b/libs/interchain-vue/src/ibc/core/client/v1/tx.ts index 43f9dd14..60b35cd4 100644 --- a/libs/interchain-vue/src/ibc/core/client/v1/tx.ts +++ b/libs/interchain-vue/src/ibc/core/client/v1/tx.ts @@ -4,7 +4,6 @@ import { Params, ParamsAmino } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClient { /** light client state */ @@ -17,11 +16,6 @@ export interface MsgCreateClient { /** signer address */ signer: string; } -export interface ReactiveMsgCreateClient { - clientState?: ComputedRef; - consensusState?: ComputedRef; - signer: ComputedRef; -} export interface MsgCreateClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgCreateClient"; value: Uint8Array; @@ -46,9 +40,6 @@ export interface MsgCreateClientAminoMsg { export interface MsgCreateClientResponse { clientId: string; } -export interface ReactiveMsgCreateClientResponse { - clientId: ComputedRef; -} export interface MsgCreateClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; value: Uint8Array; @@ -73,11 +64,6 @@ export interface MsgUpdateClient { /** signer address */ signer: string; } -export interface ReactiveMsgUpdateClient { - clientId: ComputedRef; - clientMessage?: ComputedRef; - signer: ComputedRef; -} export interface MsgUpdateClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateClient"; value: Uint8Array; @@ -100,7 +86,6 @@ export interface MsgUpdateClientAminoMsg { } /** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ export interface MsgUpdateClientResponse {} -export interface ReactiveMsgUpdateClientResponse {} export interface MsgUpdateClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse"; value: Uint8Array; @@ -132,14 +117,6 @@ export interface MsgUpgradeClient { /** signer address */ signer: string; } -export interface ReactiveMsgUpgradeClient { - clientId: ComputedRef; - clientState?: ComputedRef; - consensusState?: ComputedRef; - proofUpgradeClient: ComputedRef; - proofUpgradeConsensusState: ComputedRef; - signer: ComputedRef; -} export interface MsgUpgradeClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpgradeClient"; value: Uint8Array; @@ -171,7 +148,6 @@ export interface MsgUpgradeClientAminoMsg { } /** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ export interface MsgUpgradeClientResponse {} -export interface ReactiveMsgUpgradeClientResponse {} export interface MsgUpgradeClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse"; value: Uint8Array; @@ -196,11 +172,6 @@ export interface MsgSubmitMisbehaviour { /** signer address */ signer: string; } -export interface ReactiveMsgSubmitMisbehaviour { - clientId: ComputedRef; - misbehaviour?: ComputedRef; - signer: ComputedRef; -} export interface MsgSubmitMisbehaviourProtoMsg { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour"; value: Uint8Array; @@ -228,7 +199,6 @@ export interface MsgSubmitMisbehaviourAminoMsg { * type. */ export interface MsgSubmitMisbehaviourResponse {} -export interface ReactiveMsgSubmitMisbehaviourResponse {} export interface MsgSubmitMisbehaviourResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse"; value: Uint8Array; @@ -254,11 +224,6 @@ export interface MsgRecoverClient { /** signer address */ signer: string; } -export interface ReactiveMsgRecoverClient { - subjectClientId: ComputedRef; - substituteClientId: ComputedRef; - signer: ComputedRef; -} export interface MsgRecoverClientProtoMsg { typeUrl: "/ibc.core.client.v1.MsgRecoverClient"; value: Uint8Array; @@ -281,7 +246,6 @@ export interface MsgRecoverClientAminoMsg { } /** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ export interface MsgRecoverClientResponse {} -export interface ReactiveMsgRecoverClientResponse {} export interface MsgRecoverClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse"; value: Uint8Array; @@ -309,11 +273,6 @@ export interface MsgIBCSoftwareUpgrade { /** signer address */ signer: string; } -export interface ReactiveMsgIBCSoftwareUpgrade { - plan: ComputedRef; - upgradedClientState?: ComputedRef; - signer: ComputedRef; -} export interface MsgIBCSoftwareUpgradeProtoMsg { typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade"; value: Uint8Array; @@ -341,7 +300,6 @@ export interface MsgIBCSoftwareUpgradeAminoMsg { } /** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ export interface MsgIBCSoftwareUpgradeResponse {} -export interface ReactiveMsgIBCSoftwareUpgradeResponse {} export interface MsgIBCSoftwareUpgradeResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse"; value: Uint8Array; @@ -363,10 +321,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - signer: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateParams"; value: Uint8Array; @@ -388,7 +342,6 @@ export interface MsgUpdateParamsAminoMsg { } /** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/commitment/v1/commitment.ts b/libs/interchain-vue/src/ibc/core/commitment/v1/commitment.ts index 7328ff43..051efcdf 100644 --- a/libs/interchain-vue/src/ibc/core/commitment/v1/commitment.ts +++ b/libs/interchain-vue/src/ibc/core/commitment/v1/commitment.ts @@ -2,7 +2,6 @@ import { CommitmentProof, CommitmentProofAmino } from "../../../../cosmos/ics23/ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * MerkleRoot defines a merkle root hash. * In the Cosmos SDK, the AppHash of a block header becomes the root. @@ -10,9 +9,6 @@ import { ComputedRef } from "vue"; export interface MerkleRoot { hash: Uint8Array; } -export interface ReactiveMerkleRoot { - hash: ComputedRef; -} export interface MerkleRootProtoMsg { typeUrl: "/ibc.core.commitment.v1.MerkleRoot"; value: Uint8Array; @@ -36,9 +32,6 @@ export interface MerkleRootAminoMsg { export interface MerklePrefix { keyPrefix: Uint8Array; } -export interface ReactiveMerklePrefix { - keyPrefix: ComputedRef; -} export interface MerklePrefixProtoMsg { typeUrl: "/ibc.core.commitment.v1.MerklePrefix"; value: Uint8Array; @@ -65,9 +58,6 @@ export interface MerklePrefixAminoMsg { export interface MerkleProof { proofs: CommitmentProof[]; } -export interface ReactiveMerkleProof { - proofs: ComputedRef; -} export interface MerkleProofProtoMsg { typeUrl: "/ibc.core.commitment.v1.MerkleProof"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/connection/v1/connection.ts b/libs/interchain-vue/src/ibc/core/connection/v1/connection.ts index 2b2c30b7..1791709d 100644 --- a/libs/interchain-vue/src/ibc/core/connection/v1/connection.ts +++ b/libs/interchain-vue/src/ibc/core/connection/v1/connection.ts @@ -2,7 +2,6 @@ import { MerklePrefix, MerklePrefixAmino } from "../../commitment/v1/commitment" import { isSet, DeepPartial } from "../../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; -import { ComputedRef } from "vue"; /** * State defines if a connection is in one of the following states: * INIT, TRYOPEN, OPEN or UNINITIALIZED. @@ -82,13 +81,6 @@ export interface ConnectionEnd { */ delayPeriod: bigint; } -export interface ReactiveConnectionEnd { - clientId: ComputedRef; - versions: ComputedRef; - state: ComputedRef; - counterparty: ComputedRef; - delayPeriod: ComputedRef; -} export interface ConnectionEndProtoMsg { typeUrl: "/ibc.core.connection.v1.ConnectionEnd"; value: Uint8Array; @@ -143,14 +135,6 @@ export interface IdentifiedConnection { /** delay period associated with this connection. */ delayPeriod: bigint; } -export interface ReactiveIdentifiedConnection { - id: ComputedRef; - clientId: ComputedRef; - versions: ComputedRef; - state: ComputedRef; - counterparty: ComputedRef; - delayPeriod: ComputedRef; -} export interface IdentifiedConnectionProtoMsg { typeUrl: "/ibc.core.connection.v1.IdentifiedConnection"; value: Uint8Array; @@ -195,11 +179,6 @@ export interface Counterparty { /** commitment merkle prefix of the counterparty chain. */ prefix: MerklePrefix; } -export interface ReactiveCounterparty { - clientId: ComputedRef; - connectionId: ComputedRef; - prefix: ComputedRef; -} export interface CounterpartyProtoMsg { typeUrl: "/ibc.core.connection.v1.Counterparty"; value: Uint8Array; @@ -228,9 +207,6 @@ export interface ClientPaths { /** list of connection paths */ paths: string[]; } -export interface ReactiveClientPaths { - paths: ComputedRef; -} export interface ClientPathsProtoMsg { typeUrl: "/ibc.core.connection.v1.ClientPaths"; value: Uint8Array; @@ -251,10 +227,6 @@ export interface ConnectionPaths { /** list of connection paths */ paths: string[]; } -export interface ReactiveConnectionPaths { - clientId: ComputedRef; - paths: ComputedRef; -} export interface ConnectionPathsProtoMsg { typeUrl: "/ibc.core.connection.v1.ConnectionPaths"; value: Uint8Array; @@ -280,10 +252,6 @@ export interface Version { /** list of features compatible with the specified identifier */ features: string[]; } -export interface ReactiveVersion { - identifier: ComputedRef; - features: ComputedRef; -} export interface VersionProtoMsg { typeUrl: "/ibc.core.connection.v1.Version"; value: Uint8Array; @@ -311,9 +279,6 @@ export interface Params { */ maxExpectedTimePerBlock: bigint; } -export interface ReactiveParams { - maxExpectedTimePerBlock: ComputedRef; -} export interface ParamsProtoMsg { typeUrl: "/ibc.core.connection.v1.Params"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/core/connection/v1/tx.amino.ts b/libs/interchain-vue/src/ibc/core/connection/v1/tx.amino.ts deleted file mode 100644 index 719f737c..00000000 --- a/libs/interchain-vue/src/ibc/core/connection/v1/tx.amino.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; -export const AminoConverter = { - "/ibc.core.connection.v1.MsgConnectionOpenInit": { - aminoType: "cosmos-sdk/MsgConnectionOpenInit", - toAmino: MsgConnectionOpenInit.toAmino, - fromAmino: MsgConnectionOpenInit.fromAmino - }, - "/ibc.core.connection.v1.MsgConnectionOpenTry": { - aminoType: "cosmos-sdk/MsgConnectionOpenTry", - toAmino: MsgConnectionOpenTry.toAmino, - fromAmino: MsgConnectionOpenTry.fromAmino - }, - "/ibc.core.connection.v1.MsgConnectionOpenAck": { - aminoType: "cosmos-sdk/MsgConnectionOpenAck", - toAmino: MsgConnectionOpenAck.toAmino, - fromAmino: MsgConnectionOpenAck.fromAmino - }, - "/ibc.core.connection.v1.MsgConnectionOpenConfirm": { - aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", - toAmino: MsgConnectionOpenConfirm.toAmino, - fromAmino: MsgConnectionOpenConfirm.fromAmino - }, - "/ibc.core.connection.v1.MsgUpdateParams": { - aminoType: "cosmos-sdk/MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - } -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.func.ts b/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.func.ts new file mode 100644 index 00000000..c6b7e37d --- /dev/null +++ b/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.func.ts @@ -0,0 +1,33 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenInit.typeUrl, + encoders: toEncoders(MsgConnectionOpenInit), + converters: toConverters(MsgConnectionOpenInit) +}); +export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenTry.typeUrl, + encoders: toEncoders(MsgConnectionOpenTry), + converters: toConverters(MsgConnectionOpenTry) +}); +export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenAck.typeUrl, + encoders: toEncoders(MsgConnectionOpenAck), + converters: toConverters(MsgConnectionOpenAck) +}); +export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenConfirm.typeUrl, + encoders: toEncoders(MsgConnectionOpenConfirm), + converters: toConverters(MsgConnectionOpenConfirm) +}); +export const createUpdateConnectionParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts b/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts deleted file mode 100644 index a77bfe4b..00000000 --- a/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { TxRpc } from "../../../../types"; -import { BinaryReader } from "../../../../binary"; -import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; -/** 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; - /** - * UpdateConnectionParams defines a rpc handler method for - * MsgUpdateParams. - */ - updateConnectionParams(request: MsgUpdateParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: TxRpc; - constructor(rpc: TxRpc) { - this.rpc = rpc; - } - /* ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ - connectionOpenInit = async (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 BinaryReader(data))); - }; - /* ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. */ - connectionOpenTry = async (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 BinaryReader(data))); - }; - /* ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. */ - connectionOpenAck = async (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 BinaryReader(data))); - }; - /* ConnectionOpenConfirm defines a rpc handler method for - MsgConnectionOpenConfirm. */ - connectionOpenConfirm = async (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 BinaryReader(data))); - }; - /* UpdateConnectionParams defines a rpc handler method for - MsgUpdateParams. */ - updateConnectionParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("ibc.core.connection.v1.Msg", "UpdateConnectionParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createClientImpl = (rpc: TxRpc) => { - return new MsgClientImpl(rpc); -}; \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts new file mode 100644 index 00000000..8e33749b --- /dev/null +++ b/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts @@ -0,0 +1,18 @@ +import { buildUseVueMutation } from "../../../../vue-query"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +export const useConnectionOpenInit = buildUseVueMutation({ + builderMutationFn: createConnectionOpenInit +}); +export const useConnectionOpenTry = buildUseVueMutation({ + builderMutationFn: createConnectionOpenTry +}); +export const useConnectionOpenAck = buildUseVueMutation({ + builderMutationFn: createConnectionOpenAck +}); +export const useConnectionOpenConfirm = buildUseVueMutation({ + builderMutationFn: createConnectionOpenConfirm +}); +export const useUpdateConnectionParams = buildUseVueMutation({ + builderMutationFn: createUpdateConnectionParams +}); \ No newline at end of file diff --git a/libs/interchain-vue/src/ibc/core/connection/v1/tx.ts b/libs/interchain-vue/src/ibc/core/connection/v1/tx.ts index 87869100..38e556c3 100644 --- a/libs/interchain-vue/src/ibc/core/connection/v1/tx.ts +++ b/libs/interchain-vue/src/ibc/core/connection/v1/tx.ts @@ -4,7 +4,6 @@ import { Height, HeightAmino, Params, ParamsAmino } from "../../client/v1/client import { BinaryReader, BinaryWriter } from "../../../../binary"; import { GlobalDecoderRegistry } from "../../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import { ComputedRef } from "vue"; /** * MsgConnectionOpenInit defines the msg sent by an account on Chain A to * initialize a connection with Chain B. @@ -16,13 +15,6 @@ export interface MsgConnectionOpenInit { delayPeriod: bigint; signer: string; } -export interface ReactiveMsgConnectionOpenInit { - clientId: ComputedRef; - counterparty: ComputedRef; - version?: ComputedRef; - delayPeriod: ComputedRef; - signer: ComputedRef; -} export interface MsgConnectionOpenInitProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit"; value: Uint8Array; @@ -47,7 +39,6 @@ export interface MsgConnectionOpenInitAminoMsg { * type. */ export interface MsgConnectionOpenInitResponse {} -export interface ReactiveMsgConnectionOpenInitResponse {} export interface MsgConnectionOpenInitResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse"; value: Uint8Array; @@ -96,21 +87,6 @@ export interface MsgConnectionOpenTry { /** @deprecated */ hostConsensusStateProof: Uint8Array; } -export interface ReactiveMsgConnectionOpenTry { - clientId: ComputedRef; - previousConnectionId: ComputedRef; - clientState?: ComputedRef; - counterparty: ComputedRef; - delayPeriod: ComputedRef; - counterpartyVersions: ComputedRef; - proofHeight: ComputedRef; - proofInit: ComputedRef; - proofClient: ComputedRef; - proofConsensus: ComputedRef; - consensusHeight: ComputedRef; - signer: ComputedRef; - hostConsensusStateProof: ComputedRef; -} export interface MsgConnectionOpenTryProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry"; value: Uint8Array; @@ -156,7 +132,6 @@ export interface MsgConnectionOpenTryAminoMsg { } /** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ export interface MsgConnectionOpenTryResponse {} -export interface ReactiveMsgConnectionOpenTryResponse {} export interface MsgConnectionOpenTryResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse"; value: Uint8Array; @@ -198,19 +173,6 @@ export interface MsgConnectionOpenAck { /** @deprecated */ hostConsensusStateProof: Uint8Array; } -export interface ReactiveMsgConnectionOpenAck { - connectionId: ComputedRef; - counterpartyConnectionId: ComputedRef; - version?: ComputedRef; - clientState?: ComputedRef; - proofHeight: ComputedRef; - proofTry: ComputedRef; - proofClient: ComputedRef; - proofConsensus: ComputedRef; - consensusHeight: ComputedRef; - signer: ComputedRef; - hostConsensusStateProof: ComputedRef; -} export interface MsgConnectionOpenAckProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck"; value: Uint8Array; @@ -252,7 +214,6 @@ export interface MsgConnectionOpenAckAminoMsg { } /** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ export interface MsgConnectionOpenAckResponse {} -export interface ReactiveMsgConnectionOpenAckResponse {} export interface MsgConnectionOpenAckResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse"; value: Uint8Array; @@ -274,12 +235,6 @@ export interface MsgConnectionOpenConfirm { proofHeight: Height; signer: string; } -export interface ReactiveMsgConnectionOpenConfirm { - connectionId: ComputedRef; - proofAck: ComputedRef; - proofHeight: ComputedRef; - signer: ComputedRef; -} export interface MsgConnectionOpenConfirmProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm"; value: Uint8Array; @@ -304,7 +259,6 @@ export interface MsgConnectionOpenConfirmAminoMsg { * response type. */ export interface MsgConnectionOpenConfirmResponse {} -export interface ReactiveMsgConnectionOpenConfirmResponse {} export interface MsgConnectionOpenConfirmResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse"; value: Uint8Array; @@ -329,10 +283,6 @@ export interface MsgUpdateParams { */ params: Params; } -export interface ReactiveMsgUpdateParams { - signer: ComputedRef; - params: ComputedRef; -} export interface MsgUpdateParamsProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgUpdateParams"; value: Uint8Array; @@ -354,7 +304,6 @@ export interface MsgUpdateParamsAminoMsg { } /** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ export interface MsgUpdateParamsResponse {} -export interface ReactiveMsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse"; value: Uint8Array; diff --git a/libs/interchain-vue/src/ibc/rpc.tx.ts b/libs/interchain-vue/src/ibc/rpc.tx.ts deleted file mode 100644 index 2252d0a5..00000000 --- a/libs/interchain-vue/src/ibc/rpc.tx.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - auth: { - v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - authz: { - v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - circuit: { - v1: new (await import("../cosmos/circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - consensus: { - v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - crisis: { - v1beta1: new (await import("../cosmos/crisis/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - evidence: { - v1beta1: new (await import("../cosmos/evidence/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - mint: { - v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - nft: { - v1beta1: new (await import("../cosmos/nft/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - slashing: { - v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - upgrade: { - v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - ibc: { - applications: { - transfer: { - v1: new (await import("./applications/transfer/v1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - core: { - channel: { - v1: new (await import("./core/channel/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - client: { - v1: new (await import("./core/client/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - connection: { - v1: new (await import("./core/connection/v1/tx.rpc.msg")).MsgClientImpl(rpc) - } - } - } -}); \ No newline at end of file diff --git a/libs/interchain-vue/src/injective/types/v1beta1/account.ts b/libs/interchain-vue/src/injective/types/v1beta1/account.ts index 5e15c851..cd39998b 100644 --- a/libs/interchain-vue/src/injective/types/v1beta1/account.ts +++ b/libs/interchain-vue/src/injective/types/v1beta1/account.ts @@ -2,7 +2,6 @@ import { BaseAccount, BaseAccountAmino } from "../../../cosmos/auth/v1beta1/auth import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { ComputedRef } from "vue"; /** * EthAccount implements the authtypes.AccountI interface and embeds an * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. @@ -11,10 +10,6 @@ export interface EthAccount { baseAccount?: BaseAccount; codeHash: Uint8Array; } -export interface ReactiveEthAccount { - baseAccount?: ComputedRef; - codeHash: ComputedRef; -} export interface EthAccountProtoMsg { typeUrl: "/injective.types.v1beta1.EthAccount"; value: Uint8Array; diff --git a/libs/interchain-vue/src/registry.ts b/libs/interchain-vue/src/registry.ts index 7356722f..1581e912 100644 --- a/libs/interchain-vue/src/registry.ts +++ b/libs/interchain-vue/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/tendermint/abci/types.ts b/libs/interchain-vue/src/tendermint/abci/types.ts index b7d76036..734c33b1 100644 --- a/libs/interchain-vue/src/tendermint/abci/types.ts +++ b/libs/interchain-vue/src/tendermint/abci/types.ts @@ -6,7 +6,6 @@ import { BlockIDFlag } from "../types/validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes, isSet } from "../../helpers"; -import { ComputedRef } from "vue"; export enum CheckTxType { NEW = 0, RECHECK = 1, @@ -295,24 +294,6 @@ export interface Request { verifyVoteExtension?: RequestVerifyVoteExtension; finalizeBlock?: RequestFinalizeBlock; } -export interface ReactiveRequest { - echo?: ComputedRef; - flush?: ComputedRef; - info?: ComputedRef; - initChain?: ComputedRef; - query?: ComputedRef; - checkTx?: ComputedRef; - commit?: ComputedRef; - listSnapshots?: ComputedRef; - offerSnapshot?: ComputedRef; - loadSnapshotChunk?: ComputedRef; - applySnapshotChunk?: ComputedRef; - prepareProposal?: ComputedRef; - processProposal?: ComputedRef; - extendVote?: ComputedRef; - verifyVoteExtension?: ComputedRef; - finalizeBlock?: ComputedRef; -} export interface RequestProtoMsg { typeUrl: "/tendermint.abci.Request"; value: Uint8Array; @@ -342,9 +323,6 @@ export interface RequestAminoMsg { export interface RequestEcho { message: string; } -export interface ReactiveRequestEcho { - message: ComputedRef; -} export interface RequestEchoProtoMsg { typeUrl: "/tendermint.abci.RequestEcho"; value: Uint8Array; @@ -357,7 +335,6 @@ export interface RequestEchoAminoMsg { value: RequestEchoAmino; } export interface RequestFlush {} -export interface ReactiveRequestFlush {} export interface RequestFlushProtoMsg { typeUrl: "/tendermint.abci.RequestFlush"; value: Uint8Array; @@ -373,12 +350,6 @@ export interface RequestInfo { p2pVersion: bigint; abciVersion: string; } -export interface ReactiveRequestInfo { - version: ComputedRef; - blockVersion: ComputedRef; - p2pVersion: ComputedRef; - abciVersion: ComputedRef; -} export interface RequestInfoProtoMsg { typeUrl: "/tendermint.abci.RequestInfo"; value: Uint8Array; @@ -401,14 +372,6 @@ export interface RequestInitChain { appStateBytes: Uint8Array; initialHeight: bigint; } -export interface ReactiveRequestInitChain { - time: ComputedRef; - chainId: ComputedRef; - consensusParams?: ComputedRef; - validators: ComputedRef; - appStateBytes: ComputedRef; - initialHeight: ComputedRef; -} export interface RequestInitChainProtoMsg { typeUrl: "/tendermint.abci.RequestInitChain"; value: Uint8Array; @@ -431,12 +394,6 @@ export interface RequestQuery { height: bigint; prove: boolean; } -export interface ReactiveRequestQuery { - data: ComputedRef; - path: ComputedRef; - height: ComputedRef; - prove: ComputedRef; -} export interface RequestQueryProtoMsg { typeUrl: "/tendermint.abci.RequestQuery"; value: Uint8Array; @@ -455,10 +412,6 @@ export interface RequestCheckTx { tx: Uint8Array; type: CheckTxType; } -export interface ReactiveRequestCheckTx { - tx: ComputedRef; - type: ComputedRef; -} export interface RequestCheckTxProtoMsg { typeUrl: "/tendermint.abci.RequestCheckTx"; value: Uint8Array; @@ -472,7 +425,6 @@ export interface RequestCheckTxAminoMsg { value: RequestCheckTxAmino; } export interface RequestCommit {} -export interface ReactiveRequestCommit {} export interface RequestCommitProtoMsg { typeUrl: "/tendermint.abci.RequestCommit"; value: Uint8Array; @@ -484,7 +436,6 @@ export interface RequestCommitAminoMsg { } /** lists available snapshots */ export interface RequestListSnapshots {} -export interface ReactiveRequestListSnapshots {} export interface RequestListSnapshotsProtoMsg { typeUrl: "/tendermint.abci.RequestListSnapshots"; value: Uint8Array; @@ -502,10 +453,6 @@ export interface RequestOfferSnapshot { /** light client-verified app hash for snapshot height */ appHash: Uint8Array; } -export interface ReactiveRequestOfferSnapshot { - snapshot?: ComputedRef; - appHash: ComputedRef; -} export interface RequestOfferSnapshotProtoMsg { typeUrl: "/tendermint.abci.RequestOfferSnapshot"; value: Uint8Array; @@ -527,11 +474,6 @@ export interface RequestLoadSnapshotChunk { format: number; chunk: number; } -export interface ReactiveRequestLoadSnapshotChunk { - height: ComputedRef; - format: ComputedRef; - chunk: ComputedRef; -} export interface RequestLoadSnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk"; value: Uint8Array; @@ -552,11 +494,6 @@ export interface RequestApplySnapshotChunk { chunk: Uint8Array; sender: string; } -export interface ReactiveRequestApplySnapshotChunk { - index: ComputedRef; - chunk: ComputedRef; - sender: ComputedRef; -} export interface RequestApplySnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.RequestApplySnapshotChunk"; value: Uint8Array; @@ -587,16 +524,6 @@ export interface RequestPrepareProposal { /** address of the public key of the validator proposing the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestPrepareProposal { - maxTxBytes: ComputedRef; - txs: ComputedRef; - localLastCommit: ComputedRef; - misbehavior: ComputedRef; - height: ComputedRef; - time: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestPrepareProposalProtoMsg { typeUrl: "/tendermint.abci.RequestPrepareProposal"; value: Uint8Array; @@ -633,16 +560,6 @@ export interface RequestProcessProposal { /** address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestProcessProposal { - txs: ComputedRef; - proposedLastCommit: ComputedRef; - misbehavior: ComputedRef; - hash: ComputedRef; - height: ComputedRef; - time: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestProcessProposalProtoMsg { typeUrl: "/tendermint.abci.RequestProcessProposal"; value: Uint8Array; @@ -678,16 +595,6 @@ export interface RequestExtendVote { /** address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestExtendVote { - hash: ComputedRef; - height: ComputedRef; - time: ComputedRef; - txs: ComputedRef; - proposedLastCommit: ComputedRef; - misbehavior: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestExtendVoteProtoMsg { typeUrl: "/tendermint.abci.RequestExtendVote"; value: Uint8Array; @@ -720,12 +627,6 @@ export interface RequestVerifyVoteExtension { height: bigint; voteExtension: Uint8Array; } -export interface ReactiveRequestVerifyVoteExtension { - hash: ComputedRef; - validatorAddress: ComputedRef; - height: ComputedRef; - voteExtension: ComputedRef; -} export interface RequestVerifyVoteExtensionProtoMsg { typeUrl: "/tendermint.abci.RequestVerifyVoteExtension"; value: Uint8Array; @@ -755,16 +656,6 @@ export interface RequestFinalizeBlock { /** proposer_address is the address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } -export interface ReactiveRequestFinalizeBlock { - txs: ComputedRef; - decidedLastCommit: ComputedRef; - misbehavior: ComputedRef; - hash: ComputedRef; - height: ComputedRef; - time: ComputedRef; - nextValidatorsHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface RequestFinalizeBlockProtoMsg { typeUrl: "/tendermint.abci.RequestFinalizeBlock"; value: Uint8Array; @@ -804,25 +695,6 @@ export interface Response { verifyVoteExtension?: ResponseVerifyVoteExtension; finalizeBlock?: ResponseFinalizeBlock; } -export interface ReactiveResponse { - exception?: ComputedRef; - echo?: ComputedRef; - flush?: ComputedRef; - info?: ComputedRef; - initChain?: ComputedRef; - query?: ComputedRef; - checkTx?: ComputedRef; - commit?: ComputedRef; - listSnapshots?: ComputedRef; - offerSnapshot?: ComputedRef; - loadSnapshotChunk?: ComputedRef; - applySnapshotChunk?: ComputedRef; - prepareProposal?: ComputedRef; - processProposal?: ComputedRef; - extendVote?: ComputedRef; - verifyVoteExtension?: ComputedRef; - finalizeBlock?: ComputedRef; -} export interface ResponseProtoMsg { typeUrl: "/tendermint.abci.Response"; value: Uint8Array; @@ -854,9 +726,6 @@ export interface ResponseAminoMsg { export interface ResponseException { error: string; } -export interface ReactiveResponseException { - error: ComputedRef; -} export interface ResponseExceptionProtoMsg { typeUrl: "/tendermint.abci.ResponseException"; value: Uint8Array; @@ -872,9 +741,6 @@ export interface ResponseExceptionAminoMsg { export interface ResponseEcho { message: string; } -export interface ReactiveResponseEcho { - message: ComputedRef; -} export interface ResponseEchoProtoMsg { typeUrl: "/tendermint.abci.ResponseEcho"; value: Uint8Array; @@ -887,7 +753,6 @@ export interface ResponseEchoAminoMsg { value: ResponseEchoAmino; } export interface ResponseFlush {} -export interface ReactiveResponseFlush {} export interface ResponseFlushProtoMsg { typeUrl: "/tendermint.abci.ResponseFlush"; value: Uint8Array; @@ -904,13 +769,6 @@ export interface ResponseInfo { lastBlockHeight: bigint; lastBlockAppHash: Uint8Array; } -export interface ReactiveResponseInfo { - data: ComputedRef; - version: ComputedRef; - appVersion: ComputedRef; - lastBlockHeight: ComputedRef; - lastBlockAppHash: ComputedRef; -} export interface ResponseInfoProtoMsg { typeUrl: "/tendermint.abci.ResponseInfo"; value: Uint8Array; @@ -931,11 +789,6 @@ export interface ResponseInitChain { validators: ValidatorUpdate[]; appHash: Uint8Array; } -export interface ReactiveResponseInitChain { - consensusParams?: ComputedRef; - validators: ComputedRef; - appHash: ComputedRef; -} export interface ResponseInitChainProtoMsg { typeUrl: "/tendermint.abci.ResponseInitChain"; value: Uint8Array; @@ -962,17 +815,6 @@ export interface ResponseQuery { height: bigint; codespace: string; } -export interface ReactiveResponseQuery { - code: ComputedRef; - log: ComputedRef; - info: ComputedRef; - index: ComputedRef; - key: ComputedRef; - value: ComputedRef; - proofOps?: ComputedRef; - height: ComputedRef; - codespace: ComputedRef; -} export interface ResponseQueryProtoMsg { typeUrl: "/tendermint.abci.ResponseQuery"; value: Uint8Array; @@ -1006,16 +848,6 @@ export interface ResponseCheckTx { events: Event[]; codespace: string; } -export interface ReactiveResponseCheckTx { - code: ComputedRef; - data: ComputedRef; - log: ComputedRef; - info: ComputedRef; - gasWanted: ComputedRef; - gasUsed: ComputedRef; - events: ComputedRef; - codespace: ComputedRef; -} export interface ResponseCheckTxProtoMsg { typeUrl: "/tendermint.abci.ResponseCheckTx"; value: Uint8Array; @@ -1039,9 +871,6 @@ export interface ResponseCheckTxAminoMsg { export interface ResponseCommit { retainHeight: bigint; } -export interface ReactiveResponseCommit { - retainHeight: ComputedRef; -} export interface ResponseCommitProtoMsg { typeUrl: "/tendermint.abci.ResponseCommit"; value: Uint8Array; @@ -1056,9 +885,6 @@ export interface ResponseCommitAminoMsg { export interface ResponseListSnapshots { snapshots: Snapshot[]; } -export interface ReactiveResponseListSnapshots { - snapshots: ComputedRef; -} export interface ResponseListSnapshotsProtoMsg { typeUrl: "/tendermint.abci.ResponseListSnapshots"; value: Uint8Array; @@ -1073,9 +899,6 @@ export interface ResponseListSnapshotsAminoMsg { export interface ResponseOfferSnapshot { result: ResponseOfferSnapshot_Result; } -export interface ReactiveResponseOfferSnapshot { - result: ComputedRef; -} export interface ResponseOfferSnapshotProtoMsg { typeUrl: "/tendermint.abci.ResponseOfferSnapshot"; value: Uint8Array; @@ -1090,9 +913,6 @@ export interface ResponseOfferSnapshotAminoMsg { export interface ResponseLoadSnapshotChunk { chunk: Uint8Array; } -export interface ReactiveResponseLoadSnapshotChunk { - chunk: ComputedRef; -} export interface ResponseLoadSnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk"; value: Uint8Array; @@ -1111,11 +931,6 @@ export interface ResponseApplySnapshotChunk { /** Chunk senders to reject and ban */ rejectSenders: string[]; } -export interface ReactiveResponseApplySnapshotChunk { - result: ComputedRef; - refetchChunks: ComputedRef; - rejectSenders: ComputedRef; -} export interface ResponseApplySnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk"; value: Uint8Array; @@ -1134,9 +949,6 @@ export interface ResponseApplySnapshotChunkAminoMsg { export interface ResponsePrepareProposal { txs: Uint8Array[]; } -export interface ReactiveResponsePrepareProposal { - txs: ComputedRef; -} export interface ResponsePrepareProposalProtoMsg { typeUrl: "/tendermint.abci.ResponsePrepareProposal"; value: Uint8Array; @@ -1151,9 +963,6 @@ export interface ResponsePrepareProposalAminoMsg { export interface ResponseProcessProposal { status: ResponseProcessProposal_ProposalStatus; } -export interface ReactiveResponseProcessProposal { - status: ComputedRef; -} export interface ResponseProcessProposalProtoMsg { typeUrl: "/tendermint.abci.ResponseProcessProposal"; value: Uint8Array; @@ -1168,9 +977,6 @@ export interface ResponseProcessProposalAminoMsg { export interface ResponseExtendVote { voteExtension: Uint8Array; } -export interface ReactiveResponseExtendVote { - voteExtension: ComputedRef; -} export interface ResponseExtendVoteProtoMsg { typeUrl: "/tendermint.abci.ResponseExtendVote"; value: Uint8Array; @@ -1185,9 +991,6 @@ export interface ResponseExtendVoteAminoMsg { export interface ResponseVerifyVoteExtension { status: ResponseVerifyVoteExtension_VerifyStatus; } -export interface ReactiveResponseVerifyVoteExtension { - status: ComputedRef; -} export interface ResponseVerifyVoteExtensionProtoMsg { typeUrl: "/tendermint.abci.ResponseVerifyVoteExtension"; value: Uint8Array; @@ -1218,13 +1021,6 @@ export interface ResponseFinalizeBlock { */ appHash: Uint8Array; } -export interface ReactiveResponseFinalizeBlock { - events: ComputedRef; - txResults: ComputedRef; - validatorUpdates: ComputedRef; - consensusParamUpdates?: ComputedRef; - appHash: ComputedRef; -} export interface ResponseFinalizeBlockProtoMsg { typeUrl: "/tendermint.abci.ResponseFinalizeBlock"; value: Uint8Array; @@ -1256,10 +1052,6 @@ export interface CommitInfo { round: number; votes: VoteInfo[]; } -export interface ReactiveCommitInfo { - round: ComputedRef; - votes: ComputedRef; -} export interface CommitInfoProtoMsg { typeUrl: "/tendermint.abci.CommitInfo"; value: Uint8Array; @@ -1286,10 +1078,6 @@ export interface ExtendedCommitInfo { */ votes: ExtendedVoteInfo[]; } -export interface ReactiveExtendedCommitInfo { - round: ComputedRef; - votes: ComputedRef; -} export interface ExtendedCommitInfoProtoMsg { typeUrl: "/tendermint.abci.ExtendedCommitInfo"; value: Uint8Array; @@ -1321,10 +1109,6 @@ export interface Event { type: string; attributes: EventAttribute[]; } -export interface ReactiveEvent { - type: ComputedRef; - attributes: ComputedRef; -} export interface EventProtoMsg { typeUrl: "/tendermint.abci.Event"; value: Uint8Array; @@ -1349,11 +1133,6 @@ export interface EventAttribute { /** nondeterministic */ index: boolean; } -export interface ReactiveEventAttribute { - key: ComputedRef; - value: ComputedRef; - index: ComputedRef; -} export interface EventAttributeProtoMsg { typeUrl: "/tendermint.abci.EventAttribute"; value: Uint8Array; @@ -1386,16 +1165,6 @@ export interface ExecTxResult { events: Event[]; codespace: string; } -export interface ReactiveExecTxResult { - code: ComputedRef; - data: ComputedRef; - log: ComputedRef; - info: ComputedRef; - gasWanted: ComputedRef; - gasUsed: ComputedRef; - events: ComputedRef; - codespace: ComputedRef; -} export interface ExecTxResultProtoMsg { typeUrl: "/tendermint.abci.ExecTxResult"; value: Uint8Array; @@ -1432,12 +1201,6 @@ export interface TxResult { tx: Uint8Array; result: ExecTxResult; } -export interface ReactiveTxResult { - height: ComputedRef; - index: ComputedRef; - tx: ComputedRef; - result: ComputedRef; -} export interface TxResultProtoMsg { typeUrl: "/tendermint.abci.TxResult"; value: Uint8Array; @@ -1463,10 +1226,6 @@ export interface Validator { /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ power: bigint; } -export interface ReactiveValidator { - address: ComputedRef; - power: ComputedRef; -} export interface ValidatorProtoMsg { typeUrl: "/tendermint.abci.Validator"; value: Uint8Array; @@ -1485,10 +1244,6 @@ export interface ValidatorUpdate { pubKey: PublicKey; power: bigint; } -export interface ReactiveValidatorUpdate { - pubKey: ComputedRef; - power: ComputedRef; -} export interface ValidatorUpdateProtoMsg { typeUrl: "/tendermint.abci.ValidatorUpdate"; value: Uint8Array; @@ -1505,10 +1260,6 @@ export interface VoteInfo { validator: Validator; blockIdFlag: BlockIDFlag; } -export interface ReactiveVoteInfo { - validator: ComputedRef; - blockIdFlag: ComputedRef; -} export interface VoteInfoProtoMsg { typeUrl: "/tendermint.abci.VoteInfo"; value: Uint8Array; @@ -1531,12 +1282,6 @@ export interface ExtendedVoteInfo { /** block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all */ blockIdFlag: BlockIDFlag; } -export interface ReactiveExtendedVoteInfo { - validator: ComputedRef; - voteExtension: ComputedRef; - extensionSignature: ComputedRef; - blockIdFlag: ComputedRef; -} export interface ExtendedVoteInfoProtoMsg { typeUrl: "/tendermint.abci.ExtendedVoteInfo"; value: Uint8Array; @@ -1570,13 +1315,6 @@ export interface Misbehavior { */ totalVotingPower: bigint; } -export interface ReactiveMisbehavior { - type: ComputedRef; - validator: ComputedRef; - height: ComputedRef; - time: ComputedRef; - totalVotingPower: ComputedRef; -} export interface MisbehaviorProtoMsg { typeUrl: "/tendermint.abci.Misbehavior"; value: Uint8Array; @@ -1612,13 +1350,6 @@ export interface Snapshot { /** Arbitrary application metadata */ metadata: Uint8Array; } -export interface ReactiveSnapshot { - height: ComputedRef; - format: ComputedRef; - chunks: ComputedRef; - hash: ComputedRef; - metadata: ComputedRef; -} export interface SnapshotProtoMsg { typeUrl: "/tendermint.abci.Snapshot"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/crypto/keys.ts b/libs/interchain-vue/src/tendermint/crypto/keys.ts index ad49df83..9dc8476b 100644 --- a/libs/interchain-vue/src/tendermint/crypto/keys.ts +++ b/libs/interchain-vue/src/tendermint/crypto/keys.ts @@ -1,16 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** PublicKey defines the keys available for use with Validators */ export interface PublicKey { ed25519?: Uint8Array; secp256k1?: Uint8Array; } -export interface ReactivePublicKey { - ed25519?: ComputedRef; - secp256k1?: ComputedRef; -} export interface PublicKeyProtoMsg { typeUrl: "/tendermint.crypto.PublicKey"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/crypto/proof.ts b/libs/interchain-vue/src/tendermint/crypto/proof.ts index f0d8f8de..5f372fcf 100644 --- a/libs/interchain-vue/src/tendermint/crypto/proof.ts +++ b/libs/interchain-vue/src/tendermint/crypto/proof.ts @@ -1,19 +1,12 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; export interface Proof { total: bigint; index: bigint; leafHash: Uint8Array; aunts: Uint8Array[]; } -export interface ReactiveProof { - total: ComputedRef; - index: ComputedRef; - leafHash: ComputedRef; - aunts: ComputedRef; -} export interface ProofProtoMsg { typeUrl: "/tendermint.crypto.Proof"; value: Uint8Array; @@ -34,10 +27,6 @@ export interface ValueOp { /** To encode in ProofOp.Data */ proof?: Proof; } -export interface ReactiveValueOp { - key: ComputedRef; - proof?: ComputedRef; -} export interface ValueOpProtoMsg { typeUrl: "/tendermint.crypto.ValueOp"; value: Uint8Array; @@ -57,11 +46,6 @@ export interface DominoOp { input: string; output: string; } -export interface ReactiveDominoOp { - key: ComputedRef; - input: ComputedRef; - output: ComputedRef; -} export interface DominoOpProtoMsg { typeUrl: "/tendermint.crypto.DominoOp"; value: Uint8Array; @@ -85,11 +69,6 @@ export interface ProofOp { key: Uint8Array; data: Uint8Array; } -export interface ReactiveProofOp { - type: ComputedRef; - key: ComputedRef; - data: ComputedRef; -} export interface ProofOpProtoMsg { typeUrl: "/tendermint.crypto.ProofOp"; value: Uint8Array; @@ -112,9 +91,6 @@ export interface ProofOpAminoMsg { export interface ProofOps { ops: ProofOp[]; } -export interface ReactiveProofOps { - ops: ComputedRef; -} export interface ProofOpsProtoMsg { typeUrl: "/tendermint.crypto.ProofOps"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/p2p/types.ts b/libs/interchain-vue/src/tendermint/p2p/types.ts index d071525a..038d2951 100644 --- a/libs/interchain-vue/src/tendermint/p2p/types.ts +++ b/libs/interchain-vue/src/tendermint/p2p/types.ts @@ -1,17 +1,11 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; export interface NetAddress { id: string; ip: string; port: number; } -export interface ReactiveNetAddress { - id: ComputedRef; - ip: ComputedRef; - port: ComputedRef; -} export interface NetAddressProtoMsg { typeUrl: "/tendermint.p2p.NetAddress"; value: Uint8Array; @@ -30,11 +24,6 @@ export interface ProtocolVersion { block: bigint; app: bigint; } -export interface ReactiveProtocolVersion { - p2p: ComputedRef; - block: ComputedRef; - app: ComputedRef; -} export interface ProtocolVersionProtoMsg { typeUrl: "/tendermint.p2p.ProtocolVersion"; value: Uint8Array; @@ -58,16 +47,6 @@ export interface DefaultNodeInfo { moniker: string; other: DefaultNodeInfoOther; } -export interface ReactiveDefaultNodeInfo { - protocolVersion: ComputedRef; - defaultNodeId: ComputedRef; - listenAddr: ComputedRef; - network: ComputedRef; - version: ComputedRef; - channels: ComputedRef; - moniker: ComputedRef; - other: ComputedRef; -} export interface DefaultNodeInfoProtoMsg { typeUrl: "/tendermint.p2p.DefaultNodeInfo"; value: Uint8Array; @@ -90,10 +69,6 @@ export interface DefaultNodeInfoOther { txIndex: string; rpcAddress: string; } -export interface ReactiveDefaultNodeInfoOther { - txIndex: ComputedRef; - rpcAddress: ComputedRef; -} export interface DefaultNodeInfoOtherProtoMsg { typeUrl: "/tendermint.p2p.DefaultNodeInfoOther"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/types/block.ts b/libs/interchain-vue/src/tendermint/types/block.ts index cf8af491..0c40690e 100644 --- a/libs/interchain-vue/src/tendermint/types/block.ts +++ b/libs/interchain-vue/src/tendermint/types/block.ts @@ -3,19 +3,12 @@ import { EvidenceList, EvidenceListAmino } from "./evidence"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial } from "../../helpers"; -import { ComputedRef } from "vue"; export interface Block { header: Header; data: Data; evidence: EvidenceList; lastCommit?: Commit; } -export interface ReactiveBlock { - header: ComputedRef
; - data: ComputedRef; - evidence: ComputedRef; - lastCommit?: ComputedRef; -} export interface BlockProtoMsg { typeUrl: "/tendermint.types.Block"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/types/evidence.ts b/libs/interchain-vue/src/tendermint/types/evidence.ts index 661b4f13..ad125f99 100644 --- a/libs/interchain-vue/src/tendermint/types/evidence.ts +++ b/libs/interchain-vue/src/tendermint/types/evidence.ts @@ -4,15 +4,10 @@ import { Validator, ValidatorAmino } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial, toTimestamp, fromTimestamp } from "../../helpers"; -import { ComputedRef } from "vue"; export interface Evidence { duplicateVoteEvidence?: DuplicateVoteEvidence; lightClientAttackEvidence?: LightClientAttackEvidence; } -export interface ReactiveEvidence { - duplicateVoteEvidence?: ComputedRef; - lightClientAttackEvidence?: ComputedRef; -} export interface EvidenceProtoMsg { typeUrl: "/tendermint.types.Evidence"; value: Uint8Array; @@ -33,13 +28,6 @@ export interface DuplicateVoteEvidence { validatorPower: bigint; timestamp: Date; } -export interface ReactiveDuplicateVoteEvidence { - voteA?: ComputedRef; - voteB?: ComputedRef; - totalVotingPower: ComputedRef; - validatorPower: ComputedRef; - timestamp: ComputedRef; -} export interface DuplicateVoteEvidenceProtoMsg { typeUrl: "/tendermint.types.DuplicateVoteEvidence"; value: Uint8Array; @@ -64,13 +52,6 @@ export interface LightClientAttackEvidence { totalVotingPower: bigint; timestamp: Date; } -export interface ReactiveLightClientAttackEvidence { - conflictingBlock?: ComputedRef; - commonHeight: ComputedRef; - byzantineValidators: ComputedRef; - totalVotingPower: ComputedRef; - timestamp: ComputedRef; -} export interface LightClientAttackEvidenceProtoMsg { typeUrl: "/tendermint.types.LightClientAttackEvidence"; value: Uint8Array; @@ -90,9 +71,6 @@ export interface LightClientAttackEvidenceAminoMsg { export interface EvidenceList { evidence: Evidence[]; } -export interface ReactiveEvidenceList { - evidence: ComputedRef; -} export interface EvidenceListProtoMsg { typeUrl: "/tendermint.types.EvidenceList"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/types/params.ts b/libs/interchain-vue/src/tendermint/types/params.ts index 16da8bfc..317e7b84 100644 --- a/libs/interchain-vue/src/tendermint/types/params.ts +++ b/libs/interchain-vue/src/tendermint/types/params.ts @@ -2,7 +2,6 @@ import { Duration, DurationAmino } from "../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial } from "../../helpers"; -import { ComputedRef } from "vue"; /** * ConsensusParams contains consensus critical parameters that determine the * validity of blocks. @@ -14,13 +13,6 @@ export interface ConsensusParams { version?: VersionParams; abci?: ABCIParams; } -export interface ReactiveConsensusParams { - block?: ComputedRef; - evidence?: ComputedRef; - validator?: ComputedRef; - version?: ComputedRef; - abci?: ComputedRef; -} export interface ConsensusParamsProtoMsg { typeUrl: "/tendermint.types.ConsensusParams"; value: Uint8Array; @@ -53,10 +45,6 @@ export interface BlockParams { */ maxGas: bigint; } -export interface ReactiveBlockParams { - maxBytes: ComputedRef; - maxGas: ComputedRef; -} export interface BlockParamsProtoMsg { typeUrl: "/tendermint.types.BlockParams"; value: Uint8Array; @@ -102,11 +90,6 @@ export interface EvidenceParams { */ maxBytes: bigint; } -export interface ReactiveEvidenceParams { - maxAgeNumBlocks: ComputedRef; - maxAgeDuration: ComputedRef; - maxBytes: ComputedRef; -} export interface EvidenceParamsProtoMsg { typeUrl: "/tendermint.types.EvidenceParams"; value: Uint8Array; @@ -146,9 +129,6 @@ export interface EvidenceParamsAminoMsg { export interface ValidatorParams { pubKeyTypes: string[]; } -export interface ReactiveValidatorParams { - pubKeyTypes: ComputedRef; -} export interface ValidatorParamsProtoMsg { typeUrl: "/tendermint.types.ValidatorParams"; value: Uint8Array; @@ -168,9 +148,6 @@ export interface ValidatorParamsAminoMsg { export interface VersionParams { app: bigint; } -export interface ReactiveVersionParams { - app: ComputedRef; -} export interface VersionParamsProtoMsg { typeUrl: "/tendermint.types.VersionParams"; value: Uint8Array; @@ -192,10 +169,6 @@ export interface HashedParams { blockMaxBytes: bigint; blockMaxGas: bigint; } -export interface ReactiveHashedParams { - blockMaxBytes: ComputedRef; - blockMaxGas: ComputedRef; -} export interface HashedParamsProtoMsg { typeUrl: "/tendermint.types.HashedParams"; value: Uint8Array; @@ -228,9 +201,6 @@ export interface ABCIParams { */ voteExtensionsEnableHeight: bigint; } -export interface ReactiveABCIParams { - voteExtensionsEnableHeight: ComputedRef; -} export interface ABCIParamsProtoMsg { typeUrl: "/tendermint.types.ABCIParams"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/types/types.ts b/libs/interchain-vue/src/tendermint/types/types.ts index 6863c83a..c44fd8af 100644 --- a/libs/interchain-vue/src/tendermint/types/types.ts +++ b/libs/interchain-vue/src/tendermint/types/types.ts @@ -5,7 +5,6 @@ import { BlockIDFlag, ValidatorSet, ValidatorSetAmino } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp, isSet } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** SignedMsgType is a type of signed message in the consensus. */ export enum SignedMsgType { SIGNED_MSG_TYPE_UNKNOWN = 0, @@ -57,10 +56,6 @@ export interface PartSetHeader { total: number; hash: Uint8Array; } -export interface ReactivePartSetHeader { - total: ComputedRef; - hash: ComputedRef; -} export interface PartSetHeaderProtoMsg { typeUrl: "/tendermint.types.PartSetHeader"; value: Uint8Array; @@ -79,11 +74,6 @@ export interface Part { bytes: Uint8Array; proof: Proof; } -export interface ReactivePart { - index: ComputedRef; - bytes: ComputedRef; - proof: ComputedRef; -} export interface PartProtoMsg { typeUrl: "/tendermint.types.Part"; value: Uint8Array; @@ -102,10 +92,6 @@ export interface BlockID { hash: Uint8Array; partSetHeader: PartSetHeader; } -export interface ReactiveBlockID { - hash: ComputedRef; - partSetHeader: ComputedRef; -} export interface BlockIDProtoMsg { typeUrl: "/tendermint.types.BlockID"; value: Uint8Array; @@ -147,22 +133,6 @@ export interface Header { /** original proposer of the block */ proposerAddress: Uint8Array; } -export interface ReactiveHeader { - version: ComputedRef; - chainId: ComputedRef; - height: ComputedRef; - time: ComputedRef; - lastBlockId: ComputedRef; - lastCommitHash: ComputedRef; - dataHash: ComputedRef; - validatorsHash: ComputedRef; - nextValidatorsHash: ComputedRef; - consensusHash: ComputedRef; - appHash: ComputedRef; - lastResultsHash: ComputedRef; - evidenceHash: ComputedRef; - proposerAddress: ComputedRef; -} export interface HeaderProtoMsg { typeUrl: "/tendermint.types.Header"; value: Uint8Array; @@ -208,9 +178,6 @@ export interface Data { */ txs: Uint8Array[]; } -export interface ReactiveData { - txs: ComputedRef; -} export interface DataProtoMsg { typeUrl: "/tendermint.types.Data"; value: Uint8Array; @@ -258,18 +225,6 @@ export interface Vote { */ extensionSignature: Uint8Array; } -export interface ReactiveVote { - type: ComputedRef; - height: ComputedRef; - round: ComputedRef; - blockId: ComputedRef; - timestamp: ComputedRef; - validatorAddress: ComputedRef; - validatorIndex: ComputedRef; - signature: ComputedRef; - extension: ComputedRef; - extensionSignature: ComputedRef; -} export interface VoteProtoMsg { typeUrl: "/tendermint.types.Vote"; value: Uint8Array; @@ -315,12 +270,6 @@ export interface Commit { blockId: BlockID; signatures: CommitSig[]; } -export interface ReactiveCommit { - height: ComputedRef; - round: ComputedRef; - blockId: ComputedRef; - signatures: ComputedRef; -} export interface CommitProtoMsg { typeUrl: "/tendermint.types.Commit"; value: Uint8Array; @@ -343,12 +292,6 @@ export interface CommitSig { timestamp: Date; signature: Uint8Array; } -export interface ReactiveCommitSig { - blockIdFlag: ComputedRef; - validatorAddress: ComputedRef; - timestamp: ComputedRef; - signature: ComputedRef; -} export interface CommitSigProtoMsg { typeUrl: "/tendermint.types.CommitSig"; value: Uint8Array; @@ -370,12 +313,6 @@ export interface ExtendedCommit { blockId: BlockID; extendedSignatures: ExtendedCommitSig[]; } -export interface ReactiveExtendedCommit { - height: ComputedRef; - round: ComputedRef; - blockId: ComputedRef; - extendedSignatures: ComputedRef; -} export interface ExtendedCommitProtoMsg { typeUrl: "/tendermint.types.ExtendedCommit"; value: Uint8Array; @@ -405,14 +342,6 @@ export interface ExtendedCommitSig { /** Vote extension signature */ extensionSignature: Uint8Array; } -export interface ReactiveExtendedCommitSig { - blockIdFlag: ComputedRef; - validatorAddress: ComputedRef; - timestamp: ComputedRef; - signature: ComputedRef; - extension: ComputedRef; - extensionSignature: ComputedRef; -} export interface ExtendedCommitSigProtoMsg { typeUrl: "/tendermint.types.ExtendedCommitSig"; value: Uint8Array; @@ -445,15 +374,6 @@ export interface Proposal { timestamp: Date; signature: Uint8Array; } -export interface ReactiveProposal { - type: ComputedRef; - height: ComputedRef; - round: ComputedRef; - polRound: ComputedRef; - blockId: ComputedRef; - timestamp: ComputedRef; - signature: ComputedRef; -} export interface ProposalProtoMsg { typeUrl: "/tendermint.types.Proposal"; value: Uint8Array; @@ -475,10 +395,6 @@ export interface SignedHeader { header?: Header; commit?: Commit; } -export interface ReactiveSignedHeader { - header?: ComputedRef
; - commit?: ComputedRef; -} export interface SignedHeaderProtoMsg { typeUrl: "/tendermint.types.SignedHeader"; value: Uint8Array; @@ -495,10 +411,6 @@ export interface LightBlock { signedHeader?: SignedHeader; validatorSet?: ValidatorSet; } -export interface ReactiveLightBlock { - signedHeader?: ComputedRef; - validatorSet?: ComputedRef; -} export interface LightBlockProtoMsg { typeUrl: "/tendermint.types.LightBlock"; value: Uint8Array; @@ -517,12 +429,6 @@ export interface BlockMeta { header: Header; numTxs: bigint; } -export interface ReactiveBlockMeta { - blockId: ComputedRef; - blockSize: ComputedRef; - header: ComputedRef
; - numTxs: ComputedRef; -} export interface BlockMetaProtoMsg { typeUrl: "/tendermint.types.BlockMeta"; value: Uint8Array; @@ -543,11 +449,6 @@ export interface TxProof { data: Uint8Array; proof?: Proof; } -export interface ReactiveTxProof { - rootHash: ComputedRef; - data: ComputedRef; - proof?: ComputedRef; -} export interface TxProofProtoMsg { typeUrl: "/tendermint.types.TxProof"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/types/validator.ts b/libs/interchain-vue/src/tendermint/types/validator.ts index 52f72f9d..f01b225a 100644 --- a/libs/interchain-vue/src/tendermint/types/validator.ts +++ b/libs/interchain-vue/src/tendermint/types/validator.ts @@ -2,7 +2,6 @@ import { PublicKey, PublicKeyAmino } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; import { GlobalDecoderRegistry } from "../../registry"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; -import { ComputedRef } from "vue"; /** BlockIdFlag indicates which BlockID the signature is for */ export enum BlockIDFlag { /** BLOCK_ID_FLAG_UNKNOWN - indicates an error condition */ @@ -55,11 +54,6 @@ export interface ValidatorSet { proposer?: Validator; totalVotingPower: bigint; } -export interface ReactiveValidatorSet { - validators: ComputedRef; - proposer?: ComputedRef; - totalVotingPower: ComputedRef; -} export interface ValidatorSetProtoMsg { typeUrl: "/tendermint.types.ValidatorSet"; value: Uint8Array; @@ -79,12 +73,6 @@ export interface Validator { votingPower: bigint; proposerPriority: bigint; } -export interface ReactiveValidator { - address: ComputedRef; - pubKey: ComputedRef; - votingPower: ComputedRef; - proposerPriority: ComputedRef; -} export interface ValidatorProtoMsg { typeUrl: "/tendermint.types.Validator"; value: Uint8Array; @@ -103,10 +91,6 @@ export interface SimpleValidator { pubKey?: PublicKey; votingPower: bigint; } -export interface ReactiveSimpleValidator { - pubKey?: ComputedRef; - votingPower: ComputedRef; -} export interface SimpleValidatorProtoMsg { typeUrl: "/tendermint.types.SimpleValidator"; value: Uint8Array; diff --git a/libs/interchain-vue/src/tendermint/version/types.ts b/libs/interchain-vue/src/tendermint/version/types.ts index 3a71c21d..824f3644 100644 --- a/libs/interchain-vue/src/tendermint/version/types.ts +++ b/libs/interchain-vue/src/tendermint/version/types.ts @@ -1,7 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { DeepPartial } from "../../helpers"; import { GlobalDecoderRegistry } from "../../registry"; -import { ComputedRef } from "vue"; /** * App includes the protocol and software version for the application. * This information is included in ResponseInfo. The App.Protocol can be @@ -11,10 +10,6 @@ export interface App { protocol: bigint; software: string; } -export interface ReactiveApp { - protocol: ComputedRef; - software: ComputedRef; -} export interface AppProtoMsg { typeUrl: "/tendermint.version.App"; value: Uint8Array; @@ -41,10 +36,6 @@ export interface Consensus { block: bigint; app: bigint; } -export interface ReactiveConsensus { - block: ComputedRef; - app: ComputedRef; -} export interface ConsensusProtoMsg { typeUrl: "/tendermint.version.Consensus"; value: Uint8Array; diff --git a/libs/interchain-vue/src/types.ts b/libs/interchain-vue/src/types.ts index 2bace856..cdcfbdf9 100644 --- a/libs/interchain-vue/src/types.ts +++ b/libs/interchain-vue/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/utf8.ts b/libs/interchain-vue/src/utf8.ts index c5dba8d6..c0f5c97c 100644 --- a/libs/interchain-vue/src/utf8.ts +++ b/libs/interchain-vue/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/varint.ts b/libs/interchain-vue/src/varint.ts index 95ef3b55..70a851bd 100644 --- a/libs/interchain-vue/src/varint.ts +++ b/libs/interchain-vue/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/vue-query.ts b/libs/interchain-vue/src/vue-query.ts index d37888af..867bd9f3 100644 --- a/libs/interchain-vue/src/vue-query.ts +++ b/libs/interchain-vue/src/vue-query.ts @@ -1,69 +1,122 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ + + + import { getRpcClient } from './extern' +import { + isRpc, + Rpc, +} from './helpers' +import { + ITxArgs, + ISigningClient, + StdFee, + DeliverTxResponse, + SigningClientResolver, + RpcResolver, + isISigningClient +} from './helper-func-types' import { useQuery, + useQueryClient, UseQueryOptions, + useMutation, + UseMutationOptions, + QueryKey, } from '@tanstack/vue-query'; -import { Ref, isRef } from 'vue' import { HttpEndpoint, ProtobufRpcClient } from '@cosmjs/stargate'; import { Tendermint34Client } from '@cosmjs/tendermint-rpc'; +import {Ref} from 'vue' + +export const DEFAULT_RPC_CLIENT_QUERY_KEY = 'rpcClient'; +export const DEFAULT_RPC_ENDPOINT_QUERY_KEY = 'rpcEndPoint'; +export const DEFAULT_SIGNING_CLIENT_QUERY_KEY = 'signingClient'; + +export interface CacheResolver { + rpcEndpoint?: string | HttpEndpoint; + clientQueryKey?: string; +} + +export function isCacheResolver(resolver: unknown): resolver is CacheResolver { + return ( + resolver !== null && + resolver !== undefined && + (resolver as CacheResolver).rpcEndpoint !== undefined && + (resolver as CacheResolver).clientQueryKey !== undefined + ); +} export interface VueQueryParams { - options?: Omit, 'queryKey'>; + options?: UseQueryOptions; } export interface UseRpcClientQuery extends VueQueryParams { - rpcEndpoint: Ref; + clientResolver?: CacheResolver; } export interface UseRpcEndpointQuery extends VueQueryParams { getter: () => Promise; + rpcEndPointKey?: string; + extraKey?: string } -export const useRpcEndpoint = ({ - getter, - options, -}: UseRpcEndpointQuery) => { - return useQuery({ - queryKey: ['rpcEndpoint', getter], - queryFn: async () => { - return await getter(); - }, - ...options - }) +export function useRpcEndpoint({ + getter, + options, + rpcEndPointKey, + extraKey, +}: UseRpcEndpointQuery) { + const key = rpcEndPointKey || DEFAULT_RPC_ENDPOINT_QUERY_KEY; + return useQuery( + { + queryKey: [key, extraKey], + queryFn: async () => { + return await getter(); + }, ...options + } + ); }; -export const useRpcClient = ({ - rpcEndpoint, - options, -}: UseRpcClientQuery) => { - let params = { - queryKey: ['rpcClient', rpcEndpoint], - queryFn: async () => { - return await getRpcClient(rpcEndpoint.value); - }, - }; - if (options && !isRef(options)) { - params = { - ...options, - ...params, - }; - } - return useQuery(params); -}; +export function useRpcClient({ + options, + clientResolver, +}: UseRpcClientQuery) { + const queryClient = useQueryClient(); + + const key = clientResolver?.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY; + return useQuery({ + queryKey: [key, clientResolver?.rpcEndpoint], + queryFn: async () => { + if (!clientResolver?.rpcEndpoint) { + throw new Error('rpcEndpoint is required'); + } + + const client = await getRpcClient(clientResolver.rpcEndpoint); + if (!client) { + throw new Error('Failed to connect to rpc client'); + } + + queryClient.setQueryData([key], client); + + return client; + }, + ...options + } + ); +} interface UseTendermintClient extends VueQueryParams { - rpcEndpoint: Ref; + rpcEndpoint: string | HttpEndpoint; } /** - * Hook that uses vue-query to cache a connected tendermint client. + * Function that uses vue-query to cache a connected tendermint client. */ export const useTendermintClient = ({ rpcEndpoint, @@ -71,12 +124,132 @@ export const useTendermintClient = ({ }: UseTendermintClient) => { const { data: client } = useQuery({ queryKey: ['client', 'tendermint', rpcEndpoint], - queryFn: () => Tendermint34Client.connect(rpcEndpoint.value), - // allow overriding - throwOnError: (e) => { - throw new Error(`Failed to connect to ${rpcEndpoint}` + '\n' + e) - }, - ...options, - }) - return { client } + queryFn: () => Tendermint34Client.connect(rpcEndpoint), + ...{ + // allow overriding + onError: (e: any) => { + throw new Error(`Failed to connect to ${rpcEndpoint}` + '\n' + e) + }, + ...options, + } + } + ); + return { client }; }; + +export interface UseQueryBuilderOptions { + builderQueryFn: ( + clientResolver?: RpcResolver + ) => (request: TReq) => Promise; + queryKeyPrefix: string; +} + +export function buildUseVueQuery( + opts: UseQueryBuilderOptions +) { + return function useBuiltQuery({ + request, + options, + clientResolver, + customizedQueryKey, + }: UseQueryParams) { + const queryClient = useQueryClient(); + let rpcResolver: RpcResolver | undefined; + if (isRpc(clientResolver)) { + rpcResolver = clientResolver; + + } else if (isCacheResolver(clientResolver)) { + const key = clientResolver.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY; + const queryKey = clientResolver.rpcEndpoint + ? [key, clientResolver.rpcEndpoint] + : [key]; + rpcResolver = queryClient.getQueryData(queryKey); + + if (!rpcResolver && clientResolver.rpcEndpoint) { + rpcResolver = clientResolver.rpcEndpoint; + } + } else { + rpcResolver = clientResolver; + + } + + const queryFn = opts.builderQueryFn(rpcResolver); + return useQuery({ + queryKey: customizedQueryKey || [opts.queryKeyPrefix, request], + queryFn: () => queryFn(request.value), + ...options + } + ); + }; +} + +export interface UseQueryParams + extends VueQueryParams { + request: Ref; + clientResolver?: CacheResolver | RpcResolver; + customizedQueryKey?: QueryKey; +} + +export interface VueMutationParams< + TData, + TError, + TVariables, + TContext = unknown +> { + options?: UseMutationOptions; + clientResolver?: CacheResolver | SigningClientResolver; +} + +export interface UseMutationBuilderOptions { + builderMutationFn: ( + clientResolver?: SigningClientResolver + ) => ( + signerAddress: string, + message: TMsg, + fee: StdFee | 'auto', + memo: string + ) => Promise; +} + +export function buildUseVueMutation( + opts: UseMutationBuilderOptions +) { + return function useBuiltMutation({ + options, + clientResolver, + }: VueMutationParams>) { + const queryClient = useQueryClient(); + + let signingClientResolver: SigningClientResolver | undefined; + + if (isISigningClient(clientResolver)) { + signingClientResolver = clientResolver; + } else if (isCacheResolver(clientResolver)) { + const key = + clientResolver.clientQueryKey || DEFAULT_SIGNING_CLIENT_QUERY_KEY; + const queryKey = clientResolver.rpcEndpoint + ? [key, clientResolver.rpcEndpoint] + : [key]; + signingClientResolver = queryClient.getQueryData( + queryKey + ); + } else { + clientResolver = clientResolver; + } + + const mutationFn = opts.builderMutationFn(signingClientResolver); + + return useMutation>( + { + mutationFn: (reqData: ITxArgs) => + mutationFn( + reqData.signerAddress, + reqData.message, + reqData.fee, + reqData.memo + ), + ...options + } + ); + }; +} diff --git a/libs/interchainjs/package.json b/libs/interchainjs/package.json index be36c031..8c0c3824 100644 --- a/libs/interchainjs/package.json +++ b/libs/interchainjs/package.json @@ -39,12 +39,6 @@ "@noble/hashes": "^1.3.1", "decimal.js": "^10.4.3" }, - "devDependencies": { - "@tanstack/react-query": "4.29.1" - }, - "peerDependencies": { - "@tanstack/react-query": "4.29.1" - }, "keywords": [ "cosmos", "blockchain", diff --git a/libs/interchainjs/src/binary.ts b/libs/interchainjs/src/binary.ts index 2eaa6cb6..e6922501 100644 --- a/libs/interchainjs/src/binary.ts +++ b/libs/interchainjs/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/extern.ts b/libs/interchainjs/src/extern.ts index 86edda83..eddf067e 100644 --- a/libs/interchainjs/src/extern.ts +++ b/libs/interchainjs/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/helper-func-types.ts b/libs/interchainjs/src/helper-func-types.ts index 7abfde29..7aeeb7bc 100644 --- a/libs/interchainjs/src/helper-func-types.ts +++ b/libs/interchainjs/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/helpers.ts b/libs/interchainjs/src/helpers.ts index 64d3444c..ba68bbdb 100644 --- a/libs/interchainjs/src/helpers.ts +++ b/libs/interchainjs/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/registry.ts b/libs/interchainjs/src/registry.ts index 7356722f..1581e912 100644 --- a/libs/interchainjs/src/registry.ts +++ b/libs/interchainjs/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/types.ts b/libs/interchainjs/src/types.ts index 2bace856..cdcfbdf9 100644 --- a/libs/interchainjs/src/types.ts +++ b/libs/interchainjs/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/utf8.ts b/libs/interchainjs/src/utf8.ts index c5dba8d6..c0f5c97c 100644 --- a/libs/interchainjs/src/utf8.ts +++ b/libs/interchainjs/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/varint.ts b/libs/interchainjs/src/varint.ts index 95ef3b55..70a851bd 100644 --- a/libs/interchainjs/src/varint.ts +++ b/libs/interchainjs/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/package.json b/package.json index 6ad74ef8..855ffb39 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,14 @@ "libs/*" ], "scripts": { - "codegen": "yarn codegen:ic && yarn codegen:inj", + "codegen": "yarn clean:codegen && yarn codegen:types && yarn codegen:ic && yarn codegen:inj", "codegen:ic": "telescope transpile --config ./scripts/interchainjs.telescope.json && telescope transpile --config ./scripts/interchain-react.telescope.json && telescope transpile --config ./scripts/interchain-vue.telescope.json", "codegen:inj": "telescope transpile --config ./scripts/inj.telescope.json && telescope transpile --config ./scripts/inj-react.telescope.json && telescope transpile --config ./scripts/inj-vue.telescope.json", "codegen:types": "telescope transpile --config ./scripts/cosmos-types.telescope.json", "proto": "telescope download --config ./scripts/.protod.config.json && telescope download --config ./scripts/.injective.protod.config.json", "test": "lerna run test --stream", "clean": "lerna run clean", + "clean:codegen": "rimraf libs/*/src", "clean:modules": "find . -name 'node_modules' -type d -prune -print | xargs rm -rf", "bootstrap": "lerna bootstrap", "build": "lerna run build --stream", @@ -34,7 +35,7 @@ "@chain-registry/client": "1.18.1", "@confio/relayer": "^0.12.0", "@cosmjs/crypto": "^0.32.2", - "@cosmology/telescope": "^1.11.8", + "@cosmology/telescope": "^1.11.12", "@injectivelabs/networks": "^1.14.13", "@injectivelabs/sdk-ts": "^1.14.13", "@injectivelabs/wallet-ts": "^1.14.13", diff --git a/scripts/cosmos-types.telescope.json b/scripts/cosmos-types.telescope.json index 77b84031..5d8322b5 100644 --- a/scripts/cosmos-types.telescope.json +++ b/scripts/cosmos-types.telescope.json @@ -77,9 +77,8 @@ "rpcClients": { "enabled": false }, - "helperFuncCreators": { - "enabled": true, - "genCustomHooks": false + "helperFunctions": { + "enabled": true }, "interfaces": { "enabled": false, diff --git a/scripts/inj-react.telescope.json b/scripts/inj-react.telescope.json index 35d8dcc7..d5180002 100644 --- a/scripts/inj-react.telescope.json +++ b/scripts/inj-react.telescope.json @@ -58,10 +58,13 @@ "rpcClients": { "enabled": false }, - "helperFuncCreators": { + "helperFunctions": { "enabled": true, "useGlobalDecoderRegistry": true, - "genCustomHooks": true + "hooks": { + "react": true, + "vue": false + } }, "interfaces": { "enabled": true, diff --git a/scripts/inj-vue.telescope.json b/scripts/inj-vue.telescope.json index b34e4786..bfc3e79c 100644 --- a/scripts/inj-vue.telescope.json +++ b/scripts/inj-vue.telescope.json @@ -56,10 +56,14 @@ "enabled": false }, "rpcClients": { - "enabled": true + "enabled": false }, - "vueQuery": { - "enabled": true + "helperFunctions": { + "enabled": true, + "hooks": { + "react": false, + "vue": true + } }, "interfaces": { "enabled": true, diff --git a/scripts/inj.telescope.json b/scripts/inj.telescope.json index 895fd0be..b6d7fc82 100644 --- a/scripts/inj.telescope.json +++ b/scripts/inj.telescope.json @@ -58,10 +58,13 @@ "rpcClients": { "enabled": false }, - "helperFuncCreators": { + "helperFunctions": { "enabled": true, "useGlobalDecoderRegistry": true, - "genCustomHooks": false + "hooks": { + "react": false, + "vue": false + } }, "interfaces": { "enabled": true, diff --git a/scripts/interchain-react.telescope.json b/scripts/interchain-react.telescope.json index ac1e1559..359410a1 100644 --- a/scripts/interchain-react.telescope.json +++ b/scripts/interchain-react.telescope.json @@ -58,10 +58,13 @@ "rpcClients": { "enabled": false }, - "helperFuncCreators": { + "helperFunctions": { "enabled": true, "useGlobalDecoderRegistry": true, - "genCustomHooks": true + "hooks": { + "react": true, + "vue": false + } }, "interfaces": { "enabled": true, diff --git a/scripts/interchain-vue.telescope.json b/scripts/interchain-vue.telescope.json index 0aa4072c..b020ea0d 100644 --- a/scripts/interchain-vue.telescope.json +++ b/scripts/interchain-vue.telescope.json @@ -56,10 +56,14 @@ "enabled": false }, "rpcClients": { - "enabled": true + "enabled": false }, - "vueQuery": { - "enabled": true + "helperFunctions": { + "enabled": true, + "hooks": { + "react": false, + "vue": true + } }, "interfaces": { "enabled": true, diff --git a/scripts/interchainjs.telescope.json b/scripts/interchainjs.telescope.json index 538f46d7..da2a87cf 100644 --- a/scripts/interchainjs.telescope.json +++ b/scripts/interchainjs.telescope.json @@ -58,10 +58,13 @@ "rpcClients": { "enabled": false }, - "helperFuncCreators": { + "helperFunctions": { "enabled": true, "useGlobalDecoderRegistry": true, - "genCustomHooks": false + "hooks": { + "react": false, + "vue": false + } }, "interfaces": { "enabled": true, diff --git a/yarn.lock b/yarn.lock index 78fcde42..b52e9580 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1719,25 +1719,25 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.4.tgz#a9a717c9fd7b1984d9cefdd0ef6c6f254060c671" integrity sha512-D1Yc+Zy8oL/hkUkFUL/bwxvuDBzRGpc4cF7/SkdhxX4iHpSLgdOuTt1mhCh9+kl6NQREy9t7SYZ6xeW5gFe60w== -"@cosmology/ast@^1.9.3": - version "1.9.3" - resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.9.3.tgz#682698684fb0d6f6386e968f8973485b586a624d" - integrity sha512-9/tNleALWXDeFJNrU11mqfusQ/B6HuibVvtGjjWmBWE9EIoK9MfmnJ0VRvKvfcnHczGkh5zD2cqE8LZ0T9mYYQ== +"@cosmology/ast@^1.9.6": + version "1.9.6" + resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.9.6.tgz#9dafe254a5c778f22b64094787dd87676b3dfcf4" + integrity sha512-f+6HTLbcP1oTmFZZaiHaZropb0ci7JXsA19uj03dLaInYqp6ZUmeYQjxONEpmWBgshL2IlJrF08lliqTu7H4cQ== dependencies: "@babel/types" "7.23.6" - "@cosmology/types" "^1.11.2" - "@cosmology/utils" "^1.9.2" + "@cosmology/types" "^1.11.5" + "@cosmology/utils" "^1.9.5" case "1.6.3" dotty "0.1.2" -"@cosmology/proto-parser@^1.9.2": - version "1.9.2" - resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.9.2.tgz#76e7ace6540076a3a29ef4fde18c1c76cfc5e5b8" - integrity sha512-ek+OC4QtXr1Jfio43v3B3xrvzspLzs9qe6Igt6tx2OUja4ns3IbeRrwcOA53dHKMxdE1JpDWxCgpwkVEVpMJXQ== +"@cosmology/proto-parser@^1.9.5": + version "1.9.5" + resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.9.5.tgz#17e7123e0aef8ec0bdbd59594a6f5f88a38cc239" + integrity sha512-659IOXVyArAVc0NH6U8m9r4qX/QbKJVaykUghwctoOYOd8JdIezTLEb505ERUT2UDsa9ir3zKdvlhk+2dKpkog== dependencies: "@cosmology/protobufjs" "7.3.2" - "@cosmology/types" "^1.11.2" - "@cosmology/utils" "^1.9.2" + "@cosmology/types" "^1.11.5" + "@cosmology/utils" "^1.9.5" dotty "0.1.2" fast-json-patch "3.1.1" glob "8.0.3" @@ -1763,19 +1763,19 @@ "@types/node" ">=13.7.0" long "^5.0.0" -"@cosmology/telescope@^1.11.8": - version "1.11.8" - resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.11.8.tgz#f69a399d10a7b1bedfc12d3abc201ffe24cfbbd6" - integrity sha512-Q2bgSVkqTf9X9obRsmL3wreQ7f79iDGb6EUPjv3AJNe+3XmNLAsOUnNMb/gDB8FZHLdznYEfkmXLlfs8Z1l14A== +"@cosmology/telescope@^1.11.12": + version "1.11.12" + resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.11.12.tgz#26945657223edadd4ac8d505351e70854a3d330b" + integrity sha512-FLtaQuwVZwMbMbFdIdFQNgGiywG3DZtVM2ebICyavSMZKuEPuH1vYKws6XF7utj+et1LNamHUsTusRE9GxmotQ== dependencies: "@babel/generator" "^7.23.6" "@babel/parser" "^7.23.6" "@babel/traverse" "7.23.6" "@babel/types" "7.23.6" - "@cosmology/ast" "^1.9.3" - "@cosmology/proto-parser" "^1.9.2" - "@cosmology/types" "^1.11.2" - "@cosmology/utils" "^1.9.2" + "@cosmology/ast" "^1.9.6" + "@cosmology/proto-parser" "^1.9.5" + "@cosmology/types" "^1.11.5" + "@cosmology/utils" "^1.9.5" "@cosmwasm/ts-codegen" "0.35.7" "@types/parse-package-name" "0.1.0" case "1.6.3" @@ -1793,20 +1793,20 @@ rimraf "5.0.0" yaml "^2.3.4" -"@cosmology/types@^1.11.2": - version "1.11.2" - resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.11.2.tgz#ec8d451d16bb841fd1f9325dd52f9ef3a61f4f1e" - integrity sha512-FyHmHZ0hCb2CyIS95nS7yGQKxIcxm8yWyvupNkSNl6vQm1GmebPJwgRe85nAcRygxTEJ/tT9FiT/Ww9N/mdiqA== +"@cosmology/types@^1.11.5": + version "1.11.5" + resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.11.5.tgz#e57bd9d4ebd233ae559173c7c763f44700374cd4" + integrity sha512-sW8N3m0UNL1SkOTbqm7FtWkEEThGE6g6VGqfnzY6oCSXaWPK5YJodpUgMrTmZ1TloxiwcEPBip+kCuU9nT99vw== dependencies: case "1.6.3" fast-json-patch "3.1.1" -"@cosmology/utils@^1.9.2": - version "1.9.2" - resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.9.2.tgz#265bb1ebf12054ae0a88498e85eab46c4f38f398" - integrity sha512-P1Ytn/90FCENtIHrtUIz+TcLpSAf6euSf6nK6OT0AH7Zs5T/ypsWC6Qkb2z2OV785eu0QKHv+V7nvi3tJ1k49w== +"@cosmology/utils@^1.9.5": + version "1.9.5" + resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.9.5.tgz#90f073cdd5940e498750589491089e870349f878" + integrity sha512-w/16F2Sa7+OdAg42J0cHF7h7T1nVOTmOKawcGMt1M6jsOtNNKOl+BBfbiFiR/sD2naHPDTuv/aVSFrkDf9QbNg== dependencies: - "@cosmology/types" "^1.11.2" + "@cosmology/types" "^1.11.5" dotty "0.1.2" "@cosmostation/extension-client@^0.1.15": From e6e8a856688f4b7dbc86d4d9679e66efab661e7c Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 27 Jan 2025 07:59:23 +0800 Subject: [PATCH 2/3] upgrade telescope and regen --- libs/cosmos-types/src/binary.ts | 2 +- libs/cosmos-types/src/extern.ts | 2 +- libs/cosmos-types/src/helper-func-types.ts | 2 +- libs/cosmos-types/src/helpers.ts | 2 +- libs/cosmos-types/src/types.ts | 2 +- libs/cosmos-types/src/utf8.ts | 2 +- libs/cosmos-types/src/varint.ts | 2 +- libs/injective-react/src/binary.ts | 2 +- .../src/cosmos/auth/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/authz/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/bank/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/bank/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/distribution/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/feegrant/v1beta1/tx.rpc.react.ts | 2 +- libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts | 2 +- .../src/cosmos/gov/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/gov/v1beta1/tx.rpc.react.ts | 2 +- libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts | 2 +- .../src/cosmos/staking/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/staking/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/tx/v1beta1/service.rpc.react.ts | 2 +- .../src/cosmos/vesting/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmwasm/wasm/v1/query.rpc.react.ts | 2 +- libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts | 2 +- libs/injective-react/src/extern.ts | 2 +- libs/injective-react/src/helper-func-types.ts | 2 +- libs/injective-react/src/helpers.ts | 2 +- .../src/ibc/applications/transfer/v1/tx.rpc.react.ts | 2 +- .../src/ibc/core/channel/v1/tx.rpc.react.ts | 2 +- .../src/ibc/core/client/v1/tx.rpc.react.ts | 2 +- .../src/ibc/core/connection/v1/tx.rpc.react.ts | 2 +- .../src/injective/auction/v1beta1/query.rpc.react.ts | 2 +- .../src/injective/auction/v1beta1/tx.rpc.react.ts | 2 +- .../src/injective/exchange/v1beta1/query.rpc.react.ts | 2 +- .../src/injective/exchange/v1beta1/tx.rpc.react.ts | 2 +- .../src/injective/insurance/v1beta1/query.rpc.react.ts | 2 +- .../src/injective/insurance/v1beta1/tx.rpc.react.ts | 2 +- .../src/injective/ocr/v1beta1/query.rpc.react.ts | 2 +- .../src/injective/ocr/v1beta1/tx.rpc.react.ts | 2 +- .../src/injective/oracle/v1beta1/query.rpc.react.ts | 2 +- .../src/injective/oracle/v1beta1/tx.rpc.react.ts | 2 +- .../src/injective/peggy/v1/msgs.rpc.react.ts | 2 +- .../src/injective/peggy/v1/query.rpc.react.ts | 2 +- .../src/injective/permissions/v1beta1/query.rpc.react.ts | 2 +- .../src/injective/permissions/v1beta1/tx.rpc.react.ts | 2 +- .../src/injective/tokenfactory/v1beta1/query.rpc.react.ts | 2 +- .../src/injective/tokenfactory/v1beta1/tx.rpc.react.ts | 2 +- .../src/injective/wasmx/v1/query.rpc.react.ts | 2 +- .../src/injective/wasmx/v1/tx.rpc.react.ts | 2 +- libs/injective-react/src/react-query.ts | 2 +- libs/injective-react/src/registry.ts | 2 +- libs/injective-react/src/types.ts | 2 +- libs/injective-react/src/utf8.ts | 2 +- libs/injective-react/src/varint.ts | 2 +- libs/injective-vue/src/binary.ts | 2 +- .../src/cosmos/auth/v1beta1/query.rpc.vue.ts | 2 +- libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/bank/v1beta1/query.rpc.vue.ts | 2 +- libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/distribution/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts | 2 +- .../injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts | 2 +- libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts | 2 +- .../src/cosmos/staking/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/staking/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/tx/v1beta1/service.rpc.vue.ts | 2 +- .../src/cosmos/vesting/v1beta1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts | 2 +- libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/extern.ts | 2 +- libs/injective-vue/src/helper-func-types.ts | 2 +- libs/injective-vue/src/helpers.ts | 2 +- .../src/ibc/applications/transfer/v1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts | 2 +- .../src/ibc/core/connection/v1/tx.rpc.vue.ts | 2 +- .../src/injective/auction/v1beta1/query.rpc.vue.ts | 2 +- .../src/injective/auction/v1beta1/tx.rpc.vue.ts | 2 +- .../src/injective/exchange/v1beta1/query.rpc.vue.ts | 2 +- .../src/injective/exchange/v1beta1/tx.rpc.vue.ts | 2 +- .../src/injective/insurance/v1beta1/query.rpc.vue.ts | 2 +- .../src/injective/insurance/v1beta1/tx.rpc.vue.ts | 2 +- .../src/injective/ocr/v1beta1/query.rpc.vue.ts | 2 +- .../injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts | 2 +- .../src/injective/oracle/v1beta1/query.rpc.vue.ts | 2 +- .../src/injective/oracle/v1beta1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts | 2 +- .../injective-vue/src/injective/peggy/v1/query.rpc.vue.ts | 2 +- .../src/injective/permissions/v1beta1/query.rpc.vue.ts | 2 +- .../src/injective/permissions/v1beta1/tx.rpc.vue.ts | 2 +- .../src/injective/tokenfactory/v1beta1/query.rpc.vue.ts | 2 +- .../src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts | 2 +- .../injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts | 2 +- libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts | 2 +- libs/injective-vue/src/registry.ts | 2 +- libs/injective-vue/src/types.ts | 2 +- libs/injective-vue/src/utf8.ts | 2 +- libs/injective-vue/src/varint.ts | 2 +- libs/injective-vue/src/vue-query.ts | 4 ++-- libs/injectivejs/src/binary.ts | 2 +- libs/injectivejs/src/extern.ts | 2 +- libs/injectivejs/src/helper-func-types.ts | 2 +- libs/injectivejs/src/helpers.ts | 2 +- libs/injectivejs/src/registry.ts | 2 +- libs/injectivejs/src/types.ts | 2 +- libs/injectivejs/src/utf8.ts | 2 +- libs/injectivejs/src/varint.ts | 2 +- libs/interchain-react/src/binary.ts | 2 +- .../src/cosmos/app/v1alpha1/query.rpc.react.ts | 2 +- .../src/cosmos/auth/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/auth/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/authz/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/authz/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/autocli/v1/query.rpc.react.ts | 2 +- .../src/cosmos/bank/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/bank/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/base/grpc/v2/service.rpc.react.ts | 2 +- .../src/cosmos/base/node/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/base/node/v2/query.rpc.react.ts | 2 +- .../base/reflection/v1beta1/reflection.rpc.react.ts | 2 +- .../base/reflection/v2alpha1/reflection.rpc.react.ts | 2 +- .../src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/circuit/v1/query.rpc.react.ts | 2 +- .../src/cosmos/circuit/v1/tx.rpc.react.ts | 2 +- .../src/cosmos/consensus/v1/query.rpc.react.ts | 2 +- .../src/cosmos/consensus/v1/tx.rpc.react.ts | 2 +- .../src/cosmos/crisis/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/distribution/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/distribution/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/evidence/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/evidence/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/feegrant/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/feegrant/v1beta1/tx.rpc.react.ts | 2 +- .../interchain-react/src/cosmos/gov/v1/query.rpc.react.ts | 2 +- libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts | 2 +- .../src/cosmos/gov/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/gov/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/group/v1/query.rpc.react.ts | 2 +- libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts | 2 +- .../src/cosmos/mint/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/mint/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/nft/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/nft/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/orm/query/v1alpha1/query.rpc.react.ts | 2 +- .../src/cosmos/params/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/reflection/v1/reflection.rpc.react.ts | 2 +- .../src/cosmos/slashing/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/slashing/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/staking/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/staking/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/tx/v1beta1/service.rpc.react.ts | 2 +- .../src/cosmos/upgrade/v1beta1/query.rpc.react.ts | 2 +- .../src/cosmos/upgrade/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmos/vesting/v1beta1/tx.rpc.react.ts | 2 +- .../src/cosmwasm/wasm/v1/query.rpc.react.ts | 2 +- .../interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts | 2 +- libs/interchain-react/src/extern.ts | 2 +- libs/interchain-react/src/helper-func-types.ts | 2 +- libs/interchain-react/src/helpers.ts | 2 +- .../src/ibc/applications/transfer/v1/tx.rpc.react.ts | 2 +- .../src/ibc/core/channel/v1/tx.rpc.react.ts | 2 +- .../src/ibc/core/client/v1/tx.rpc.react.ts | 2 +- .../src/ibc/core/connection/v1/tx.rpc.react.ts | 2 +- libs/interchain-react/src/react-query.ts | 2 +- libs/interchain-react/src/registry.ts | 2 +- libs/interchain-react/src/types.ts | 2 +- libs/interchain-react/src/utf8.ts | 2 +- libs/interchain-react/src/varint.ts | 2 +- libs/interchain-vue/src/binary.ts | 2 +- .../src/cosmos/app/v1alpha1/query.rpc.vue.ts | 2 +- .../src/cosmos/auth/v1beta1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/authz/v1beta1/query.rpc.vue.ts | 2 +- .../interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts | 2 +- .../interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts | 2 +- .../src/cosmos/bank/v1beta1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/base/grpc/v2/service.rpc.vue.ts | 2 +- .../src/cosmos/base/node/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/base/node/v2/query.rpc.vue.ts | 2 +- .../cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts | 2 +- .../cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts | 2 +- .../src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts | 2 +- .../interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts | 2 +- .../src/cosmos/consensus/v1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts | 2 +- .../src/cosmos/crisis/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/distribution/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/distribution/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/evidence/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/evidence/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/feegrant/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts | 2 +- .../src/cosmos/gov/v1beta1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts | 2 +- .../src/cosmos/mint/v1beta1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/nft/v1beta1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts | 2 +- .../src/cosmos/params/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/reflection/v1/reflection.rpc.vue.ts | 2 +- .../src/cosmos/slashing/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/slashing/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/staking/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/staking/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/tx/v1beta1/service.rpc.vue.ts | 2 +- .../src/cosmos/upgrade/v1beta1/query.rpc.vue.ts | 2 +- .../src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts | 2 +- .../src/cosmos/vesting/v1beta1/tx.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts | 2 +- libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts | 2 +- libs/interchain-vue/src/extern.ts | 2 +- libs/interchain-vue/src/helper-func-types.ts | 2 +- libs/interchain-vue/src/helpers.ts | 2 +- .../src/ibc/applications/transfer/v1/tx.rpc.vue.ts | 2 +- libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts | 2 +- libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts | 2 +- .../src/ibc/core/connection/v1/tx.rpc.vue.ts | 2 +- libs/interchain-vue/src/registry.ts | 2 +- libs/interchain-vue/src/types.ts | 2 +- libs/interchain-vue/src/utf8.ts | 2 +- libs/interchain-vue/src/varint.ts | 2 +- libs/interchain-vue/src/vue-query.ts | 4 ++-- libs/interchainjs/src/binary.ts | 2 +- libs/interchainjs/src/extern.ts | 2 +- libs/interchainjs/src/helper-func-types.ts | 2 +- libs/interchainjs/src/helpers.ts | 2 +- libs/interchainjs/src/registry.ts | 2 +- libs/interchainjs/src/types.ts | 2 +- libs/interchainjs/src/utf8.ts | 2 +- libs/interchainjs/src/varint.ts | 2 +- package.json | 2 +- yarn.lock | 8 ++++---- 241 files changed, 246 insertions(+), 246 deletions(-) diff --git a/libs/cosmos-types/src/binary.ts b/libs/cosmos-types/src/binary.ts index e6922501..15b28924 100644 --- a/libs/cosmos-types/src/binary.ts +++ b/libs/cosmos-types/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/extern.ts b/libs/cosmos-types/src/extern.ts index eddf067e..31da6877 100644 --- a/libs/cosmos-types/src/extern.ts +++ b/libs/cosmos-types/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/helper-func-types.ts b/libs/cosmos-types/src/helper-func-types.ts index 4f82736b..52876789 100644 --- a/libs/cosmos-types/src/helper-func-types.ts +++ b/libs/cosmos-types/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/helpers.ts b/libs/cosmos-types/src/helpers.ts index ba68bbdb..b6fb6c90 100644 --- a/libs/cosmos-types/src/helpers.ts +++ b/libs/cosmos-types/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/types.ts b/libs/cosmos-types/src/types.ts index cdcfbdf9..f3785169 100644 --- a/libs/cosmos-types/src/types.ts +++ b/libs/cosmos-types/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/utf8.ts b/libs/cosmos-types/src/utf8.ts index c0f5c97c..c8c688c2 100644 --- a/libs/cosmos-types/src/utf8.ts +++ b/libs/cosmos-types/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/varint.ts b/libs/cosmos-types/src/varint.ts index 70a851bd..3f1ff3be 100644 --- a/libs/cosmos-types/src/varint.ts +++ b/libs/cosmos-types/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/binary.ts b/libs/injective-react/src/binary.ts index e6922501..15b28924 100644 --- a/libs/injective-react/src/binary.ts +++ b/libs/injective-react/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts index f1ddc500..e52da586 100644 --- a/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; -import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func"; export const useGetAccounts = buildUseQuery({ builderQueryFn: createGetAccounts, queryKeyPrefix: "AccountsQuery" diff --git a/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts index c94561d2..934ca33b 100644 --- a/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; -import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func"; export const useGrant = buildUseMutation({ builderMutationFn: createGrant }); diff --git a/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts index 8548218a..6a6c30bf 100644 --- a/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/cosmos/bank/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; -import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func"; export const useGetBalance = buildUseQuery({ builderQueryFn: createGetBalance, queryKeyPrefix: "BalanceQuery" diff --git a/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts index 8162fe19..324d1265 100644 --- a/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; -import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func"; export const useSend = buildUseMutation({ builderMutationFn: createSend }); diff --git a/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts index 8cbf0e11..1ebd32c1 100644 --- a/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; -import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func"; export const useSetWithdrawAddress = buildUseMutation({ builderMutationFn: createSetWithdrawAddress }); diff --git a/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts index 72de88dc..aa3e4386 100644 --- a/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; -import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func"; export const useGrantAllowance = buildUseMutation({ builderMutationFn: createGrantAllowance }); diff --git a/libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts index 45490d6f..97d993fe 100644 --- a/libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/gov/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; -import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func"; export const useSubmitProposal = buildUseMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts index 5f574fba..4e4a6cee 100644 --- a/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/cosmos/gov/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; -import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func"; export const useGetProposal = buildUseQuery({ builderQueryFn: createGetProposal, queryKeyPrefix: "ProposalQuery" diff --git a/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts index b2fb7805..bc8434e0 100644 --- a/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; -import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func"; export const useSubmitProposal = buildUseMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts index 25f1ac84..39745d46 100644 --- a/libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/group/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; -import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func"; export const useCreateGroup = buildUseMutation({ builderMutationFn: createCreateGroup }); diff --git a/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts b/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts index 07eb6ea0..5165efe4 100644 --- a/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/cosmos/staking/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; -import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func"; export const useGetValidators = buildUseQuery({ builderQueryFn: createGetValidators, queryKeyPrefix: "ValidatorsQuery" diff --git a/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts index a5acb059..5f3b6882 100644 --- a/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; -import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func"; export const useCreateValidator = buildUseMutation({ builderMutationFn: createCreateValidator }); diff --git a/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts b/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts index 53085d29..ca1a7278 100644 --- a/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts +++ b/libs/injective-react/src/cosmos/tx/v1beta1/service.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; -import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func"; export const useGetSimulate = buildUseQuery({ builderQueryFn: createGetSimulate, queryKeyPrefix: "SimulateQuery" diff --git a/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts index 9c725c4e..01630803 100644 --- a/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; -import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func"; export const useCreateVestingAccount = buildUseMutation({ builderMutationFn: createCreateVestingAccount }); diff --git a/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts b/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts index b71686d0..73c80137 100644 --- a/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts +++ b/libs/injective-react/src/cosmwasm/wasm/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; -import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func"; export const useGetContractInfo = buildUseQuery({ builderQueryFn: createGetContractInfo, queryKeyPrefix: "ContractInfoQuery" diff --git a/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts b/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts index 602a0f30..e1f9f523 100644 --- a/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; -import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func"; export const useStoreCode = buildUseMutation({ builderMutationFn: createStoreCode }); diff --git a/libs/injective-react/src/extern.ts b/libs/injective-react/src/extern.ts index eddf067e..31da6877 100644 --- a/libs/injective-react/src/extern.ts +++ b/libs/injective-react/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/helper-func-types.ts b/libs/injective-react/src/helper-func-types.ts index 7aeeb7bc..d24ac8e0 100644 --- a/libs/injective-react/src/helper-func-types.ts +++ b/libs/injective-react/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/helpers.ts b/libs/injective-react/src/helpers.ts index ba68bbdb..b6fb6c90 100644 --- a/libs/injective-react/src/helpers.ts +++ b/libs/injective-react/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts index 7130abbd..3bc9387f 100644 --- a/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgTransfer, MsgUpdateParams } from "./tx"; -import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func"; export const useTransfer = buildUseMutation({ builderMutationFn: createTransfer }); diff --git a/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts index a11760aa..40dde7f9 100644 --- a/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/ibc/core/channel/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; -import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func"; export const useChannelOpenInit = buildUseMutation({ builderMutationFn: createChannelOpenInit }); diff --git a/libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts index 81bbd9ca..cfcf34ff 100644 --- a/libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/ibc/core/client/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; -import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func"; export const useCreateClient = buildUseMutation({ builderMutationFn: createCreateClient }); diff --git a/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts b/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts index f4eefea2..a1b49465 100644 --- a/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/ibc/core/connection/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; -import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func"; export const useConnectionOpenInit = buildUseMutation({ builderMutationFn: createConnectionOpenInit }); diff --git a/libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts index e9f78a82..03167db5 100644 --- a/libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/auction/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; -import { createGetAuctionParams, createGetCurrentAuctionBasket, createGetAuctionModuleState, createGetLastAuctionResult } from "./query.rpc.func.ts"; +import { createGetAuctionParams, createGetCurrentAuctionBasket, createGetAuctionModuleState, createGetLastAuctionResult } from "./query.rpc.func"; export const useGetAuctionParams = buildUseQuery({ builderQueryFn: createGetAuctionParams, queryKeyPrefix: "AuctionParamsQuery" diff --git a/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts index e4129d80..636ab61d 100644 --- a/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/auction/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgBid, MsgUpdateParams } from "./tx"; -import { createBid, createUpdateParams } from "./tx.rpc.func.ts"; +import { createBid, createUpdateParams } from "./tx.rpc.func"; export const useBid = buildUseMutation({ builderMutationFn: createBid }); diff --git a/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts index 0af5ccf2..8e449edb 100644 --- a/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/exchange/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; -import { createGetQueryExchangeParams, createGetSubaccountDeposits, createGetSubaccountDeposit, createGetExchangeBalances, createGetAggregateVolume, createGetAggregateVolumes, createGetAggregateMarketVolume, createGetAggregateMarketVolumes, createGetDenomDecimal, createGetDenomDecimals, createGetSpotMarkets, createGetSpotMarket, createGetFullSpotMarkets, createGetFullSpotMarket, createGetSpotOrderbook, createGetTraderSpotOrders, createGetAccountAddressSpotOrders, createGetSpotOrdersByHashes, createGetSubaccountOrders, createGetTraderSpotTransientOrders, createGetSpotMidPriceAndTOB, createGetDerivativeMidPriceAndTOB, createGetDerivativeOrderbook, createGetTraderDerivativeOrders, createGetAccountAddressDerivativeOrders, createGetDerivativeOrdersByHashes, createGetTraderDerivativeTransientOrders, createGetDerivativeMarkets, createGetDerivativeMarket, createGetDerivativeMarketAddress, createGetSubaccountTradeNonce, createGetExchangeModuleState, createGetPositions, createGetSubaccountPositions, createGetSubaccountPositionInMarket, createGetSubaccountEffectivePositionInMarket, createGetPerpetualMarketInfo, createGetExpiryFuturesMarketInfo, createGetPerpetualMarketFunding, createGetSubaccountOrderMetadata, createGetTradeRewardPoints, createGetPendingTradeRewardPoints, createGetTradeRewardCampaign, createGetFeeDiscountAccountInfo, createGetFeeDiscountSchedule, createGetBalanceMismatches, createGetBalanceWithBalanceHolds, createGetFeeDiscountTierStatistics, createGetMitoVaultInfos, createGetQueryMarketIDFromVault, createGetHistoricalTradeRecords, createGetIsOptedOutOfRewards, createGetOptedOutOfRewardsAccounts, createGetMarketVolatility, createGetBinaryOptionsMarkets, createGetTraderDerivativeConditionalOrders, createGetMarketAtomicExecutionFeeMultiplier, createGetActiveStakeGrant, createGetGrantAuthorization, createGetGrantAuthorizations } from "./query.rpc.func.ts"; +import { createGetQueryExchangeParams, createGetSubaccountDeposits, createGetSubaccountDeposit, createGetExchangeBalances, createGetAggregateVolume, createGetAggregateVolumes, createGetAggregateMarketVolume, createGetAggregateMarketVolumes, createGetDenomDecimal, createGetDenomDecimals, createGetSpotMarkets, createGetSpotMarket, createGetFullSpotMarkets, createGetFullSpotMarket, createGetSpotOrderbook, createGetTraderSpotOrders, createGetAccountAddressSpotOrders, createGetSpotOrdersByHashes, createGetSubaccountOrders, createGetTraderSpotTransientOrders, createGetSpotMidPriceAndTOB, createGetDerivativeMidPriceAndTOB, createGetDerivativeOrderbook, createGetTraderDerivativeOrders, createGetAccountAddressDerivativeOrders, createGetDerivativeOrdersByHashes, createGetTraderDerivativeTransientOrders, createGetDerivativeMarkets, createGetDerivativeMarket, createGetDerivativeMarketAddress, createGetSubaccountTradeNonce, createGetExchangeModuleState, createGetPositions, createGetSubaccountPositions, createGetSubaccountPositionInMarket, createGetSubaccountEffectivePositionInMarket, createGetPerpetualMarketInfo, createGetExpiryFuturesMarketInfo, createGetPerpetualMarketFunding, createGetSubaccountOrderMetadata, createGetTradeRewardPoints, createGetPendingTradeRewardPoints, createGetTradeRewardCampaign, createGetFeeDiscountAccountInfo, createGetFeeDiscountSchedule, createGetBalanceMismatches, createGetBalanceWithBalanceHolds, createGetFeeDiscountTierStatistics, createGetMitoVaultInfos, createGetQueryMarketIDFromVault, createGetHistoricalTradeRecords, createGetIsOptedOutOfRewards, createGetOptedOutOfRewardsAccounts, createGetMarketVolatility, createGetBinaryOptionsMarkets, createGetTraderDerivativeConditionalOrders, createGetMarketAtomicExecutionFeeMultiplier, createGetActiveStakeGrant, createGetGrantAuthorization, createGetGrantAuthorizations } from "./query.rpc.func"; export const useGetQueryExchangeParams = buildUseQuery({ builderQueryFn: createGetQueryExchangeParams, queryKeyPrefix: "QueryExchangeParamsQuery" diff --git a/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts index c67ac7bc..7bfb377a 100644 --- a/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/exchange/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; -import { createDeposit, createWithdraw, createInstantSpotMarketLaunch, createInstantPerpetualMarketLaunch, createInstantExpiryFuturesMarketLaunch, createCreateSpotLimitOrder, createBatchCreateSpotLimitOrders, createCreateSpotMarketOrder, createCancelSpotOrder, createBatchCancelSpotOrders, createBatchUpdateOrders, createPrivilegedExecuteContract, createCreateDerivativeLimitOrder, createBatchCreateDerivativeLimitOrders, createCreateDerivativeMarketOrder, createCancelDerivativeOrder, createBatchCancelDerivativeOrders, createInstantBinaryOptionsMarketLaunch, createCreateBinaryOptionsLimitOrder, createCreateBinaryOptionsMarketOrder, createCancelBinaryOptionsOrder, createBatchCancelBinaryOptionsOrders, createSubaccountTransfer, createExternalTransfer, createLiquidatePosition, createEmergencySettleMarket, createIncreasePositionMargin, createDecreasePositionMargin, createRewardsOptOut, createAdminUpdateBinaryOptionsMarket, createUpdateParams, createUpdateSpotMarket, createUpdateDerivativeMarket, createAuthorizeStakeGrants, createActivateStakeGrant } from "./tx.rpc.func.ts"; +import { createDeposit, createWithdraw, createInstantSpotMarketLaunch, createInstantPerpetualMarketLaunch, createInstantExpiryFuturesMarketLaunch, createCreateSpotLimitOrder, createBatchCreateSpotLimitOrders, createCreateSpotMarketOrder, createCancelSpotOrder, createBatchCancelSpotOrders, createBatchUpdateOrders, createPrivilegedExecuteContract, createCreateDerivativeLimitOrder, createBatchCreateDerivativeLimitOrders, createCreateDerivativeMarketOrder, createCancelDerivativeOrder, createBatchCancelDerivativeOrders, createInstantBinaryOptionsMarketLaunch, createCreateBinaryOptionsLimitOrder, createCreateBinaryOptionsMarketOrder, createCancelBinaryOptionsOrder, createBatchCancelBinaryOptionsOrders, createSubaccountTransfer, createExternalTransfer, createLiquidatePosition, createEmergencySettleMarket, createIncreasePositionMargin, createDecreasePositionMargin, createRewardsOptOut, createAdminUpdateBinaryOptionsMarket, createUpdateParams, createUpdateSpotMarket, createUpdateDerivativeMarket, createAuthorizeStakeGrants, createActivateStakeGrant } from "./tx.rpc.func"; export const useDeposit = buildUseMutation({ builderMutationFn: createDeposit }); diff --git a/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts index b1d18115..de30ae7d 100644 --- a/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/insurance/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetInsuranceParams, createGetInsuranceFund, createGetInsuranceFunds, createGetEstimatedRedemptions, createGetPendingRedemptions, createGetInsuranceModuleState } from "./query.rpc.func.ts"; +import { createGetInsuranceParams, createGetInsuranceFund, createGetInsuranceFunds, createGetEstimatedRedemptions, createGetPendingRedemptions, createGetInsuranceModuleState } from "./query.rpc.func"; export const useGetInsuranceParams = buildUseQuery({ builderQueryFn: createGetInsuranceParams, queryKeyPrefix: "InsuranceParamsQuery" diff --git a/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts index 9b6254c5..95346a8d 100644 --- a/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/insurance/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; -import { createCreateInsuranceFund, createUnderwrite, createRequestRedemption, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateInsuranceFund, createUnderwrite, createRequestRedemption, createUpdateParams } from "./tx.rpc.func"; export const useCreateInsuranceFund = buildUseMutation({ builderMutationFn: createCreateInsuranceFund }); diff --git a/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts index b2f49999..5afc052d 100644 --- a/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/ocr/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetParams, createGetFeedConfig, createGetFeedConfigInfo, createGetLatestRound, createGetLatestTransmissionDetails, createGetOwedAmount, createGetOcrModuleState } from "./query.rpc.func.ts"; +import { createGetParams, createGetFeedConfig, createGetFeedConfigInfo, createGetLatestRound, createGetLatestTransmissionDetails, createGetOwedAmount, createGetOcrModuleState } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts index 05301ba3..e8cc430e 100644 --- a/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/ocr/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; -import { createCreateFeed, createUpdateFeed, createTransmit, createFundFeedRewardPool, createWithdrawFeedRewardPool, createSetPayees, createTransferPayeeship, createAcceptPayeeship, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateFeed, createUpdateFeed, createTransmit, createFundFeedRewardPool, createWithdrawFeedRewardPool, createSetPayees, createTransferPayeeship, createAcceptPayeeship, createUpdateParams } from "./tx.rpc.func"; export const useCreateFeed = buildUseMutation({ builderMutationFn: createCreateFeed }); diff --git a/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts index e6c96e7e..4e040848 100644 --- a/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/oracle/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; -import { createGetParams, createGetBandRelayers, createGetBandPriceStates, createGetBandIBCPriceStates, createGetPriceFeedPriceStates, createGetCoinbasePriceStates, createGetPythPriceStates, createGetStorkPriceStates, createGetStorkPublishers, createGetProviderPriceState, createGetOracleModuleState, createGetHistoricalPriceRecords, createGetOracleVolatility, createGetOracleProvidersInfo, createGetOracleProviderPrices, createGetOraclePrice, createGetPythPrice } from "./query.rpc.func.ts"; +import { createGetParams, createGetBandRelayers, createGetBandPriceStates, createGetBandIBCPriceStates, createGetPriceFeedPriceStates, createGetCoinbasePriceStates, createGetPythPriceStates, createGetStorkPriceStates, createGetStorkPublishers, createGetProviderPriceState, createGetOracleModuleState, createGetHistoricalPriceRecords, createGetOracleVolatility, createGetOracleProvidersInfo, createGetOracleProviderPrices, createGetOraclePrice, createGetPythPrice } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts index 3fc9e703..0d2b6c5e 100644 --- a/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/oracle/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; -import { createRelayProviderPrices, createRelayPriceFeedPrice, createRelayBandRates, createRequestBandIBCRates, createRelayCoinbaseMessages, createRelayStorkMessage, createRelayPythPrices, createUpdateParams } from "./tx.rpc.func.ts"; +import { createRelayProviderPrices, createRelayPriceFeedPrice, createRelayBandRates, createRequestBandIBCRates, createRelayCoinbaseMessages, createRelayStorkMessage, createRelayPythPrices, createUpdateParams } from "./tx.rpc.func"; export const useRelayProviderPrices = buildUseMutation({ builderMutationFn: createRelayProviderPrices }); diff --git a/libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts b/libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts index 6e488ac4..a6def4af 100644 --- a/libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts +++ b/libs/injective-react/src/injective/peggy/v1/msgs.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; -import { createValsetConfirm, createSendToEth, createRequestBatch, createConfirmBatch, createDepositClaim, createWithdrawClaim, createValsetUpdateClaim, createERC20DeployedClaim, createSetOrchestratorAddresses, createCancelSendToEth, createSubmitBadSignatureEvidence, createUpdateParams, createBlacklistEthereumAddresses, createRevokeEthereumBlacklist } from "./msgs.rpc.func.ts"; +import { createValsetConfirm, createSendToEth, createRequestBatch, createConfirmBatch, createDepositClaim, createWithdrawClaim, createValsetUpdateClaim, createERC20DeployedClaim, createSetOrchestratorAddresses, createCancelSendToEth, createSubmitBadSignatureEvidence, createUpdateParams, createBlacklistEthereumAddresses, createRevokeEthereumBlacklist } from "./msgs.rpc.func"; export const useValsetConfirm = buildUseMutation({ builderMutationFn: createValsetConfirm }); diff --git a/libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts b/libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts index b004b522..c5093891 100644 --- a/libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/peggy/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; -import { createGetParams, createGetCurrentValset, createGetValsetRequest, createGetValsetConfirm, createGetValsetConfirmsByNonce, createGetLastValsetRequests, createGetLastPendingValsetRequestByAddr, createGetLastEventByAddr, createGetGetPendingSendToEth, createGetBatchFees, createGetOutgoingTxBatches, createGetLastPendingBatchRequestByAddr, createGetBatchRequestByNonce, createGetBatchConfirms, createGetERC20ToDenom, createGetDenomToERC20, createGetGetDelegateKeyByValidator, createGetGetDelegateKeyByEth, createGetGetDelegateKeyByOrchestrator, createGetPeggyModuleState, createGetMissingPeggoNonces } from "./query.rpc.func.ts"; +import { createGetParams, createGetCurrentValset, createGetValsetRequest, createGetValsetConfirm, createGetValsetConfirmsByNonce, createGetLastValsetRequests, createGetLastPendingValsetRequestByAddr, createGetLastEventByAddr, createGetGetPendingSendToEth, createGetBatchFees, createGetOutgoingTxBatches, createGetLastPendingBatchRequestByAddr, createGetBatchRequestByNonce, createGetBatchConfirms, createGetERC20ToDenom, createGetDenomToERC20, createGetGetDelegateKeyByValidator, createGetGetDelegateKeyByEth, createGetGetDelegateKeyByOrchestrator, createGetPeggyModuleState, createGetMissingPeggoNonces } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts index 8a076a1a..ec92b8be 100644 --- a/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/permissions/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; -import { createGetParams, createGetAllNamespaces, createGetNamespaceByDenom, createGetAddressRoles, createGetAddressesByRole, createGetVouchersForAddress } from "./query.rpc.func.ts"; +import { createGetParams, createGetAllNamespaces, createGetNamespaceByDenom, createGetAddressRoles, createGetAddressesByRole, createGetVouchersForAddress } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts index 256c359b..06beb585 100644 --- a/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/permissions/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; -import { createUpdateParams, createCreateNamespace, createDeleteNamespace, createUpdateNamespace, createUpdateNamespaceRoles, createRevokeNamespaceRoles, createClaimVoucher } from "./tx.rpc.func.ts"; +import { createUpdateParams, createCreateNamespace, createDeleteNamespace, createUpdateNamespace, createUpdateNamespaceRoles, createRevokeNamespaceRoles, createClaimVoucher } from "./tx.rpc.func"; export const useUpdateParams = buildUseMutation({ builderMutationFn: createUpdateParams }); diff --git a/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts b/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts index aaacfde2..0d9ea07e 100644 --- a/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/tokenfactory/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetParams, createGetDenomAuthorityMetadata, createGetDenomsFromCreator, createGetTokenfactoryModuleState } from "./query.rpc.func.ts"; +import { createGetParams, createGetDenomAuthorityMetadata, createGetDenomsFromCreator, createGetTokenfactoryModuleState } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts b/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts index a900abba..3665c023 100644 --- a/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/tokenfactory/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; -import { createCreateDenom, createMint, createBurn, createChangeAdmin, createSetDenomMetadata, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateDenom, createMint, createBurn, createChangeAdmin, createSetDenomMetadata, createUpdateParams } from "./tx.rpc.func"; export const useCreateDenom = buildUseMutation({ builderMutationFn: createCreateDenom }); diff --git a/libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts b/libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts index 5df8c151..d83b1d27 100644 --- a/libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts +++ b/libs/injective-react/src/injective/wasmx/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetWasmxParams, createGetContractRegistrationInfo, createGetWasmxModuleState } from "./query.rpc.func.ts"; +import { createGetWasmxParams, createGetContractRegistrationInfo, createGetWasmxModuleState } from "./query.rpc.func"; export const useGetWasmxParams = buildUseQuery({ builderQueryFn: createGetWasmxParams, queryKeyPrefix: "WasmxParamsQuery" diff --git a/libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts b/libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts index 54db46b1..0178fa58 100644 --- a/libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts +++ b/libs/injective-react/src/injective/wasmx/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; -import { createUpdateRegistryContractParams, createActivateRegistryContract, createDeactivateRegistryContract, createExecuteContractCompat, createUpdateParams, createRegisterContract } from "./tx.rpc.func.ts"; +import { createUpdateRegistryContractParams, createActivateRegistryContract, createDeactivateRegistryContract, createExecuteContractCompat, createUpdateParams, createRegisterContract } from "./tx.rpc.func"; export const useUpdateRegistryContractParams = buildUseMutation({ builderMutationFn: createUpdateRegistryContractParams }); diff --git a/libs/injective-react/src/react-query.ts b/libs/injective-react/src/react-query.ts index f26d1ce2..3c698ea3 100644 --- a/libs/injective-react/src/react-query.ts +++ b/libs/injective-react/src/react-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/registry.ts b/libs/injective-react/src/registry.ts index 1581e912..98291dff 100644 --- a/libs/injective-react/src/registry.ts +++ b/libs/injective-react/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/types.ts b/libs/injective-react/src/types.ts index cdcfbdf9..f3785169 100644 --- a/libs/injective-react/src/types.ts +++ b/libs/injective-react/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/utf8.ts b/libs/injective-react/src/utf8.ts index c0f5c97c..c8c688c2 100644 --- a/libs/injective-react/src/utf8.ts +++ b/libs/injective-react/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/varint.ts b/libs/injective-react/src/varint.ts index 70a851bd..3f1ff3be 100644 --- a/libs/injective-react/src/varint.ts +++ b/libs/injective-react/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/binary.ts b/libs/injective-vue/src/binary.ts index e6922501..15b28924 100644 --- a/libs/injective-vue/src/binary.ts +++ b/libs/injective-vue/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts index b09ee08f..77347dda 100644 --- a/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; -import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func"; export const useGetAccounts = buildUseVueQuery({ builderQueryFn: createGetAccounts, queryKeyPrefix: "AccountsQuery" diff --git a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts index 214f14b1..cbb0f840 100644 --- a/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; -import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func"; export const useGrant = buildUseVueMutation({ builderMutationFn: createGrant }); diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts index fb0e2f44..410768a3 100644 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; -import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func"; export const useGetBalance = buildUseVueQuery({ builderQueryFn: createGetBalance, queryKeyPrefix: "BalanceQuery" diff --git a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts index 654e3c48..9f830b69 100644 --- a/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; -import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func"; export const useSend = buildUseVueMutation({ builderMutationFn: createSend }); diff --git a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts index 51d3ad25..5b4bda13 100644 --- a/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; -import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func"; export const useSetWithdrawAddress = buildUseVueMutation({ builderMutationFn: createSetWithdrawAddress }); diff --git a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts index 1cf9e374..a20bbe20 100644 --- a/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; -import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func"; export const useGrantAllowance = buildUseVueMutation({ builderMutationFn: createGrantAllowance }); diff --git a/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts index 603f5139..59306c6a 100644 --- a/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/gov/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; -import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func"; export const useSubmitProposal = buildUseVueMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts index 1771e4a1..7187e56d 100644 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; -import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func"; export const useGetProposal = buildUseVueQuery({ builderQueryFn: createGetProposal, queryKeyPrefix: "ProposalQuery" diff --git a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts index f1bc66da..f6e83e99 100644 --- a/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; -import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func"; export const useSubmitProposal = buildUseVueMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts index ed9a30e0..ef3d3927 100644 --- a/libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/group/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; -import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func"; export const useCreateGroup = buildUseVueMutation({ builderMutationFn: createCreateGroup }); diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts index 92fc3c20..d43619b5 100644 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; -import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func"; export const useGetValidators = buildUseVueQuery({ builderQueryFn: createGetValidators, queryKeyPrefix: "ValidatorsQuery" diff --git a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts index 57a83c0e..f58b0e85 100644 --- a/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; -import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func"; export const useCreateValidator = buildUseVueMutation({ builderMutationFn: createCreateValidator }); diff --git a/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts b/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts index c3e8714b..3e15c64a 100644 --- a/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; -import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func"; export const useGetSimulate = buildUseVueQuery({ builderQueryFn: createGetSimulate, queryKeyPrefix: "SimulateQuery" diff --git a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts index a5ff2e80..8e7c5ec6 100644 --- a/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; -import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func"; export const useCreateVestingAccount = buildUseVueMutation({ builderMutationFn: createCreateVestingAccount }); diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts index d021b1a4..329cb307 100644 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; -import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func"; export const useGetContractInfo = buildUseVueQuery({ builderQueryFn: createGetContractInfo, queryKeyPrefix: "ContractInfoQuery" diff --git a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts index 9cf6e9ad..0c0a2784 100644 --- a/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; -import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func"; export const useStoreCode = buildUseVueMutation({ builderMutationFn: createStoreCode }); diff --git a/libs/injective-vue/src/extern.ts b/libs/injective-vue/src/extern.ts index eddf067e..31da6877 100644 --- a/libs/injective-vue/src/extern.ts +++ b/libs/injective-vue/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/helper-func-types.ts b/libs/injective-vue/src/helper-func-types.ts index 4f82736b..52876789 100644 --- a/libs/injective-vue/src/helper-func-types.ts +++ b/libs/injective-vue/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/helpers.ts b/libs/injective-vue/src/helpers.ts index ba68bbdb..b6fb6c90 100644 --- a/libs/injective-vue/src/helpers.ts +++ b/libs/injective-vue/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts index ab0c0e79..86a2a4b1 100644 --- a/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgTransfer, MsgUpdateParams } from "./tx"; -import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func"; export const useTransfer = buildUseVueMutation({ builderMutationFn: createTransfer }); diff --git a/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts index 106d8e60..49e06b6b 100644 --- a/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; -import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func"; export const useChannelOpenInit = buildUseVueMutation({ builderMutationFn: createChannelOpenInit }); diff --git a/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts index e58f7de8..ce7e0e07 100644 --- a/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/ibc/core/client/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; -import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func"; export const useCreateClient = buildUseVueMutation({ builderMutationFn: createCreateClient }); diff --git a/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts b/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts index 8e33749b..f553390e 100644 --- a/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; -import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func"; export const useConnectionOpenInit = buildUseVueMutation({ builderMutationFn: createConnectionOpenInit }); diff --git a/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts index 102a8d30..8d179401 100644 --- a/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/auction/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; -import { createGetAuctionParams, createGetCurrentAuctionBasket, createGetAuctionModuleState, createGetLastAuctionResult } from "./query.rpc.func.ts"; +import { createGetAuctionParams, createGetCurrentAuctionBasket, createGetAuctionModuleState, createGetLastAuctionResult } from "./query.rpc.func"; export const useGetAuctionParams = buildUseVueQuery({ builderQueryFn: createGetAuctionParams, queryKeyPrefix: "AuctionParamsQuery" diff --git a/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts index 18087100..01d8cc78 100644 --- a/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/auction/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgBid, MsgUpdateParams } from "./tx"; -import { createBid, createUpdateParams } from "./tx.rpc.func.ts"; +import { createBid, createUpdateParams } from "./tx.rpc.func"; export const useBid = buildUseVueMutation({ builderMutationFn: createBid }); diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts index e0c72adb..a55d2853 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; -import { createGetQueryExchangeParams, createGetSubaccountDeposits, createGetSubaccountDeposit, createGetExchangeBalances, createGetAggregateVolume, createGetAggregateVolumes, createGetAggregateMarketVolume, createGetAggregateMarketVolumes, createGetDenomDecimal, createGetDenomDecimals, createGetSpotMarkets, createGetSpotMarket, createGetFullSpotMarkets, createGetFullSpotMarket, createGetSpotOrderbook, createGetTraderSpotOrders, createGetAccountAddressSpotOrders, createGetSpotOrdersByHashes, createGetSubaccountOrders, createGetTraderSpotTransientOrders, createGetSpotMidPriceAndTOB, createGetDerivativeMidPriceAndTOB, createGetDerivativeOrderbook, createGetTraderDerivativeOrders, createGetAccountAddressDerivativeOrders, createGetDerivativeOrdersByHashes, createGetTraderDerivativeTransientOrders, createGetDerivativeMarkets, createGetDerivativeMarket, createGetDerivativeMarketAddress, createGetSubaccountTradeNonce, createGetExchangeModuleState, createGetPositions, createGetSubaccountPositions, createGetSubaccountPositionInMarket, createGetSubaccountEffectivePositionInMarket, createGetPerpetualMarketInfo, createGetExpiryFuturesMarketInfo, createGetPerpetualMarketFunding, createGetSubaccountOrderMetadata, createGetTradeRewardPoints, createGetPendingTradeRewardPoints, createGetTradeRewardCampaign, createGetFeeDiscountAccountInfo, createGetFeeDiscountSchedule, createGetBalanceMismatches, createGetBalanceWithBalanceHolds, createGetFeeDiscountTierStatistics, createGetMitoVaultInfos, createGetQueryMarketIDFromVault, createGetHistoricalTradeRecords, createGetIsOptedOutOfRewards, createGetOptedOutOfRewardsAccounts, createGetMarketVolatility, createGetBinaryOptionsMarkets, createGetTraderDerivativeConditionalOrders, createGetMarketAtomicExecutionFeeMultiplier, createGetActiveStakeGrant, createGetGrantAuthorization, createGetGrantAuthorizations } from "./query.rpc.func.ts"; +import { createGetQueryExchangeParams, createGetSubaccountDeposits, createGetSubaccountDeposit, createGetExchangeBalances, createGetAggregateVolume, createGetAggregateVolumes, createGetAggregateMarketVolume, createGetAggregateMarketVolumes, createGetDenomDecimal, createGetDenomDecimals, createGetSpotMarkets, createGetSpotMarket, createGetFullSpotMarkets, createGetFullSpotMarket, createGetSpotOrderbook, createGetTraderSpotOrders, createGetAccountAddressSpotOrders, createGetSpotOrdersByHashes, createGetSubaccountOrders, createGetTraderSpotTransientOrders, createGetSpotMidPriceAndTOB, createGetDerivativeMidPriceAndTOB, createGetDerivativeOrderbook, createGetTraderDerivativeOrders, createGetAccountAddressDerivativeOrders, createGetDerivativeOrdersByHashes, createGetTraderDerivativeTransientOrders, createGetDerivativeMarkets, createGetDerivativeMarket, createGetDerivativeMarketAddress, createGetSubaccountTradeNonce, createGetExchangeModuleState, createGetPositions, createGetSubaccountPositions, createGetSubaccountPositionInMarket, createGetSubaccountEffectivePositionInMarket, createGetPerpetualMarketInfo, createGetExpiryFuturesMarketInfo, createGetPerpetualMarketFunding, createGetSubaccountOrderMetadata, createGetTradeRewardPoints, createGetPendingTradeRewardPoints, createGetTradeRewardCampaign, createGetFeeDiscountAccountInfo, createGetFeeDiscountSchedule, createGetBalanceMismatches, createGetBalanceWithBalanceHolds, createGetFeeDiscountTierStatistics, createGetMitoVaultInfos, createGetQueryMarketIDFromVault, createGetHistoricalTradeRecords, createGetIsOptedOutOfRewards, createGetOptedOutOfRewardsAccounts, createGetMarketVolatility, createGetBinaryOptionsMarkets, createGetTraderDerivativeConditionalOrders, createGetMarketAtomicExecutionFeeMultiplier, createGetActiveStakeGrant, createGetGrantAuthorization, createGetGrantAuthorizations } from "./query.rpc.func"; export const useGetQueryExchangeParams = buildUseVueQuery({ builderQueryFn: createGetQueryExchangeParams, queryKeyPrefix: "QueryExchangeParamsQuery" diff --git a/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts index 09b7405e..37e3a01b 100644 --- a/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/exchange/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; -import { createDeposit, createWithdraw, createInstantSpotMarketLaunch, createInstantPerpetualMarketLaunch, createInstantExpiryFuturesMarketLaunch, createCreateSpotLimitOrder, createBatchCreateSpotLimitOrders, createCreateSpotMarketOrder, createCancelSpotOrder, createBatchCancelSpotOrders, createBatchUpdateOrders, createPrivilegedExecuteContract, createCreateDerivativeLimitOrder, createBatchCreateDerivativeLimitOrders, createCreateDerivativeMarketOrder, createCancelDerivativeOrder, createBatchCancelDerivativeOrders, createInstantBinaryOptionsMarketLaunch, createCreateBinaryOptionsLimitOrder, createCreateBinaryOptionsMarketOrder, createCancelBinaryOptionsOrder, createBatchCancelBinaryOptionsOrders, createSubaccountTransfer, createExternalTransfer, createLiquidatePosition, createEmergencySettleMarket, createIncreasePositionMargin, createDecreasePositionMargin, createRewardsOptOut, createAdminUpdateBinaryOptionsMarket, createUpdateParams, createUpdateSpotMarket, createUpdateDerivativeMarket, createAuthorizeStakeGrants, createActivateStakeGrant } from "./tx.rpc.func.ts"; +import { createDeposit, createWithdraw, createInstantSpotMarketLaunch, createInstantPerpetualMarketLaunch, createInstantExpiryFuturesMarketLaunch, createCreateSpotLimitOrder, createBatchCreateSpotLimitOrders, createCreateSpotMarketOrder, createCancelSpotOrder, createBatchCancelSpotOrders, createBatchUpdateOrders, createPrivilegedExecuteContract, createCreateDerivativeLimitOrder, createBatchCreateDerivativeLimitOrders, createCreateDerivativeMarketOrder, createCancelDerivativeOrder, createBatchCancelDerivativeOrders, createInstantBinaryOptionsMarketLaunch, createCreateBinaryOptionsLimitOrder, createCreateBinaryOptionsMarketOrder, createCancelBinaryOptionsOrder, createBatchCancelBinaryOptionsOrders, createSubaccountTransfer, createExternalTransfer, createLiquidatePosition, createEmergencySettleMarket, createIncreasePositionMargin, createDecreasePositionMargin, createRewardsOptOut, createAdminUpdateBinaryOptionsMarket, createUpdateParams, createUpdateSpotMarket, createUpdateDerivativeMarket, createAuthorizeStakeGrants, createActivateStakeGrant } from "./tx.rpc.func"; export const useDeposit = buildUseVueMutation({ builderMutationFn: createDeposit }); diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts index bc636668..6540b57c 100644 --- a/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/insurance/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetInsuranceParams, createGetInsuranceFund, createGetInsuranceFunds, createGetEstimatedRedemptions, createGetPendingRedemptions, createGetInsuranceModuleState } from "./query.rpc.func.ts"; +import { createGetInsuranceParams, createGetInsuranceFund, createGetInsuranceFunds, createGetEstimatedRedemptions, createGetPendingRedemptions, createGetInsuranceModuleState } from "./query.rpc.func"; export const useGetInsuranceParams = buildUseVueQuery({ builderQueryFn: createGetInsuranceParams, queryKeyPrefix: "InsuranceParamsQuery" diff --git a/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts index 30b28d00..efe01239 100644 --- a/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/insurance/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; -import { createCreateInsuranceFund, createUnderwrite, createRequestRedemption, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateInsuranceFund, createUnderwrite, createRequestRedemption, createUpdateParams } from "./tx.rpc.func"; export const useCreateInsuranceFund = buildUseVueMutation({ builderMutationFn: createCreateInsuranceFund }); diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts index da233454..163d8aff 100644 --- a/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/ocr/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetParams, createGetFeedConfig, createGetFeedConfigInfo, createGetLatestRound, createGetLatestTransmissionDetails, createGetOwedAmount, createGetOcrModuleState } from "./query.rpc.func.ts"; +import { createGetParams, createGetFeedConfig, createGetFeedConfigInfo, createGetLatestRound, createGetLatestTransmissionDetails, createGetOwedAmount, createGetOcrModuleState } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts index 02da9160..f03e2599 100644 --- a/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/ocr/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; -import { createCreateFeed, createUpdateFeed, createTransmit, createFundFeedRewardPool, createWithdrawFeedRewardPool, createSetPayees, createTransferPayeeship, createAcceptPayeeship, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateFeed, createUpdateFeed, createTransmit, createFundFeedRewardPool, createWithdrawFeedRewardPool, createSetPayees, createTransferPayeeship, createAcceptPayeeship, createUpdateParams } from "./tx.rpc.func"; export const useCreateFeed = buildUseVueMutation({ builderMutationFn: createCreateFeed }); diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts index c0bb9c8d..3d0ab778 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; -import { createGetParams, createGetBandRelayers, createGetBandPriceStates, createGetBandIBCPriceStates, createGetPriceFeedPriceStates, createGetCoinbasePriceStates, createGetPythPriceStates, createGetStorkPriceStates, createGetStorkPublishers, createGetProviderPriceState, createGetOracleModuleState, createGetHistoricalPriceRecords, createGetOracleVolatility, createGetOracleProvidersInfo, createGetOracleProviderPrices, createGetOraclePrice, createGetPythPrice } from "./query.rpc.func.ts"; +import { createGetParams, createGetBandRelayers, createGetBandPriceStates, createGetBandIBCPriceStates, createGetPriceFeedPriceStates, createGetCoinbasePriceStates, createGetPythPriceStates, createGetStorkPriceStates, createGetStorkPublishers, createGetProviderPriceState, createGetOracleModuleState, createGetHistoricalPriceRecords, createGetOracleVolatility, createGetOracleProvidersInfo, createGetOracleProviderPrices, createGetOraclePrice, createGetPythPrice } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts index 948bdcb3..ded60c83 100644 --- a/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/oracle/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; -import { createRelayProviderPrices, createRelayPriceFeedPrice, createRelayBandRates, createRequestBandIBCRates, createRelayCoinbaseMessages, createRelayStorkMessage, createRelayPythPrices, createUpdateParams } from "./tx.rpc.func.ts"; +import { createRelayProviderPrices, createRelayPriceFeedPrice, createRelayBandRates, createRequestBandIBCRates, createRelayCoinbaseMessages, createRelayStorkMessage, createRelayPythPrices, createUpdateParams } from "./tx.rpc.func"; export const useRelayProviderPrices = buildUseVueMutation({ builderMutationFn: createRelayProviderPrices }); diff --git a/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts b/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts index a3e035a4..c9e22d6d 100644 --- a/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts +++ b/libs/injective-vue/src/injective/peggy/v1/msgs.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; -import { createValsetConfirm, createSendToEth, createRequestBatch, createConfirmBatch, createDepositClaim, createWithdrawClaim, createValsetUpdateClaim, createERC20DeployedClaim, createSetOrchestratorAddresses, createCancelSendToEth, createSubmitBadSignatureEvidence, createUpdateParams, createBlacklistEthereumAddresses, createRevokeEthereumBlacklist } from "./msgs.rpc.func.ts"; +import { createValsetConfirm, createSendToEth, createRequestBatch, createConfirmBatch, createDepositClaim, createWithdrawClaim, createValsetUpdateClaim, createERC20DeployedClaim, createSetOrchestratorAddresses, createCancelSendToEth, createSubmitBadSignatureEvidence, createUpdateParams, createBlacklistEthereumAddresses, createRevokeEthereumBlacklist } from "./msgs.rpc.func"; export const useValsetConfirm = buildUseVueMutation({ builderMutationFn: createValsetConfirm }); diff --git a/libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts b/libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts index b0c4bc2c..b4277e38 100644 --- a/libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/peggy/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; -import { createGetParams, createGetCurrentValset, createGetValsetRequest, createGetValsetConfirm, createGetValsetConfirmsByNonce, createGetLastValsetRequests, createGetLastPendingValsetRequestByAddr, createGetLastEventByAddr, createGetGetPendingSendToEth, createGetBatchFees, createGetOutgoingTxBatches, createGetLastPendingBatchRequestByAddr, createGetBatchRequestByNonce, createGetBatchConfirms, createGetERC20ToDenom, createGetDenomToERC20, createGetGetDelegateKeyByValidator, createGetGetDelegateKeyByEth, createGetGetDelegateKeyByOrchestrator, createGetPeggyModuleState, createGetMissingPeggoNonces } from "./query.rpc.func.ts"; +import { createGetParams, createGetCurrentValset, createGetValsetRequest, createGetValsetConfirm, createGetValsetConfirmsByNonce, createGetLastValsetRequests, createGetLastPendingValsetRequestByAddr, createGetLastEventByAddr, createGetGetPendingSendToEth, createGetBatchFees, createGetOutgoingTxBatches, createGetLastPendingBatchRequestByAddr, createGetBatchRequestByNonce, createGetBatchConfirms, createGetERC20ToDenom, createGetDenomToERC20, createGetGetDelegateKeyByValidator, createGetGetDelegateKeyByEth, createGetGetDelegateKeyByOrchestrator, createGetPeggyModuleState, createGetMissingPeggoNonces } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts index 98862317..cfdceca9 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; -import { createGetParams, createGetAllNamespaces, createGetNamespaceByDenom, createGetAddressRoles, createGetAddressesByRole, createGetVouchersForAddress } from "./query.rpc.func.ts"; +import { createGetParams, createGetAllNamespaces, createGetNamespaceByDenom, createGetAddressRoles, createGetAddressesByRole, createGetVouchersForAddress } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts index e4723ee6..28081751 100644 --- a/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/permissions/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; -import { createUpdateParams, createCreateNamespace, createDeleteNamespace, createUpdateNamespace, createUpdateNamespaceRoles, createRevokeNamespaceRoles, createClaimVoucher } from "./tx.rpc.func.ts"; +import { createUpdateParams, createCreateNamespace, createDeleteNamespace, createUpdateNamespace, createUpdateNamespaceRoles, createRevokeNamespaceRoles, createClaimVoucher } from "./tx.rpc.func"; export const useUpdateParams = buildUseVueMutation({ builderMutationFn: createUpdateParams }); diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts index 4eb20078..7638916b 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetParams, createGetDenomAuthorityMetadata, createGetDenomsFromCreator, createGetTokenfactoryModuleState } from "./query.rpc.func.ts"; +import { createGetParams, createGetDenomAuthorityMetadata, createGetDenomsFromCreator, createGetTokenfactoryModuleState } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts index f52bca08..511f3e0e 100644 --- a/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/tokenfactory/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; -import { createCreateDenom, createMint, createBurn, createChangeAdmin, createSetDenomMetadata, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateDenom, createMint, createBurn, createChangeAdmin, createSetDenomMetadata, createUpdateParams } from "./tx.rpc.func"; export const useCreateDenom = buildUseVueMutation({ builderMutationFn: createCreateDenom }); diff --git a/libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts b/libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts index 1cc8d81e..153796a7 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; -import { createGetWasmxParams, createGetContractRegistrationInfo, createGetWasmxModuleState } from "./query.rpc.func.ts"; +import { createGetWasmxParams, createGetContractRegistrationInfo, createGetWasmxModuleState } from "./query.rpc.func"; export const useGetWasmxParams = buildUseVueQuery({ builderQueryFn: createGetWasmxParams, queryKeyPrefix: "WasmxParamsQuery" diff --git a/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts b/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts index 31de82d9..3e936728 100644 --- a/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts +++ b/libs/injective-vue/src/injective/wasmx/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; -import { createUpdateRegistryContractParams, createActivateRegistryContract, createDeactivateRegistryContract, createExecuteContractCompat, createUpdateParams, createRegisterContract } from "./tx.rpc.func.ts"; +import { createUpdateRegistryContractParams, createActivateRegistryContract, createDeactivateRegistryContract, createExecuteContractCompat, createUpdateParams, createRegisterContract } from "./tx.rpc.func"; export const useUpdateRegistryContractParams = buildUseVueMutation({ builderMutationFn: createUpdateRegistryContractParams }); diff --git a/libs/injective-vue/src/registry.ts b/libs/injective-vue/src/registry.ts index 1581e912..98291dff 100644 --- a/libs/injective-vue/src/registry.ts +++ b/libs/injective-vue/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/types.ts b/libs/injective-vue/src/types.ts index cdcfbdf9..f3785169 100644 --- a/libs/injective-vue/src/types.ts +++ b/libs/injective-vue/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/utf8.ts b/libs/injective-vue/src/utf8.ts index c0f5c97c..c8c688c2 100644 --- a/libs/injective-vue/src/utf8.ts +++ b/libs/injective-vue/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/varint.ts b/libs/injective-vue/src/varint.ts index 70a851bd..3f1ff3be 100644 --- a/libs/injective-vue/src/varint.ts +++ b/libs/injective-vue/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/vue-query.ts b/libs/injective-vue/src/vue-query.ts index 867bd9f3..78d0f433 100644 --- a/libs/injective-vue/src/vue-query.ts +++ b/libs/injective-vue/src/vue-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ @@ -205,7 +205,7 @@ export interface UseMutationBuilderOptions { clientResolver?: SigningClientResolver ) => ( signerAddress: string, - message: TMsg, + message: TMsg | TMsg[], fee: StdFee | 'auto', memo: string ) => Promise; diff --git a/libs/injectivejs/src/binary.ts b/libs/injectivejs/src/binary.ts index e6922501..15b28924 100644 --- a/libs/injectivejs/src/binary.ts +++ b/libs/injectivejs/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/extern.ts b/libs/injectivejs/src/extern.ts index eddf067e..31da6877 100644 --- a/libs/injectivejs/src/extern.ts +++ b/libs/injectivejs/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/helper-func-types.ts b/libs/injectivejs/src/helper-func-types.ts index 7aeeb7bc..d24ac8e0 100644 --- a/libs/injectivejs/src/helper-func-types.ts +++ b/libs/injectivejs/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/helpers.ts b/libs/injectivejs/src/helpers.ts index ba68bbdb..b6fb6c90 100644 --- a/libs/injectivejs/src/helpers.ts +++ b/libs/injectivejs/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/registry.ts b/libs/injectivejs/src/registry.ts index 1581e912..98291dff 100644 --- a/libs/injectivejs/src/registry.ts +++ b/libs/injectivejs/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/types.ts b/libs/injectivejs/src/types.ts index cdcfbdf9..f3785169 100644 --- a/libs/injectivejs/src/types.ts +++ b/libs/injectivejs/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/utf8.ts b/libs/injectivejs/src/utf8.ts index c0f5c97c..c8c688c2 100644 --- a/libs/injectivejs/src/utf8.ts +++ b/libs/injectivejs/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/varint.ts b/libs/injectivejs/src/varint.ts index 70a851bd..3f1ff3be 100644 --- a/libs/injectivejs/src/varint.ts +++ b/libs/injectivejs/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/binary.ts b/libs/interchain-react/src/binary.ts index e6922501..15b28924 100644 --- a/libs/interchain-react/src/binary.ts +++ b/libs/interchain-react/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts index 8a6a48d0..e77b3325 100644 --- a/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/app/v1alpha1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryConfigRequest, QueryConfigResponse } from "./query"; -import { createGetConfig } from "./query.rpc.func.ts"; +import { createGetConfig } from "./query.rpc.func"; export const useGetConfig = buildUseQuery({ builderQueryFn: createGetConfig, queryKeyPrefix: "ConfigQuery" diff --git a/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts index f1ddc500..e52da586 100644 --- a/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/auth/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; -import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func"; export const useGetAccounts = buildUseQuery({ builderQueryFn: createGetAccounts, queryKeyPrefix: "AccountsQuery" diff --git a/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts index 427464a2..4e3e90dd 100644 --- a/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/auth/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams } from "./tx"; -import { createUpdateParams } from "./tx.rpc.func.ts"; +import { createUpdateParams } from "./tx.rpc.func"; export const useUpdateParams = buildUseMutation({ builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts index 2c287d62..8c1bf015 100644 --- a/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/authz/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; -import { createGetGrants, createGetGranterGrants, createGetGranteeGrants } from "./query.rpc.func.ts"; +import { createGetGrants, createGetGranterGrants, createGetGranteeGrants } from "./query.rpc.func"; export const useGetGrants = buildUseQuery({ builderQueryFn: createGetGrants, queryKeyPrefix: "GrantsQuery" diff --git a/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts index c94561d2..934ca33b 100644 --- a/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/authz/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; -import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func"; export const useGrant = buildUseMutation({ builderMutationFn: createGrant }); diff --git a/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts index 2104f4d8..d1e94991 100644 --- a/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/autocli/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { AppOptionsRequest, AppOptionsResponse } from "./query"; -import { createGetAppOptions } from "./query.rpc.func.ts"; +import { createGetAppOptions } from "./query.rpc.func"; export const useGetAppOptions = buildUseQuery({ builderQueryFn: createGetAppOptions, queryKeyPrefix: "AppOptionsQuery" diff --git a/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts index 8548218a..6a6c30bf 100644 --- a/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/bank/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; -import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func"; export const useGetBalance = buildUseQuery({ builderQueryFn: createGetBalance, queryKeyPrefix: "BalanceQuery" diff --git a/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts index 8162fe19..324d1265 100644 --- a/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/bank/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; -import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func"; export const useSend = buildUseMutation({ builderMutationFn: createSend }); diff --git a/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts b/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts index a18d43ef..0cfe2220 100644 --- a/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/base/grpc/v2/service.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../../react-query"; import { QueryRequest, QueryResponse, ListQueryHandlersRequest, ListQueryHandlersResponse } from "./service"; -import { createGetQuery, createGetListQueryHandlers } from "./service.rpc.func.ts"; +import { createGetQuery, createGetListQueryHandlers } from "./service.rpc.func"; export const useGetQuery = buildUseQuery({ builderQueryFn: createGetQuery, queryKeyPrefix: "QueryQuery" diff --git a/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts index 4365eda7..7aa09197 100644 --- a/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/base/node/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../../react-query"; import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; -import { createGetConfig, createGetStatus } from "./query.rpc.func.ts"; +import { createGetConfig, createGetStatus } from "./query.rpc.func"; export const useGetConfig = buildUseQuery({ builderQueryFn: createGetConfig, queryKeyPrefix: "ConfigQuery" diff --git a/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts b/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts index e326581a..00a3054d 100644 --- a/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/base/node/v2/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../../react-query"; import { ConfigRequest, ConfigResponse } from "./query"; -import { createGetConfig } from "./query.rpc.func.ts"; +import { createGetConfig } from "./query.rpc.func"; export const useGetConfig = buildUseQuery({ builderQueryFn: createGetConfig, queryKeyPrefix: "ConfigQuery" diff --git a/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts b/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts index cad07016..759a0b94 100644 --- a/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/base/reflection/v1beta1/reflection.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../../react-query"; import { ListAllInterfacesRequest, ListAllInterfacesResponse, ListImplementationsRequest, ListImplementationsResponse } from "./reflection"; -import { createGetListAllInterfaces, createGetListImplementations } from "./reflection.rpc.func.ts"; +import { createGetListAllInterfaces, createGetListImplementations } from "./reflection.rpc.func"; export const useGetListAllInterfaces = buildUseQuery({ builderQueryFn: createGetListAllInterfaces, queryKeyPrefix: "ListAllInterfacesQuery" diff --git a/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts b/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts index e6aafa0e..6b869bc1 100644 --- a/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/base/reflection/v2alpha1/reflection.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../../react-query"; import { GetAuthnDescriptorRequest, GetAuthnDescriptorResponse, GetChainDescriptorRequest, GetChainDescriptorResponse, GetCodecDescriptorRequest, GetCodecDescriptorResponse, GetConfigurationDescriptorRequest, GetConfigurationDescriptorResponse, GetQueryServicesDescriptorRequest, GetQueryServicesDescriptorResponse, GetTxDescriptorRequest, GetTxDescriptorResponse } from "./reflection"; -import { createGetGetAuthnDescriptor, createGetGetChainDescriptor, createGetGetCodecDescriptor, createGetGetConfigurationDescriptor, createGetGetQueryServicesDescriptor, createGetGetTxDescriptor } from "./reflection.rpc.func.ts"; +import { createGetGetAuthnDescriptor, createGetGetChainDescriptor, createGetGetCodecDescriptor, createGetGetConfigurationDescriptor, createGetGetQueryServicesDescriptor, createGetGetTxDescriptor } from "./reflection.rpc.func"; export const useGetGetAuthnDescriptor = buildUseQuery({ builderQueryFn: createGetGetAuthnDescriptor, queryKeyPrefix: "GetAuthnDescriptorQuery" diff --git a/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts index 7cf00d13..3947ebe8 100644 --- a/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/base/tendermint/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../../react-query"; import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; -import { createGetGetNodeInfo, createGetGetSyncing, createGetGetLatestBlock, createGetGetBlockByHeight, createGetGetLatestValidatorSet, createGetGetValidatorSetByHeight, createGetABCIQuery } from "./query.rpc.func.ts"; +import { createGetGetNodeInfo, createGetGetSyncing, createGetGetLatestBlock, createGetGetBlockByHeight, createGetGetLatestValidatorSet, createGetGetValidatorSetByHeight, createGetABCIQuery } from "./query.rpc.func"; export const useGetGetNodeInfo = buildUseQuery({ builderQueryFn: createGetGetNodeInfo, queryKeyPrefix: "GetNodeInfoQuery" diff --git a/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts index f4548b1e..11ba5a82 100644 --- a/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/circuit/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse } from "./query"; -import { createGetAccount, createGetAccounts, createGetDisabledList } from "./query.rpc.func.ts"; +import { createGetAccount, createGetAccounts, createGetDisabledList } from "./query.rpc.func"; export const useGetAccount = buildUseQuery({ builderQueryFn: createGetAccount, queryKeyPrefix: "AccountQuery" diff --git a/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts index 6b57729f..267fa2d5 100644 --- a/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/circuit/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; -import { createAuthorizeCircuitBreaker, createTripCircuitBreaker, createResetCircuitBreaker } from "./tx.rpc.func.ts"; +import { createAuthorizeCircuitBreaker, createTripCircuitBreaker, createResetCircuitBreaker } from "./tx.rpc.func"; export const useAuthorizeCircuitBreaker = buildUseMutation({ builderMutationFn: createAuthorizeCircuitBreaker }); diff --git a/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts index 7604e464..9e5dbb0b 100644 --- a/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/consensus/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse } from "./query"; -import { createGetParams } from "./query.rpc.func.ts"; +import { createGetParams } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts index 427464a2..4e3e90dd 100644 --- a/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/consensus/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams } from "./tx"; -import { createUpdateParams } from "./tx.rpc.func.ts"; +import { createUpdateParams } from "./tx.rpc.func"; export const useUpdateParams = buildUseMutation({ builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts index e7c209e3..46f7d097 100644 --- a/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/crisis/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; -import { createVerifyInvariant, createUpdateParams } from "./tx.rpc.func.ts"; +import { createVerifyInvariant, createUpdateParams } from "./tx.rpc.func"; export const useVerifyInvariant = buildUseMutation({ builderMutationFn: createVerifyInvariant }); diff --git a/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts index 3b34a74d..089b511d 100644 --- a/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/distribution/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; -import { createGetParams, createGetValidatorDistributionInfo, createGetValidatorOutstandingRewards, createGetValidatorCommission, createGetValidatorSlashes, createGetDelegationRewards, createGetDelegationTotalRewards, createGetDelegatorValidators, createGetDelegatorWithdrawAddress, createGetCommunityPool } from "./query.rpc.func.ts"; +import { createGetParams, createGetValidatorDistributionInfo, createGetValidatorOutstandingRewards, createGetValidatorCommission, createGetValidatorSlashes, createGetDelegationRewards, createGetDelegationTotalRewards, createGetDelegatorValidators, createGetDelegatorWithdrawAddress, createGetCommunityPool } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts index 8cbf0e11..1ebd32c1 100644 --- a/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/distribution/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; -import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func"; export const useSetWithdrawAddress = buildUseMutation({ builderMutationFn: createSetWithdrawAddress }); diff --git a/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts index 6db1024e..f9d7f0f0 100644 --- a/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/evidence/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse } from "./query"; -import { createGetEvidence, createGetAllEvidence } from "./query.rpc.func.ts"; +import { createGetEvidence, createGetAllEvidence } from "./query.rpc.func"; export const useGetEvidence = buildUseQuery({ builderQueryFn: createGetEvidence, queryKeyPrefix: "EvidenceQuery" diff --git a/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts index 57f78e5e..fc6662d0 100644 --- a/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/evidence/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSubmitEvidence } from "./tx"; -import { createSubmitEvidence } from "./tx.rpc.func.ts"; +import { createSubmitEvidence } from "./tx.rpc.func"; export const useSubmitEvidence = buildUseMutation({ builderMutationFn: createSubmitEvidence }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts index 2e06e17a..d72e5d5c 100644 --- a/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/feegrant/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; -import { createGetAllowance, createGetAllowances, createGetAllowancesByGranter } from "./query.rpc.func.ts"; +import { createGetAllowance, createGetAllowances, createGetAllowancesByGranter } from "./query.rpc.func"; export const useGetAllowance = buildUseQuery({ builderQueryFn: createGetAllowance, queryKeyPrefix: "AllowanceQuery" diff --git a/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts index 72de88dc..aa3e4386 100644 --- a/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/feegrant/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; -import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func"; export const useGrantAllowance = buildUseMutation({ builderMutationFn: createGrantAllowance }); diff --git a/libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts index 7a51b586..6c3b7aa4 100644 --- a/libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/gov/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; -import { createGetConstitution, createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +import { createGetConstitution, createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func"; export const useGetConstitution = buildUseQuery({ builderQueryFn: createGetConstitution, queryKeyPrefix: "ConstitutionQuery" diff --git a/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts index 45490d6f..97d993fe 100644 --- a/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/gov/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; -import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func"; export const useSubmitProposal = buildUseMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts index 5f574fba..4e4a6cee 100644 --- a/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/gov/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; -import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func"; export const useGetProposal = buildUseQuery({ builderQueryFn: createGetProposal, queryKeyPrefix: "ProposalQuery" diff --git a/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts index b2fb7805..bc8434e0 100644 --- a/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/gov/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; -import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func"; export const useSubmitProposal = buildUseMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts index cd6fda98..60e5f79f 100644 --- a/libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/group/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse } from "./query"; -import { createGetGroupInfo, createGetGroupPolicyInfo, createGetGroupMembers, createGetGroupsByAdmin, createGetGroupPoliciesByGroup, createGetGroupPoliciesByAdmin, createGetProposal, createGetProposalsByGroupPolicy, createGetVoteByProposalVoter, createGetVotesByProposal, createGetVotesByVoter, createGetGroupsByMember, createGetTallyResult, createGetGroups } from "./query.rpc.func.ts"; +import { createGetGroupInfo, createGetGroupPolicyInfo, createGetGroupMembers, createGetGroupsByAdmin, createGetGroupPoliciesByGroup, createGetGroupPoliciesByAdmin, createGetProposal, createGetProposalsByGroupPolicy, createGetVoteByProposalVoter, createGetVotesByProposal, createGetVotesByVoter, createGetGroupsByMember, createGetTallyResult, createGetGroups } from "./query.rpc.func"; export const useGetGroupInfo = buildUseQuery({ builderQueryFn: createGetGroupInfo, queryKeyPrefix: "GroupInfoQuery" diff --git a/libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts index 25f1ac84..39745d46 100644 --- a/libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/group/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; -import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func"; export const useCreateGroup = buildUseMutation({ builderMutationFn: createCreateGroup }); diff --git a/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts index 9c9b0f31..c0982b56 100644 --- a/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/mint/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; -import { createGetParams, createGetInflation, createGetAnnualProvisions } from "./query.rpc.func.ts"; +import { createGetParams, createGetInflation, createGetAnnualProvisions } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts index 427464a2..4e3e90dd 100644 --- a/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/mint/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgUpdateParams } from "./tx"; -import { createUpdateParams } from "./tx.rpc.func.ts"; +import { createUpdateParams } from "./tx.rpc.func"; export const useUpdateParams = buildUseMutation({ builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts index 860909b4..9060df45 100644 --- a/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/nft/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; -import { createGetBalance, createGetOwner, createGetSupply, createGetNFTs, createGetNFT, createGetClass, createGetClasses } from "./query.rpc.func.ts"; +import { createGetBalance, createGetOwner, createGetSupply, createGetNFTs, createGetNFT, createGetClass, createGetClasses } from "./query.rpc.func"; export const useGetBalance = buildUseQuery({ builderQueryFn: createGetBalance, queryKeyPrefix: "BalanceQuery" diff --git a/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts index 01f2c701..73608d98 100644 --- a/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/nft/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSend } from "./tx"; -import { createSend } from "./tx.rpc.func.ts"; +import { createSend } from "./tx.rpc.func"; export const useSend = buildUseMutation({ builderMutationFn: createSend }); \ No newline at end of file diff --git a/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts index 62fcf321..f778a5d2 100644 --- a/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/orm/query/v1alpha1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../../react-query"; import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; -import { createGetGet, createGetList } from "./query.rpc.func.ts"; +import { createGetGet, createGetList } from "./query.rpc.func"; export const useGetGet = buildUseQuery({ builderQueryFn: createGetGet, queryKeyPrefix: "GetQuery" diff --git a/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts index 9ef0617b..b4699a6d 100644 --- a/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/params/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; -import { createGetParams, createGetSubspaces } from "./query.rpc.func.ts"; +import { createGetParams, createGetSubspaces } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts b/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts index 1cfa2ba9..257ea114 100644 --- a/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/reflection/v1/reflection.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { FileDescriptorsRequest, FileDescriptorsResponse } from "./reflection"; -import { createGetFileDescriptors } from "./reflection.rpc.func.ts"; +import { createGetFileDescriptors } from "./reflection.rpc.func"; export const useGetFileDescriptors = buildUseQuery({ builderQueryFn: createGetFileDescriptors, queryKeyPrefix: "FileDescriptorsQuery" diff --git a/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts index 81907d3e..ae98f9fc 100644 --- a/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/slashing/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./query"; -import { createGetParams, createGetSigningInfo, createGetSigningInfos } from "./query.rpc.func.ts"; +import { createGetParams, createGetSigningInfo, createGetSigningInfos } from "./query.rpc.func"; export const useGetParams = buildUseQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts index f4cbb8c9..0462f9c8 100644 --- a/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/slashing/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgUnjail, MsgUpdateParams } from "./tx"; -import { createUnjail, createUpdateParams } from "./tx.rpc.func.ts"; +import { createUnjail, createUpdateParams } from "./tx.rpc.func"; export const useUnjail = buildUseMutation({ builderMutationFn: createUnjail }); diff --git a/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts index 07eb6ea0..5165efe4 100644 --- a/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/staking/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; -import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func"; export const useGetValidators = buildUseQuery({ builderQueryFn: createGetValidators, queryKeyPrefix: "ValidatorsQuery" diff --git a/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts index a5acb059..5f3b6882 100644 --- a/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/staking/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; -import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func"; export const useCreateValidator = buildUseMutation({ builderMutationFn: createCreateValidator }); diff --git a/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts b/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts index 53085d29..ca1a7278 100644 --- a/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/tx/v1beta1/service.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; -import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func"; export const useGetSimulate = buildUseQuery({ builderQueryFn: createGetSimulate, queryKeyPrefix: "SimulateQuery" diff --git a/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts b/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts index 28870ca0..4d44dac4 100644 --- a/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/upgrade/v1beta1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; -import { createGetCurrentPlan, createGetAppliedPlan, createGetUpgradedConsensusState, createGetModuleVersions, createGetAuthority } from "./query.rpc.func.ts"; +import { createGetCurrentPlan, createGetAppliedPlan, createGetUpgradedConsensusState, createGetModuleVersions, createGetAuthority } from "./query.rpc.func"; export const useGetCurrentPlan = buildUseQuery({ builderQueryFn: createGetCurrentPlan, queryKeyPrefix: "CurrentPlanQuery" diff --git a/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts index 83144e14..49bc9f49 100644 --- a/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/upgrade/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; -import { createSoftwareUpgrade, createCancelUpgrade } from "./tx.rpc.func.ts"; +import { createSoftwareUpgrade, createCancelUpgrade } from "./tx.rpc.func"; export const useSoftwareUpgrade = buildUseMutation({ builderMutationFn: createSoftwareUpgrade }); diff --git a/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts b/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts index 9c725c4e..01630803 100644 --- a/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmos/vesting/v1beta1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; -import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func"; export const useCreateVestingAccount = buildUseMutation({ builderMutationFn: createCreateVestingAccount }); diff --git a/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts b/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts index b71686d0..73c80137 100644 --- a/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts +++ b/libs/interchain-react/src/cosmwasm/wasm/v1/query.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseQuery } from "../../../react-query"; import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; -import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func"; export const useGetContractInfo = buildUseQuery({ builderQueryFn: createGetContractInfo, queryKeyPrefix: "ContractInfoQuery" diff --git a/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts b/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts index 602a0f30..e1f9f523 100644 --- a/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/cosmwasm/wasm/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../react-query"; import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; -import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func"; export const useStoreCode = buildUseMutation({ builderMutationFn: createStoreCode }); diff --git a/libs/interchain-react/src/extern.ts b/libs/interchain-react/src/extern.ts index eddf067e..31da6877 100644 --- a/libs/interchain-react/src/extern.ts +++ b/libs/interchain-react/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/helper-func-types.ts b/libs/interchain-react/src/helper-func-types.ts index 7aeeb7bc..d24ac8e0 100644 --- a/libs/interchain-react/src/helper-func-types.ts +++ b/libs/interchain-react/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/helpers.ts b/libs/interchain-react/src/helpers.ts index ba68bbdb..b6fb6c90 100644 --- a/libs/interchain-react/src/helpers.ts +++ b/libs/interchain-react/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts index 7130abbd..3bc9387f 100644 --- a/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/ibc/applications/transfer/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgTransfer, MsgUpdateParams } from "./tx"; -import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func"; export const useTransfer = buildUseMutation({ builderMutationFn: createTransfer }); diff --git a/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts index a11760aa..40dde7f9 100644 --- a/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/ibc/core/channel/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; -import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func"; export const useChannelOpenInit = buildUseMutation({ builderMutationFn: createChannelOpenInit }); diff --git a/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts index 81bbd9ca..cfcf34ff 100644 --- a/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/ibc/core/client/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; -import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func"; export const useCreateClient = buildUseMutation({ builderMutationFn: createCreateClient }); diff --git a/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts b/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts index f4eefea2..a1b49465 100644 --- a/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts +++ b/libs/interchain-react/src/ibc/core/connection/v1/tx.rpc.react.ts @@ -1,6 +1,6 @@ import { buildUseMutation } from "../../../../react-query"; import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; -import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func"; export const useConnectionOpenInit = buildUseMutation({ builderMutationFn: createConnectionOpenInit }); diff --git a/libs/interchain-react/src/react-query.ts b/libs/interchain-react/src/react-query.ts index f26d1ce2..3c698ea3 100644 --- a/libs/interchain-react/src/react-query.ts +++ b/libs/interchain-react/src/react-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/registry.ts b/libs/interchain-react/src/registry.ts index 1581e912..98291dff 100644 --- a/libs/interchain-react/src/registry.ts +++ b/libs/interchain-react/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/types.ts b/libs/interchain-react/src/types.ts index cdcfbdf9..f3785169 100644 --- a/libs/interchain-react/src/types.ts +++ b/libs/interchain-react/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/utf8.ts b/libs/interchain-react/src/utf8.ts index c0f5c97c..c8c688c2 100644 --- a/libs/interchain-react/src/utf8.ts +++ b/libs/interchain-react/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/varint.ts b/libs/interchain-react/src/varint.ts index 70a851bd..3f1ff3be 100644 --- a/libs/interchain-react/src/varint.ts +++ b/libs/interchain-react/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/binary.ts b/libs/interchain-vue/src/binary.ts index e6922501..15b28924 100644 --- a/libs/interchain-vue/src/binary.ts +++ b/libs/interchain-vue/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts index e40053f0..a4fe6d04 100644 --- a/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/app/v1alpha1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryConfigRequest, QueryConfigResponse } from "./query"; -import { createGetConfig } from "./query.rpc.func.ts"; +import { createGetConfig } from "./query.rpc.func"; export const useGetConfig = buildUseVueQuery({ builderQueryFn: createGetConfig, queryKeyPrefix: "ConfigQuery" diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts index b09ee08f..77347dda 100644 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; -import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func.ts"; +import { createGetAccounts, createGetAccount, createGetAccountAddressByID, createGetParams, createGetModuleAccounts, createGetModuleAccountByName, createGetBech32Prefix, createGetAddressBytesToString, createGetAddressStringToBytes, createGetAccountInfo } from "./query.rpc.func"; export const useGetAccounts = buildUseVueQuery({ builderQueryFn: createGetAccounts, queryKeyPrefix: "AccountsQuery" diff --git a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts index 9b8d58b6..b8f2b8fb 100644 --- a/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/auth/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgUpdateParams } from "./tx"; -import { createUpdateParams } from "./tx.rpc.func.ts"; +import { createUpdateParams } from "./tx.rpc.func"; export const useUpdateParams = buildUseVueMutation({ builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts index 9cfcad77..524b5e0e 100644 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; -import { createGetGrants, createGetGranterGrants, createGetGranteeGrants } from "./query.rpc.func.ts"; +import { createGetGrants, createGetGranterGrants, createGetGranteeGrants } from "./query.rpc.func"; export const useGetGrants = buildUseVueQuery({ builderQueryFn: createGetGrants, queryKeyPrefix: "GrantsQuery" diff --git a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts index 214f14b1..cbb0f840 100644 --- a/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/authz/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; -import { createGrant, createExec, createRevoke } from "./tx.rpc.func.ts"; +import { createGrant, createExec, createRevoke } from "./tx.rpc.func"; export const useGrant = buildUseVueMutation({ builderMutationFn: createGrant }); diff --git a/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts index ec9ede15..7f7863e6 100644 --- a/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/autocli/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { AppOptionsRequest, AppOptionsResponse } from "./query"; -import { createGetAppOptions } from "./query.rpc.func.ts"; +import { createGetAppOptions } from "./query.rpc.func"; export const useGetAppOptions = buildUseVueQuery({ builderQueryFn: createGetAppOptions, queryKeyPrefix: "AppOptionsQuery" diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts index fb0e2f44..410768a3 100644 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; -import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func.ts"; +import { createGetBalance, createGetAllBalances, createGetSpendableBalances, createGetSpendableBalanceByDenom, createGetTotalSupply, createGetSupplyOf, createGetParams, createGetDenomMetadata, createGetDenomMetadataByQueryString, createGetDenomsMetadata, createGetDenomOwners, createGetDenomOwnersByQuery, createGetSendEnabled } from "./query.rpc.func"; export const useGetBalance = buildUseVueQuery({ builderQueryFn: createGetBalance, queryKeyPrefix: "BalanceQuery" diff --git a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts index 654e3c48..9f830b69 100644 --- a/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/bank/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; -import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func.ts"; +import { createSend, createMultiSend, createUpdateParams, createSetSendEnabled } from "./tx.rpc.func"; export const useSend = buildUseVueMutation({ builderMutationFn: createSend }); diff --git a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts index 520677c3..03fe257f 100644 --- a/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/base/grpc/v2/service.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../../vue-query"; import { QueryRequest, QueryResponse, ListQueryHandlersRequest, ListQueryHandlersResponse } from "./service"; -import { createGetQuery, createGetListQueryHandlers } from "./service.rpc.func.ts"; +import { createGetQuery, createGetListQueryHandlers } from "./service.rpc.func"; export const useGetQuery = buildUseVueQuery({ builderQueryFn: createGetQuery, queryKeyPrefix: "QueryQuery" diff --git a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts index a8b14c30..b5e5343f 100644 --- a/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/base/node/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../../vue-query"; import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; -import { createGetConfig, createGetStatus } from "./query.rpc.func.ts"; +import { createGetConfig, createGetStatus } from "./query.rpc.func"; export const useGetConfig = buildUseVueQuery({ builderQueryFn: createGetConfig, queryKeyPrefix: "ConfigQuery" diff --git a/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts index c019de62..b959f05b 100644 --- a/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/base/node/v2/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../../vue-query"; import { ConfigRequest, ConfigResponse } from "./query"; -import { createGetConfig } from "./query.rpc.func.ts"; +import { createGetConfig } from "./query.rpc.func"; export const useGetConfig = buildUseVueQuery({ builderQueryFn: createGetConfig, queryKeyPrefix: "ConfigQuery" diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts index 377fdb31..972c718e 100644 --- a/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/base/reflection/v1beta1/reflection.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../../vue-query"; import { ListAllInterfacesRequest, ListAllInterfacesResponse, ListImplementationsRequest, ListImplementationsResponse } from "./reflection"; -import { createGetListAllInterfaces, createGetListImplementations } from "./reflection.rpc.func.ts"; +import { createGetListAllInterfaces, createGetListImplementations } from "./reflection.rpc.func"; export const useGetListAllInterfaces = buildUseVueQuery({ builderQueryFn: createGetListAllInterfaces, queryKeyPrefix: "ListAllInterfacesQuery" diff --git a/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts index 342d01a6..70851453 100644 --- a/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/base/reflection/v2alpha1/reflection.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../../vue-query"; import { GetAuthnDescriptorRequest, GetAuthnDescriptorResponse, GetChainDescriptorRequest, GetChainDescriptorResponse, GetCodecDescriptorRequest, GetCodecDescriptorResponse, GetConfigurationDescriptorRequest, GetConfigurationDescriptorResponse, GetQueryServicesDescriptorRequest, GetQueryServicesDescriptorResponse, GetTxDescriptorRequest, GetTxDescriptorResponse } from "./reflection"; -import { createGetGetAuthnDescriptor, createGetGetChainDescriptor, createGetGetCodecDescriptor, createGetGetConfigurationDescriptor, createGetGetQueryServicesDescriptor, createGetGetTxDescriptor } from "./reflection.rpc.func.ts"; +import { createGetGetAuthnDescriptor, createGetGetChainDescriptor, createGetGetCodecDescriptor, createGetGetConfigurationDescriptor, createGetGetQueryServicesDescriptor, createGetGetTxDescriptor } from "./reflection.rpc.func"; export const useGetGetAuthnDescriptor = buildUseVueQuery({ builderQueryFn: createGetGetAuthnDescriptor, queryKeyPrefix: "GetAuthnDescriptorQuery" diff --git a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts index 102bf297..094239a2 100644 --- a/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/base/tendermint/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../../vue-query"; import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; -import { createGetGetNodeInfo, createGetGetSyncing, createGetGetLatestBlock, createGetGetBlockByHeight, createGetGetLatestValidatorSet, createGetGetValidatorSetByHeight, createGetABCIQuery } from "./query.rpc.func.ts"; +import { createGetGetNodeInfo, createGetGetSyncing, createGetGetLatestBlock, createGetGetBlockByHeight, createGetGetLatestValidatorSet, createGetGetValidatorSetByHeight, createGetABCIQuery } from "./query.rpc.func"; export const useGetGetNodeInfo = buildUseVueQuery({ builderQueryFn: createGetGetNodeInfo, queryKeyPrefix: "GetNodeInfoQuery" diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts index 2b18b347..a7d0fc2e 100644 --- a/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/circuit/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse } from "./query"; -import { createGetAccount, createGetAccounts, createGetDisabledList } from "./query.rpc.func.ts"; +import { createGetAccount, createGetAccounts, createGetDisabledList } from "./query.rpc.func"; export const useGetAccount = buildUseVueQuery({ builderQueryFn: createGetAccount, queryKeyPrefix: "AccountQuery" diff --git a/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts index 705f1cff..9bf6b0bf 100644 --- a/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/circuit/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; -import { createAuthorizeCircuitBreaker, createTripCircuitBreaker, createResetCircuitBreaker } from "./tx.rpc.func.ts"; +import { createAuthorizeCircuitBreaker, createTripCircuitBreaker, createResetCircuitBreaker } from "./tx.rpc.func"; export const useAuthorizeCircuitBreaker = buildUseVueMutation({ builderMutationFn: createAuthorizeCircuitBreaker }); diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts index ccdb727b..1a786a68 100644 --- a/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/consensus/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse } from "./query"; -import { createGetParams } from "./query.rpc.func.ts"; +import { createGetParams } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts index 9b8d58b6..b8f2b8fb 100644 --- a/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/consensus/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgUpdateParams } from "./tx"; -import { createUpdateParams } from "./tx.rpc.func.ts"; +import { createUpdateParams } from "./tx.rpc.func"; export const useUpdateParams = buildUseVueMutation({ builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts index 58a72d6a..17d23f0c 100644 --- a/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/crisis/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; -import { createVerifyInvariant, createUpdateParams } from "./tx.rpc.func.ts"; +import { createVerifyInvariant, createUpdateParams } from "./tx.rpc.func"; export const useVerifyInvariant = buildUseVueMutation({ builderMutationFn: createVerifyInvariant }); diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts index 5c8f9a60..138caede 100644 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; -import { createGetParams, createGetValidatorDistributionInfo, createGetValidatorOutstandingRewards, createGetValidatorCommission, createGetValidatorSlashes, createGetDelegationRewards, createGetDelegationTotalRewards, createGetDelegatorValidators, createGetDelegatorWithdrawAddress, createGetCommunityPool } from "./query.rpc.func.ts"; +import { createGetParams, createGetValidatorDistributionInfo, createGetValidatorOutstandingRewards, createGetValidatorCommission, createGetValidatorSlashes, createGetDelegationRewards, createGetDelegationTotalRewards, createGetDelegatorValidators, createGetDelegatorWithdrawAddress, createGetCommunityPool } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts index 51d3ad25..5b4bda13 100644 --- a/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/distribution/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; -import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func.ts"; +import { createSetWithdrawAddress, createWithdrawDelegatorReward, createWithdrawValidatorCommission, createFundCommunityPool, createUpdateParams, createCommunityPoolSpend, createDepositValidatorRewardsPool } from "./tx.rpc.func"; export const useSetWithdrawAddress = buildUseVueMutation({ builderMutationFn: createSetWithdrawAddress }); diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts index f370dfee..9a4dcca0 100644 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse } from "./query"; -import { createGetEvidence, createGetAllEvidence } from "./query.rpc.func.ts"; +import { createGetEvidence, createGetAllEvidence } from "./query.rpc.func"; export const useGetEvidence = buildUseVueQuery({ builderQueryFn: createGetEvidence, queryKeyPrefix: "EvidenceQuery" diff --git a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts index b4a38940..e0d18138 100644 --- a/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/evidence/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSubmitEvidence } from "./tx"; -import { createSubmitEvidence } from "./tx.rpc.func.ts"; +import { createSubmitEvidence } from "./tx.rpc.func"; export const useSubmitEvidence = buildUseVueMutation({ builderMutationFn: createSubmitEvidence }); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts index b4282d36..6aaea083 100644 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; -import { createGetAllowance, createGetAllowances, createGetAllowancesByGranter } from "./query.rpc.func.ts"; +import { createGetAllowance, createGetAllowances, createGetAllowancesByGranter } from "./query.rpc.func"; export const useGetAllowance = buildUseVueQuery({ builderQueryFn: createGetAllowance, queryKeyPrefix: "AllowanceQuery" diff --git a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts index 1cf9e374..a20bbe20 100644 --- a/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/feegrant/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; -import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func.ts"; +import { createGrantAllowance, createRevokeAllowance, createPruneAllowances } from "./tx.rpc.func"; export const useGrantAllowance = buildUseVueMutation({ builderMutationFn: createGrantAllowance }); diff --git a/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts index cc87fbbc..d72e7e9e 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; -import { createGetConstitution, createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +import { createGetConstitution, createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func"; export const useGetConstitution = buildUseVueQuery({ builderQueryFn: createGetConstitution, queryKeyPrefix: "ConstitutionQuery" diff --git a/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts index 603f5139..59306c6a 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; -import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createExecLegacyContent, createVote, createVoteWeighted, createDeposit, createUpdateParams, createCancelProposal } from "./tx.rpc.func"; export const useSubmitProposal = buildUseVueMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts index 1771e4a1..7187e56d 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; -import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func.ts"; +import { createGetProposal, createGetProposals, createGetVote, createGetVotes, createGetParams, createGetDeposit, createGetDeposits, createGetTallyResult } from "./query.rpc.func"; export const useGetProposal = buildUseVueQuery({ builderQueryFn: createGetProposal, queryKeyPrefix: "ProposalQuery" diff --git a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts index f1bc66da..f6e83e99 100644 --- a/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/gov/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; -import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func.ts"; +import { createSubmitProposal, createVote, createVoteWeighted, createDeposit } from "./tx.rpc.func"; export const useSubmitProposal = buildUseVueMutation({ builderMutationFn: createSubmitProposal }); diff --git a/libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts index 6a01b3a5..a1543f4d 100644 --- a/libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/group/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse } from "./query"; -import { createGetGroupInfo, createGetGroupPolicyInfo, createGetGroupMembers, createGetGroupsByAdmin, createGetGroupPoliciesByGroup, createGetGroupPoliciesByAdmin, createGetProposal, createGetProposalsByGroupPolicy, createGetVoteByProposalVoter, createGetVotesByProposal, createGetVotesByVoter, createGetGroupsByMember, createGetTallyResult, createGetGroups } from "./query.rpc.func.ts"; +import { createGetGroupInfo, createGetGroupPolicyInfo, createGetGroupMembers, createGetGroupsByAdmin, createGetGroupPoliciesByGroup, createGetGroupPoliciesByAdmin, createGetProposal, createGetProposalsByGroupPolicy, createGetVoteByProposalVoter, createGetVotesByProposal, createGetVotesByVoter, createGetGroupsByMember, createGetTallyResult, createGetGroups } from "./query.rpc.func"; export const useGetGroupInfo = buildUseVueQuery({ builderQueryFn: createGetGroupInfo, queryKeyPrefix: "GroupInfoQuery" diff --git a/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts index ed9a30e0..ef3d3927 100644 --- a/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/group/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; -import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func.ts"; +import { createCreateGroup, createUpdateGroupMembers, createUpdateGroupAdmin, createUpdateGroupMetadata, createCreateGroupPolicy, createCreateGroupWithPolicy, createUpdateGroupPolicyAdmin, createUpdateGroupPolicyDecisionPolicy, createUpdateGroupPolicyMetadata, createSubmitProposal, createWithdrawProposal, createVote, createExec, createLeaveGroup } from "./tx.rpc.func"; export const useCreateGroup = buildUseVueMutation({ builderMutationFn: createCreateGroup }); diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts index 224f8a34..2529712e 100644 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; -import { createGetParams, createGetInflation, createGetAnnualProvisions } from "./query.rpc.func.ts"; +import { createGetParams, createGetInflation, createGetAnnualProvisions } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts index 9b8d58b6..b8f2b8fb 100644 --- a/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/mint/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgUpdateParams } from "./tx"; -import { createUpdateParams } from "./tx.rpc.func.ts"; +import { createUpdateParams } from "./tx.rpc.func"; export const useUpdateParams = buildUseVueMutation({ builderMutationFn: createUpdateParams }); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts index f0fb8231..2603e7e0 100644 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; -import { createGetBalance, createGetOwner, createGetSupply, createGetNFTs, createGetNFT, createGetClass, createGetClasses } from "./query.rpc.func.ts"; +import { createGetBalance, createGetOwner, createGetSupply, createGetNFTs, createGetNFT, createGetClass, createGetClasses } from "./query.rpc.func"; export const useGetBalance = buildUseVueQuery({ builderQueryFn: createGetBalance, queryKeyPrefix: "BalanceQuery" diff --git a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts index 6ec53ef6..72f74016 100644 --- a/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/nft/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSend } from "./tx"; -import { createSend } from "./tx.rpc.func.ts"; +import { createSend } from "./tx.rpc.func"; export const useSend = buildUseVueMutation({ builderMutationFn: createSend }); \ No newline at end of file diff --git a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts index 1d9671d9..3f5defc1 100644 --- a/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/orm/query/v1alpha1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../../vue-query"; import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; -import { createGetGet, createGetList } from "./query.rpc.func.ts"; +import { createGetGet, createGetList } from "./query.rpc.func"; export const useGetGet = buildUseVueQuery({ builderQueryFn: createGetGet, queryKeyPrefix: "GetQuery" diff --git a/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts index 2b06be90..4ff7e62c 100644 --- a/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/params/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; -import { createGetParams, createGetSubspaces } from "./query.rpc.func.ts"; +import { createGetParams, createGetSubspaces } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts index dd4805e1..fca7a8bf 100644 --- a/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/reflection/v1/reflection.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { FileDescriptorsRequest, FileDescriptorsResponse } from "./reflection"; -import { createGetFileDescriptors } from "./reflection.rpc.func.ts"; +import { createGetFileDescriptors } from "./reflection.rpc.func"; export const useGetFileDescriptors = buildUseVueQuery({ builderQueryFn: createGetFileDescriptors, queryKeyPrefix: "FileDescriptorsQuery" diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts index cc3cd01d..b1c646a8 100644 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./query"; -import { createGetParams, createGetSigningInfo, createGetSigningInfos } from "./query.rpc.func.ts"; +import { createGetParams, createGetSigningInfo, createGetSigningInfos } from "./query.rpc.func"; export const useGetParams = buildUseVueQuery({ builderQueryFn: createGetParams, queryKeyPrefix: "ParamsQuery" diff --git a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts index 6a1fd7d8..777289d6 100644 --- a/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/slashing/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgUnjail, MsgUpdateParams } from "./tx"; -import { createUnjail, createUpdateParams } from "./tx.rpc.func.ts"; +import { createUnjail, createUpdateParams } from "./tx.rpc.func"; export const useUnjail = buildUseVueMutation({ builderMutationFn: createUnjail }); diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts index 92fc3c20..d43619b5 100644 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; -import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func.ts"; +import { createGetValidators, createGetValidator, createGetValidatorDelegations, createGetValidatorUnbondingDelegations, createGetDelegation, createGetUnbondingDelegation, createGetDelegatorDelegations, createGetDelegatorUnbondingDelegations, createGetRedelegations, createGetDelegatorValidators, createGetDelegatorValidator, createGetHistoricalInfo, createGetPool, createGetParams } from "./query.rpc.func"; export const useGetValidators = buildUseVueQuery({ builderQueryFn: createGetValidators, queryKeyPrefix: "ValidatorsQuery" diff --git a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts index 57a83c0e..f58b0e85 100644 --- a/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/staking/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; -import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func.ts"; +import { createCreateValidator, createEditValidator, createDelegate, createBeginRedelegate, createUndelegate, createCancelUnbondingDelegation, createUpdateParams } from "./tx.rpc.func"; export const useCreateValidator = buildUseVueMutation({ builderMutationFn: createCreateValidator }); diff --git a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts index c3e8714b..3e15c64a 100644 --- a/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/tx/v1beta1/service.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; -import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func.ts"; +import { createGetSimulate, createGetGetTx, createGetBroadcastTx, createGetGetTxsEvent, createGetGetBlockWithTxs, createGetTxDecode, createGetTxEncode, createGetTxEncodeAmino, createGetTxDecodeAmino } from "./service.rpc.func"; export const useGetSimulate = buildUseVueQuery({ builderQueryFn: createGetSimulate, queryKeyPrefix: "SimulateQuery" diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts index e8a93ccc..70321c05 100644 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; -import { createGetCurrentPlan, createGetAppliedPlan, createGetUpgradedConsensusState, createGetModuleVersions, createGetAuthority } from "./query.rpc.func.ts"; +import { createGetCurrentPlan, createGetAppliedPlan, createGetUpgradedConsensusState, createGetModuleVersions, createGetAuthority } from "./query.rpc.func"; export const useGetCurrentPlan = buildUseVueQuery({ builderQueryFn: createGetCurrentPlan, queryKeyPrefix: "CurrentPlanQuery" diff --git a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts index a57a6b6d..f4a8d2b2 100644 --- a/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/upgrade/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; -import { createSoftwareUpgrade, createCancelUpgrade } from "./tx.rpc.func.ts"; +import { createSoftwareUpgrade, createCancelUpgrade } from "./tx.rpc.func"; export const useSoftwareUpgrade = buildUseVueMutation({ builderMutationFn: createSoftwareUpgrade }); diff --git a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts index a5ff2e80..8e7c5ec6 100644 --- a/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmos/vesting/v1beta1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; -import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func.ts"; +import { createCreateVestingAccount, createCreatePermanentLockedAccount, createCreatePeriodicVestingAccount } from "./tx.rpc.func"; export const useCreateVestingAccount = buildUseVueMutation({ builderMutationFn: createCreateVestingAccount }); diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts index d021b1a4..329cb307 100644 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/query.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueQuery } from "../../../vue-query"; import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; -import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func.ts"; +import { createGetContractInfo, createGetContractHistory, createGetContractsByCode, createGetAllContractState, createGetRawContractState, createGetSmartContractState, createGetCode, createGetCodes, createGetCodeInfo, createGetPinnedCodes, createGetParams, createGetContractsByCreator, createGetWasmLimitsConfig, createGetBuildAddress } from "./query.rpc.func"; export const useGetContractInfo = buildUseVueQuery({ builderQueryFn: createGetContractInfo, queryKeyPrefix: "ContractInfoQuery" diff --git a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts index 9cf6e9ad..0c0a2784 100644 --- a/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/cosmwasm/wasm/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../vue-query"; import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; -import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func.ts"; +import { createStoreCode, createInstantiateContract, createInstantiateContract2, createExecuteContract, createMigrateContract, createUpdateAdmin, createClearAdmin, createUpdateInstantiateConfig, createUpdateParams, createSudoContract, createPinCodes, createUnpinCodes, createStoreAndInstantiateContract, createRemoveCodeUploadParamsAddresses, createAddCodeUploadParamsAddresses, createStoreAndMigrateContract, createUpdateContractLabel } from "./tx.rpc.func"; export const useStoreCode = buildUseVueMutation({ builderMutationFn: createStoreCode }); diff --git a/libs/interchain-vue/src/extern.ts b/libs/interchain-vue/src/extern.ts index eddf067e..31da6877 100644 --- a/libs/interchain-vue/src/extern.ts +++ b/libs/interchain-vue/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/helper-func-types.ts b/libs/interchain-vue/src/helper-func-types.ts index 4f82736b..52876789 100644 --- a/libs/interchain-vue/src/helper-func-types.ts +++ b/libs/interchain-vue/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/helpers.ts b/libs/interchain-vue/src/helpers.ts index ba68bbdb..b6fb6c90 100644 --- a/libs/interchain-vue/src/helpers.ts +++ b/libs/interchain-vue/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts index ab0c0e79..86a2a4b1 100644 --- a/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/ibc/applications/transfer/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgTransfer, MsgUpdateParams } from "./tx"; -import { createTransfer, createUpdateParams } from "./tx.rpc.func.ts"; +import { createTransfer, createUpdateParams } from "./tx.rpc.func"; export const useTransfer = buildUseVueMutation({ builderMutationFn: createTransfer }); diff --git a/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts index 106d8e60..49e06b6b 100644 --- a/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/ibc/core/channel/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; -import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func.ts"; +import { createChannelOpenInit, createChannelOpenTry, createChannelOpenAck, createChannelOpenConfirm, createChannelCloseInit, createChannelCloseConfirm, createRecvPacket, createTimeout, createTimeoutOnClose, createAcknowledgement, createChannelUpgradeInit, createChannelUpgradeTry, createChannelUpgradeAck, createChannelUpgradeConfirm, createChannelUpgradeOpen, createChannelUpgradeTimeout, createChannelUpgradeCancel, createUpdateChannelParams, createPruneAcknowledgements } from "./tx.rpc.func"; export const useChannelOpenInit = buildUseVueMutation({ builderMutationFn: createChannelOpenInit }); diff --git a/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts index e58f7de8..ce7e0e07 100644 --- a/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/ibc/core/client/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; -import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func.ts"; +import { createCreateClient, createUpdateClient, createUpgradeClient, createSubmitMisbehaviour, createRecoverClient, createIBCSoftwareUpgrade, createUpdateClientParams } from "./tx.rpc.func"; export const useCreateClient = buildUseVueMutation({ builderMutationFn: createCreateClient }); diff --git a/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts b/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts index 8e33749b..f553390e 100644 --- a/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts +++ b/libs/interchain-vue/src/ibc/core/connection/v1/tx.rpc.vue.ts @@ -1,6 +1,6 @@ import { buildUseVueMutation } from "../../../../vue-query"; import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; -import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func.ts"; +import { createConnectionOpenInit, createConnectionOpenTry, createConnectionOpenAck, createConnectionOpenConfirm, createUpdateConnectionParams } from "./tx.rpc.func"; export const useConnectionOpenInit = buildUseVueMutation({ builderMutationFn: createConnectionOpenInit }); diff --git a/libs/interchain-vue/src/registry.ts b/libs/interchain-vue/src/registry.ts index 1581e912..98291dff 100644 --- a/libs/interchain-vue/src/registry.ts +++ b/libs/interchain-vue/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/types.ts b/libs/interchain-vue/src/types.ts index cdcfbdf9..f3785169 100644 --- a/libs/interchain-vue/src/types.ts +++ b/libs/interchain-vue/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/utf8.ts b/libs/interchain-vue/src/utf8.ts index c0f5c97c..c8c688c2 100644 --- a/libs/interchain-vue/src/utf8.ts +++ b/libs/interchain-vue/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/varint.ts b/libs/interchain-vue/src/varint.ts index 70a851bd..3f1ff3be 100644 --- a/libs/interchain-vue/src/varint.ts +++ b/libs/interchain-vue/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/vue-query.ts b/libs/interchain-vue/src/vue-query.ts index 867bd9f3..78d0f433 100644 --- a/libs/interchain-vue/src/vue-query.ts +++ b/libs/interchain-vue/src/vue-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ @@ -205,7 +205,7 @@ export interface UseMutationBuilderOptions { clientResolver?: SigningClientResolver ) => ( signerAddress: string, - message: TMsg, + message: TMsg | TMsg[], fee: StdFee | 'auto', memo: string ) => Promise; diff --git a/libs/interchainjs/src/binary.ts b/libs/interchainjs/src/binary.ts index e6922501..15b28924 100644 --- a/libs/interchainjs/src/binary.ts +++ b/libs/interchainjs/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/extern.ts b/libs/interchainjs/src/extern.ts index eddf067e..31da6877 100644 --- a/libs/interchainjs/src/extern.ts +++ b/libs/interchainjs/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/helper-func-types.ts b/libs/interchainjs/src/helper-func-types.ts index 7aeeb7bc..d24ac8e0 100644 --- a/libs/interchainjs/src/helper-func-types.ts +++ b/libs/interchainjs/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/helpers.ts b/libs/interchainjs/src/helpers.ts index ba68bbdb..b6fb6c90 100644 --- a/libs/interchainjs/src/helpers.ts +++ b/libs/interchainjs/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/registry.ts b/libs/interchainjs/src/registry.ts index 1581e912..98291dff 100644 --- a/libs/interchainjs/src/registry.ts +++ b/libs/interchainjs/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/types.ts b/libs/interchainjs/src/types.ts index cdcfbdf9..f3785169 100644 --- a/libs/interchainjs/src/types.ts +++ b/libs/interchainjs/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/utf8.ts b/libs/interchainjs/src/utf8.ts index c0f5c97c..c8c688c2 100644 --- a/libs/interchainjs/src/utf8.ts +++ b/libs/interchainjs/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/varint.ts b/libs/interchainjs/src/varint.ts index 70a851bd..3f1ff3be 100644 --- a/libs/interchainjs/src/varint.ts +++ b/libs/interchainjs/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/package.json b/package.json index 855ffb39..e94f2e67 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@chain-registry/client": "1.18.1", "@confio/relayer": "^0.12.0", "@cosmjs/crypto": "^0.32.2", - "@cosmology/telescope": "^1.11.12", + "@cosmology/telescope": "^1.11.15", "@injectivelabs/networks": "^1.14.13", "@injectivelabs/sdk-ts": "^1.14.13", "@injectivelabs/wallet-ts": "^1.14.13", diff --git a/yarn.lock b/yarn.lock index b52e9580..9e439558 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1763,10 +1763,10 @@ "@types/node" ">=13.7.0" long "^5.0.0" -"@cosmology/telescope@^1.11.12": - version "1.11.12" - resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.11.12.tgz#26945657223edadd4ac8d505351e70854a3d330b" - integrity sha512-FLtaQuwVZwMbMbFdIdFQNgGiywG3DZtVM2ebICyavSMZKuEPuH1vYKws6XF7utj+et1LNamHUsTusRE9GxmotQ== +"@cosmology/telescope@^1.11.15": + version "1.11.15" + resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.11.15.tgz#b24b8e85613971b70e939d7c584262a41a25665e" + integrity sha512-VTXOuLgn34cY5B5ZxbIAVtBgM+li/PHbNWvE+jQX0Wjlu2V+FkMHykwVhmBwGlvy/u27hnXVli5NMBwnGnL2MQ== dependencies: "@babel/generator" "^7.23.6" "@babel/parser" "^7.23.6" From fe57b93cda5cfa548a4dc9d941bb4ab2f6997547 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 27 Jan 2025 08:04:34 +0800 Subject: [PATCH 3/3] upgrade telescope to 1.11.16 and regen --- libs/cosmos-types/src/binary.ts | 2 +- libs/cosmos-types/src/extern.ts | 2 +- libs/cosmos-types/src/helper-func-types.ts | 2 +- libs/cosmos-types/src/helpers.ts | 2 +- libs/cosmos-types/src/types.ts | 2 +- libs/cosmos-types/src/utf8.ts | 2 +- libs/cosmos-types/src/varint.ts | 2 +- libs/injective-react/src/binary.ts | 2 +- libs/injective-react/src/extern.ts | 2 +- libs/injective-react/src/helper-func-types.ts | 2 +- libs/injective-react/src/helpers.ts | 2 +- libs/injective-react/src/react-query.ts | 2 +- libs/injective-react/src/registry.ts | 2 +- libs/injective-react/src/types.ts | 2 +- libs/injective-react/src/utf8.ts | 2 +- libs/injective-react/src/varint.ts | 2 +- libs/injective-vue/src/binary.ts | 2 +- libs/injective-vue/src/extern.ts | 2 +- libs/injective-vue/src/helper-func-types.ts | 2 +- libs/injective-vue/src/helpers.ts | 2 +- libs/injective-vue/src/registry.ts | 2 +- libs/injective-vue/src/types.ts | 2 +- libs/injective-vue/src/utf8.ts | 2 +- libs/injective-vue/src/varint.ts | 2 +- libs/injective-vue/src/vue-query.ts | 2 +- libs/injectivejs/src/binary.ts | 2 +- libs/injectivejs/src/extern.ts | 2 +- libs/injectivejs/src/helper-func-types.ts | 2 +- libs/injectivejs/src/helpers.ts | 2 +- libs/injectivejs/src/registry.ts | 2 +- libs/injectivejs/src/types.ts | 2 +- libs/injectivejs/src/utf8.ts | 2 +- libs/injectivejs/src/varint.ts | 2 +- libs/interchain-react/src/binary.ts | 2 +- libs/interchain-react/src/extern.ts | 2 +- libs/interchain-react/src/helper-func-types.ts | 2 +- libs/interchain-react/src/helpers.ts | 2 +- libs/interchain-react/src/react-query.ts | 2 +- libs/interchain-react/src/registry.ts | 2 +- libs/interchain-react/src/types.ts | 2 +- libs/interchain-react/src/utf8.ts | 2 +- libs/interchain-react/src/varint.ts | 2 +- libs/interchain-vue/src/binary.ts | 2 +- libs/interchain-vue/src/extern.ts | 2 +- libs/interchain-vue/src/helper-func-types.ts | 2 +- libs/interchain-vue/src/helpers.ts | 2 +- libs/interchain-vue/src/registry.ts | 2 +- libs/interchain-vue/src/types.ts | 2 +- libs/interchain-vue/src/utf8.ts | 2 +- libs/interchain-vue/src/varint.ts | 2 +- libs/interchain-vue/src/vue-query.ts | 2 +- libs/interchainjs/src/binary.ts | 2 +- libs/interchainjs/src/extern.ts | 2 +- libs/interchainjs/src/helper-func-types.ts | 2 +- libs/interchainjs/src/helpers.ts | 2 +- libs/interchainjs/src/registry.ts | 2 +- libs/interchainjs/src/types.ts | 2 +- libs/interchainjs/src/utf8.ts | 2 +- libs/interchainjs/src/varint.ts | 2 +- package.json | 2 +- yarn.lock | 8 ++++---- 61 files changed, 64 insertions(+), 64 deletions(-) diff --git a/libs/cosmos-types/src/binary.ts b/libs/cosmos-types/src/binary.ts index 15b28924..b36a33fe 100644 --- a/libs/cosmos-types/src/binary.ts +++ b/libs/cosmos-types/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/extern.ts b/libs/cosmos-types/src/extern.ts index 31da6877..83abea1f 100644 --- a/libs/cosmos-types/src/extern.ts +++ b/libs/cosmos-types/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/helper-func-types.ts b/libs/cosmos-types/src/helper-func-types.ts index 52876789..a6a39641 100644 --- a/libs/cosmos-types/src/helper-func-types.ts +++ b/libs/cosmos-types/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/helpers.ts b/libs/cosmos-types/src/helpers.ts index b6fb6c90..379912ff 100644 --- a/libs/cosmos-types/src/helpers.ts +++ b/libs/cosmos-types/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/types.ts b/libs/cosmos-types/src/types.ts index f3785169..ce7bd697 100644 --- a/libs/cosmos-types/src/types.ts +++ b/libs/cosmos-types/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/utf8.ts b/libs/cosmos-types/src/utf8.ts index c8c688c2..977930ed 100644 --- a/libs/cosmos-types/src/utf8.ts +++ b/libs/cosmos-types/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/cosmos-types/src/varint.ts b/libs/cosmos-types/src/varint.ts index 3f1ff3be..4d504a61 100644 --- a/libs/cosmos-types/src/varint.ts +++ b/libs/cosmos-types/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/binary.ts b/libs/injective-react/src/binary.ts index 15b28924..b36a33fe 100644 --- a/libs/injective-react/src/binary.ts +++ b/libs/injective-react/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/extern.ts b/libs/injective-react/src/extern.ts index 31da6877..83abea1f 100644 --- a/libs/injective-react/src/extern.ts +++ b/libs/injective-react/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/helper-func-types.ts b/libs/injective-react/src/helper-func-types.ts index d24ac8e0..05b82b18 100644 --- a/libs/injective-react/src/helper-func-types.ts +++ b/libs/injective-react/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/helpers.ts b/libs/injective-react/src/helpers.ts index b6fb6c90..379912ff 100644 --- a/libs/injective-react/src/helpers.ts +++ b/libs/injective-react/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/react-query.ts b/libs/injective-react/src/react-query.ts index 3c698ea3..d1a009ba 100644 --- a/libs/injective-react/src/react-query.ts +++ b/libs/injective-react/src/react-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/registry.ts b/libs/injective-react/src/registry.ts index 98291dff..2a3b84ca 100644 --- a/libs/injective-react/src/registry.ts +++ b/libs/injective-react/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/types.ts b/libs/injective-react/src/types.ts index f3785169..ce7bd697 100644 --- a/libs/injective-react/src/types.ts +++ b/libs/injective-react/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/utf8.ts b/libs/injective-react/src/utf8.ts index c8c688c2..977930ed 100644 --- a/libs/injective-react/src/utf8.ts +++ b/libs/injective-react/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-react/src/varint.ts b/libs/injective-react/src/varint.ts index 3f1ff3be..4d504a61 100644 --- a/libs/injective-react/src/varint.ts +++ b/libs/injective-react/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/binary.ts b/libs/injective-vue/src/binary.ts index 15b28924..b36a33fe 100644 --- a/libs/injective-vue/src/binary.ts +++ b/libs/injective-vue/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/extern.ts b/libs/injective-vue/src/extern.ts index 31da6877..83abea1f 100644 --- a/libs/injective-vue/src/extern.ts +++ b/libs/injective-vue/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/helper-func-types.ts b/libs/injective-vue/src/helper-func-types.ts index 52876789..a6a39641 100644 --- a/libs/injective-vue/src/helper-func-types.ts +++ b/libs/injective-vue/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/helpers.ts b/libs/injective-vue/src/helpers.ts index b6fb6c90..379912ff 100644 --- a/libs/injective-vue/src/helpers.ts +++ b/libs/injective-vue/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/registry.ts b/libs/injective-vue/src/registry.ts index 98291dff..2a3b84ca 100644 --- a/libs/injective-vue/src/registry.ts +++ b/libs/injective-vue/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/types.ts b/libs/injective-vue/src/types.ts index f3785169..ce7bd697 100644 --- a/libs/injective-vue/src/types.ts +++ b/libs/injective-vue/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/utf8.ts b/libs/injective-vue/src/utf8.ts index c8c688c2..977930ed 100644 --- a/libs/injective-vue/src/utf8.ts +++ b/libs/injective-vue/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/varint.ts b/libs/injective-vue/src/varint.ts index 3f1ff3be..4d504a61 100644 --- a/libs/injective-vue/src/varint.ts +++ b/libs/injective-vue/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injective-vue/src/vue-query.ts b/libs/injective-vue/src/vue-query.ts index 78d0f433..a11fab03 100644 --- a/libs/injective-vue/src/vue-query.ts +++ b/libs/injective-vue/src/vue-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/binary.ts b/libs/injectivejs/src/binary.ts index 15b28924..b36a33fe 100644 --- a/libs/injectivejs/src/binary.ts +++ b/libs/injectivejs/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/extern.ts b/libs/injectivejs/src/extern.ts index 31da6877..83abea1f 100644 --- a/libs/injectivejs/src/extern.ts +++ b/libs/injectivejs/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/helper-func-types.ts b/libs/injectivejs/src/helper-func-types.ts index d24ac8e0..05b82b18 100644 --- a/libs/injectivejs/src/helper-func-types.ts +++ b/libs/injectivejs/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/helpers.ts b/libs/injectivejs/src/helpers.ts index b6fb6c90..379912ff 100644 --- a/libs/injectivejs/src/helpers.ts +++ b/libs/injectivejs/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/registry.ts b/libs/injectivejs/src/registry.ts index 98291dff..2a3b84ca 100644 --- a/libs/injectivejs/src/registry.ts +++ b/libs/injectivejs/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/types.ts b/libs/injectivejs/src/types.ts index f3785169..ce7bd697 100644 --- a/libs/injectivejs/src/types.ts +++ b/libs/injectivejs/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/utf8.ts b/libs/injectivejs/src/utf8.ts index c8c688c2..977930ed 100644 --- a/libs/injectivejs/src/utf8.ts +++ b/libs/injectivejs/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/injectivejs/src/varint.ts b/libs/injectivejs/src/varint.ts index 3f1ff3be..4d504a61 100644 --- a/libs/injectivejs/src/varint.ts +++ b/libs/injectivejs/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/binary.ts b/libs/interchain-react/src/binary.ts index 15b28924..b36a33fe 100644 --- a/libs/interchain-react/src/binary.ts +++ b/libs/interchain-react/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/extern.ts b/libs/interchain-react/src/extern.ts index 31da6877..83abea1f 100644 --- a/libs/interchain-react/src/extern.ts +++ b/libs/interchain-react/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/helper-func-types.ts b/libs/interchain-react/src/helper-func-types.ts index d24ac8e0..05b82b18 100644 --- a/libs/interchain-react/src/helper-func-types.ts +++ b/libs/interchain-react/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/helpers.ts b/libs/interchain-react/src/helpers.ts index b6fb6c90..379912ff 100644 --- a/libs/interchain-react/src/helpers.ts +++ b/libs/interchain-react/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/react-query.ts b/libs/interchain-react/src/react-query.ts index 3c698ea3..d1a009ba 100644 --- a/libs/interchain-react/src/react-query.ts +++ b/libs/interchain-react/src/react-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/registry.ts b/libs/interchain-react/src/registry.ts index 98291dff..2a3b84ca 100644 --- a/libs/interchain-react/src/registry.ts +++ b/libs/interchain-react/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/types.ts b/libs/interchain-react/src/types.ts index f3785169..ce7bd697 100644 --- a/libs/interchain-react/src/types.ts +++ b/libs/interchain-react/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/utf8.ts b/libs/interchain-react/src/utf8.ts index c8c688c2..977930ed 100644 --- a/libs/interchain-react/src/utf8.ts +++ b/libs/interchain-react/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-react/src/varint.ts b/libs/interchain-react/src/varint.ts index 3f1ff3be..4d504a61 100644 --- a/libs/interchain-react/src/varint.ts +++ b/libs/interchain-react/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/binary.ts b/libs/interchain-vue/src/binary.ts index 15b28924..b36a33fe 100644 --- a/libs/interchain-vue/src/binary.ts +++ b/libs/interchain-vue/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/extern.ts b/libs/interchain-vue/src/extern.ts index 31da6877..83abea1f 100644 --- a/libs/interchain-vue/src/extern.ts +++ b/libs/interchain-vue/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/helper-func-types.ts b/libs/interchain-vue/src/helper-func-types.ts index 52876789..a6a39641 100644 --- a/libs/interchain-vue/src/helper-func-types.ts +++ b/libs/interchain-vue/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/helpers.ts b/libs/interchain-vue/src/helpers.ts index b6fb6c90..379912ff 100644 --- a/libs/interchain-vue/src/helpers.ts +++ b/libs/interchain-vue/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/registry.ts b/libs/interchain-vue/src/registry.ts index 98291dff..2a3b84ca 100644 --- a/libs/interchain-vue/src/registry.ts +++ b/libs/interchain-vue/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/types.ts b/libs/interchain-vue/src/types.ts index f3785169..ce7bd697 100644 --- a/libs/interchain-vue/src/types.ts +++ b/libs/interchain-vue/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/utf8.ts b/libs/interchain-vue/src/utf8.ts index c8c688c2..977930ed 100644 --- a/libs/interchain-vue/src/utf8.ts +++ b/libs/interchain-vue/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/varint.ts b/libs/interchain-vue/src/varint.ts index 3f1ff3be..4d504a61 100644 --- a/libs/interchain-vue/src/varint.ts +++ b/libs/interchain-vue/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchain-vue/src/vue-query.ts b/libs/interchain-vue/src/vue-query.ts index 78d0f433..a11fab03 100644 --- a/libs/interchain-vue/src/vue-query.ts +++ b/libs/interchain-vue/src/vue-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/binary.ts b/libs/interchainjs/src/binary.ts index 15b28924..b36a33fe 100644 --- a/libs/interchainjs/src/binary.ts +++ b/libs/interchainjs/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/extern.ts b/libs/interchainjs/src/extern.ts index 31da6877..83abea1f 100644 --- a/libs/interchainjs/src/extern.ts +++ b/libs/interchainjs/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/helper-func-types.ts b/libs/interchainjs/src/helper-func-types.ts index d24ac8e0..05b82b18 100644 --- a/libs/interchainjs/src/helper-func-types.ts +++ b/libs/interchainjs/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/helpers.ts b/libs/interchainjs/src/helpers.ts index b6fb6c90..379912ff 100644 --- a/libs/interchainjs/src/helpers.ts +++ b/libs/interchainjs/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/registry.ts b/libs/interchainjs/src/registry.ts index 98291dff..2a3b84ca 100644 --- a/libs/interchainjs/src/registry.ts +++ b/libs/interchainjs/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/types.ts b/libs/interchainjs/src/types.ts index f3785169..ce7bd697 100644 --- a/libs/interchainjs/src/types.ts +++ b/libs/interchainjs/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/utf8.ts b/libs/interchainjs/src/utf8.ts index c8c688c2..977930ed 100644 --- a/libs/interchainjs/src/utf8.ts +++ b/libs/interchainjs/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/varint.ts b/libs/interchainjs/src/varint.ts index 3f1ff3be..4d504a61 100644 --- a/libs/interchainjs/src/varint.ts +++ b/libs/interchainjs/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.15 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.11.16 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/package.json b/package.json index e94f2e67..7fa05d44 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@chain-registry/client": "1.18.1", "@confio/relayer": "^0.12.0", "@cosmjs/crypto": "^0.32.2", - "@cosmology/telescope": "^1.11.15", + "@cosmology/telescope": "^1.11.16", "@injectivelabs/networks": "^1.14.13", "@injectivelabs/sdk-ts": "^1.14.13", "@injectivelabs/wallet-ts": "^1.14.13", diff --git a/yarn.lock b/yarn.lock index 9e439558..034413d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1763,10 +1763,10 @@ "@types/node" ">=13.7.0" long "^5.0.0" -"@cosmology/telescope@^1.11.15": - version "1.11.15" - resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.11.15.tgz#b24b8e85613971b70e939d7c584262a41a25665e" - integrity sha512-VTXOuLgn34cY5B5ZxbIAVtBgM+li/PHbNWvE+jQX0Wjlu2V+FkMHykwVhmBwGlvy/u27hnXVli5NMBwnGnL2MQ== +"@cosmology/telescope@^1.11.16": + version "1.11.16" + resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.11.16.tgz#50a652cf1a6a3edb35b0282cdbf13f2c0eff1576" + integrity sha512-5drhVT2/gpPY2bQgYsikUAP5Dy4Hft0eTl5qcvWto0L0xWvI5YREQ9XMA8U9gYegGs1mrvdpDoqZRsaQ5iYjZQ== dependencies: "@babel/generator" "^7.23.6" "@babel/parser" "^7.23.6"