Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injective example #227

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion examples/asset-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"typescript": "^5.1.6"
},
"packageManager": "[email protected]"
}
}
2 changes: 1 addition & 1 deletion examples/authz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@
"typescript": "^5.1.6"
},
"packageManager": "[email protected]"
}
}
2 changes: 1 addition & 1 deletion examples/grpc-web-grpc-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
"generate-lockfile": "0.0.12",
"typescript": "^5.1.6"
}
}
}
2 changes: 1 addition & 1 deletion examples/ibc-transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"typescript": "^5.1.6"
},
"packageManager": "[email protected]"
}
}
24 changes: 24 additions & 0 deletions examples/injective-vue/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
5 changes: 5 additions & 0 deletions examples/injective-vue/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"Vue.volar"
]
}
140 changes: 140 additions & 0 deletions examples/injective-vue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Introduction
This example demonstrates the usage of Vue composables provided by [@interchain-kit/vue](https://github.com/cosmology-tech/interchain-kit/tree/main/packages/vue) and generated by [telescope](https://github.com/cosmology-tech/telescope).
## Directory Structure
```
├── src/
│ ├── codegen # containing vue composables generated by `telescope`
│ ├── components/
│ │ ├── asset-list/
│ │ ├── authz/
│ │ ├── provide-liquidity/
│ │ ├── stake-tokens/
│ │ └── voting/
│ ├── composables/
│ │ ├── asset-list/
│ │ ├── authz/
│ │ ├── common/
│ │ ├── injective/
│ │ ├── provide-liquidity/
│ │ ├── stake-tokens/
│ │ └── voting/
│ ├── utils/
│ │ ├── asset-list/
│ │ ├── authz/
│ │ ├── provide-liquidity/
│ │ ├── stake-tokens/
│ │ └── voting/
│ ├── views/
│ │ ├── asset-list.vue
│ │ ├── authz.vue
│ │ ├── index.vue
│ │ └── voting.vue
│ ├── router.ts
│ ├── utils/
│ ├── App.vue
│ └── main.ts
```
## Pages

### Asset List
- **Completion Status:** ✅ Completed
- **Functionalities:**
- Wallet connect
- Assets display
- IBC transfer
- **Telescope generated `Vue Composables` Used:**
```ts
cosmos.bank.v1beta1.useBalance
cosmos.bank.v1beta1.useAllBalances
cosmos.staking.v1beta1.useDelegatorDelegations
osmosis.gamm.v1beta1.usePools
```
- **`msgType`s are signAndBroadcasted:**
```ts
/ibc.applications.transfer.v1.MsgTransfer
```

### Auth
- **Completion Status:** ✅ Completed
- **Functionalities:**
- Vote permission granting and revoking
- Send permission granting and revoking
- Delegate permission granting and revoking
- Claim rewards granting and revoking
- **Telescope generated `Vue Composables` Used:**
```ts
cosmos.authz.v1beta1.useGranterGrants
cosmos.authz.v1beta1.useGranteeGrants
cosmos.staking.v1beta1.useValidators
```
- **`msgType`s are signAndBroadcasted:**
```ts
/cosmos.authz.v1beta1.MsgRevoke
/cosmos.authz.v1beta1.MsgGrant
```

### Voting
- **Completion Status:** ✅ Completed
- **Functionalities:**
- Proposals display
- Proposal voting
- **Telescope generated `Vue Composables` Used:**
```ts
cosmos.gov.v1.useProposals
cosmos.gov.v1.useParams
cosmos.gov.v1.useProposals
cosmos.staking.v1beta1.usePools
```
- **`msgType`s are signAndBroadcasted:**
```ts
/cosmos.gov.v1.MsgVote
```

### Injective
- **Completion Status:** ✅ Completed
- **Functionalities:**
- inj balance display
- inj tokens transfer
- **Telescope generated `Vue Composables` Used:**
```ts
cosmos.bank.v1beta1.useBalance
```
- **`msgType`s are signAndBroadcasted:**
```ts
/cosmos.bank.v1beta1.MsgSend
```
### Stake tokens
- **Completion Status:** ⏳ In Progress... 50% done.
- **Functionalities:**
- all validators display
- validators display for a specified address
- claimable rewards display
- staked tokens display for a specified chain
- claim rewards
- manage validators
- **Telescope generated `Vue Composables` Used:**
```ts
cosmos.mint.v1beta.useAnnualProvisions
cosmos.distribution.v1beta1.useParams
cosmos.distribution.v1beta1.useDelegationTotalRewards
codegen.cosmos.staking.v1beta1.useDelegatorValidators
cosmos.staking.v1beta1.useParams
```
- **`msgType`s are signAndBroadcasted:**
```ts
```

### Provide Liquidity
- **Completion Status:** ⏳ In Progress...

### Swap tokens
- **Completion Status:** ⏳ In Progress...

### NFT
- **Completion Status:** ⏳ In Progress...

### Rollkit
- **Completion Status:** ⏳ In Progress...

### Grpc Web & Grpc Gateway
- **Completion Status:** ⏳ In Progress...
13 changes: 13 additions & 0 deletions examples/injective-vue/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
35 changes: 35 additions & 0 deletions examples/injective-vue/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "injective-vue",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"@chain-registry/v2": "^1.71.44",
"@chain-registry/v2-types": "^0.53.20",
"@cosmjs/amino": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@interchain-kit/core": "^0.0.1-beta.39",
"@interchain-kit/keplr-extension": "^0.0.1-beta.39",
"@interchain-kit/leap-extension": "^0.0.1-beta.39",
"@interchain-kit/vue": "^0.0.1-beta.38",
"@interchain-ui/vue": "^1.4.1",
"@interchainjs/cosmos": "1.6.1",
"@interchainjs/injective": "1.6.1",
"@tanstack/vue-query": "^5.7.2",
"osmojs": "^16.15.0",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@vitejs/plugin-vue": "^5.2.1",
"typescript": "~5.6.2",
"vite": "^6.0.0",
"vue-tsc": "^2.1.10"
}
}
1 change: 1 addition & 0 deletions examples/injective-vue/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions examples/injective-vue/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script setup lang="ts">
import { ThemeProvider } from '@interchain-ui/vue'
import { ChainProvider } from '@interchain-kit/vue'
import { keplrWallet } from '@interchain-kit/keplr-extension';
import { leapWallet } from '@interchain-kit/leap-extension';
import { RouterView } from 'vue-router';
import { chain as junoChain, assetList as junoAssetList } from "@chain-registry/v2/mainnet/juno";
import { chain as osmosisChain, assetList as osmosisAssetList } from "@chain-registry/v2/mainnet/osmosis";
import { chain as cosmoshubChain, assetList as cosmoshubAssetList } from "@chain-registry/v2/mainnet/cosmoshub";
import { chain as stargazeChain, assetList as stargazeAssetList } from "@chain-registry/v2/mainnet/stargaze";
import { chain as xplaChain, assetList as xplaAssetList} from "@chain-registry/v2/mainnet/xpla"
import { chain as osmosisTestChain, assetList as osmosisTestAssetList } from "@chain-registry/v2/testnet/osmosistestnet"
import { chain as injectiveChain, assetList as injectiveAssetList } from "@chain-registry/v2/mainnet/injective"
</script>

