Skip to content

Commit 1e0378d

Browse files
committed
Dependency fixes and readme update
1 parent 9566c4f commit 1e0378d

File tree

6 files changed

+2622
-4229
lines changed

6 files changed

+2622
-4229
lines changed

examples/injective-vue/README.md

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,20 @@ This example demonstrates the usage of Vue composables provided by [@interchain-
33
## Directory Structure
44
```
55
├── src/
6-
│ ├── codegen # containing vue composables generated by `telescope`
76
│ ├── components/
87
│ │ ├── asset-list/
9-
│ │ ├── authz/
108
│ │ ├── provide-liquidity/
11-
│ │ ├── stake-tokens/
12-
│ │ └── voting/
9+
│ │ └── stake-tokens/
1310
│ ├── composables/
14-
│ │ ├── asset-list/
15-
│ │ ├── authz/
1611
│ │ ├── common/
17-
│ │ ├── injective/
18-
│ │ ├── provide-liquidity/
19-
│ │ ├── stake-tokens/
20-
│ │ └── voting/
12+
│ │ └── injective/
2113
│ ├── utils/
2214
│ │ ├── asset-list/
23-
│ │ ├── authz/
24-
│ │ ├── provide-liquidity/
2515
│ │ ├── stake-tokens/
2616
│ │ └── voting/
2717
│ ├── views/
28-
│ │ ├── asset-list.vue
29-
│ │ ├── authz.vue
3018
│ │ ├── index.vue
31-
│ │ └── voting.vue
19+
│ │ └── injective.vue
3220
│ ├── router.ts
3321
│ ├── utils/
3422
│ ├── App.vue
@@ -94,15 +82,13 @@ cosmos.staking.v1beta1.usePools
9482
- **Completion Status:** ✅ Completed
9583
- **Functionalities:**
9684
- inj balance display
97-
- inj tokens transfer
98-
- **Telescope generated `Vue Composables` Used:**
85+
- **Telescope Generated Tree Shakable Hooks Used:**
9986
```ts
10087
cosmos.bank.v1beta1.useBalance
10188
```
102-
- **`msgType`s are signAndBroadcasted:**
103-
```ts
104-
/cosmos.bank.v1beta1.MsgSend
105-
```
89+
- The location of usage `./src/composables/injective/useBalanceVue.ts`
90+
- This is the demonstration of tree shakable function `useBalance` generated by `telescope`
91+
10692
### Stake tokens
10793
- **Completion Status:** ⏳ In Progress... 50% done.
10894
- **Functionalities:**

examples/injective-vue/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
"@interchain-kit/vue": "0.0.1-beta.38",
2020
"@interchain-ui/vue": "^1.4.1",
2121
"@interchainjs/cosmos": "1.6.1",
22-
"@interchainjs/injective": "1.8.3",
22+
"@interchainjs/injective": "1.6.1",
2323
"@interchainjs/vue": "1.8.1",
2424
"@tanstack/vue-query": "5.62.7",
25+
"bignumber.js": "9.1.0",
2526
"osmojs": "^16.15.0",
2627
"vue": "^3.5.13",
27-
"bignumber.js": "9.1.0",
2828
"vue-router": "^4.5.0"
2929
},
3030
"devDependencies": {
@@ -34,5 +34,5 @@
3434
"vite": "^6.0.0",
3535
"vue-tsc": "^2.1.10"
3636
},
37-
"packageManager": "yarn@4.3.0"
37+
"packageManager": "yarn@4.1.0"
3838
}

examples/injective-vue/src/composables/injective/useBalance.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

examples/injective-vue/src/composables/injective/useBalanceVue.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const useBalanceVue = (address: Ref) => {
4444
isBalanceLoaded,
4545
isFetchingBalance,
4646
refetchBalance,
47+
denom,
4748
};
4849
};
4950

examples/injective-vue/src/views/injective.vue

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
<script setup lang="ts">
22
import { Box, Button, Text, Link } from "@interchain-ui/vue";
33
import { computed, ref } from "vue";
4-
import { useBalance } from "../composables/injective/useBalance";
4+
import { useBalanceVue } from "../composables/injective/useBalanceVue";
55
import { useChain } from "@interchain-kit/vue";
66
import { MessageComposer } from "../../../injective/src/codegen/cosmos/bank/v1beta1/tx.registry";
77
import { useInjectiveClient } from "../composables/common/useInjectiveClient";
88
99
const chainName = ref("injective");
1010
const injectiveClient = useInjectiveClient(chainName);
1111
const { address, chain } = useChain(chainName);
12-
const { balance, isLoading, COIN_DISPLAY_EXPONENT, symbol, denom, refetch } = useBalance(
13-
chainName
14-
);
15-
const txHashMessageComposer = ref("");
12+
const {
13+
balance,
14+
isBalanceLoaded,
15+
isFetchingBalance,
16+
refetchBalance,
17+
denom,
18+
} = useBalanceVue(address);
19+
20+
const txHash = ref("");
1621
1722
const sending = ref(false);
1823
console.log("chain>", chain);
1924
const txPage = computed(() => {
2025
return chain?.value.explorers?.[0]?.txPage;
2126
});
2227
28+
const computedBalance = computed(() => {
29+
return balance ?? null;
30+
});
31+
2332
const handleSend = async () => {
2433
sending.value = true;
2534
const fee = {
@@ -60,7 +69,7 @@ const handleSend = async () => {
6069
)) as any;
6170
console.log("onSuccess", data);
6271
if (data.code === 0) {
63-
refetch();
72+
refetchBalance();
6473
txHash.value = data.hash;
6574
}
6675
} catch (error: any) {
@@ -75,9 +84,8 @@ const handleSend = async () => {
7584
<Box display="flex" flexDirection="column" alignItems="center">
7685
<Box mb="$4">
7786
<Text fontSize="$2xl"
78-
>Balance: {{ isLoading ? "--" : balance?.toFixed(COIN_DISPLAY_EXPONENT) }}
79-
{{ symbol }}</Text
80-
>
87+
>Balance: {{ isFetchingBalance ? "--" : computedBalance }}
88+
</Text>
8189
</Box>
8290
<Button :disabled="sending" @click="handleSend"> Send </Button>
8391
<Box v-if="txHash" mt="$4" display="flex" flexDirection="row" alignItems="center">

0 commit comments

Comments
 (0)