<template>
<ThemeProvider>
<ChainProvider
:wallets="[keplrWallet, leapWallet]"
:chains="[osmosisChain, junoChain, cosmoshubChain, stargazeChain, xplaChain, osmosisTestChain, injectiveChain]"
:asset-lists="[osmosisAssetList, junoAssetList, cosmoshubAssetList, stargazeAssetList, xplaAssetList, osmosisTestAssetList, injectiveAssetList]" :signer-options="{}"
:endpoint-options="{}">
<router-view />
</ChainProvider>
</ThemeProvider>
</template>

<style scoped></style>
1 change: 1 addition & 0 deletions examples/injective-vue/src/assets/vue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* eslint-disable */
import { Attribute, AttributeSDKType } from "../../base/v1beta1/attribute";
import { AminoMsg } from "@cosmjs/amino";
import { MsgSignProviderAttributes, MsgSignProviderAttributesSDKType, MsgDeleteProviderAttributes, MsgDeleteProviderAttributesSDKType } from "./audit";
export interface MsgSignProviderAttributesAminoType extends AminoMsg {
type: "akash/audit/testonly-sign-provider-attributes";
value: {
owner: string;
auditor: string;
attributes: {
key: string;
value: string;
}[];
};
}
export interface MsgDeleteProviderAttributesAminoType extends AminoMsg {
type: "akash/audit/testonly-delete-provider-attributes";
value: {
owner: string;
auditor: string;
keys: string[];
};
}
export const AminoConverter = {
"/akash.audit.v1beta1.MsgSignProviderAttributes": {
aminoType: "akash/audit/testonly-sign-provider-attributes",
toAmino: ({
owner,
auditor,
attributes
}: MsgSignProviderAttributes): MsgSignProviderAttributesAminoType["value"] => {
return {
owner,
auditor,
attributes: attributes.map(el0 => ({
key: el0.key,
value: el0.value
}))
};
},
fromAmino: ({
owner,
auditor,
attributes
}: MsgSignProviderAttributesAminoType["value"]): MsgSignProviderAttributes => {
return {
owner,
auditor,
attributes: attributes.map(el0 => ({
key: el0.key,
value: el0.value
}))
};
}
},
"/akash.audit.v1beta1.MsgDeleteProviderAttributes": {
aminoType: "akash/audit/testonly-delete-provider-attributes",
toAmino: ({
owner,
auditor,
keys
}: MsgDeleteProviderAttributes): MsgDeleteProviderAttributesAminoType["value"] => {
return {
owner,
auditor,
keys
};
},
fromAmino: ({
owner,
auditor,
keys
}: MsgDeleteProviderAttributesAminoType["value"]): MsgDeleteProviderAttributes => {
return {
owner,
auditor,
keys
};
}
}
};
Loading
Loading