Skip to content

Commit

Permalink
Merge branch 'solana' into features/v0.18.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	src/views/projects/projectsContractsDetails/components/ContractList.vue
#	src/views/projects/projectsCreat/index.vue
#	src/views/projects/projectsList/components/Overview.vue
#	src/views/projects/projectsTemplatesDetails/index.vue
#	vite.config.ts
  • Loading branch information
mohaijiang committed Nov 28, 2023
2 parents a129afa + 20293d3 commit e39c594
Show file tree
Hide file tree
Showing 21 changed files with 1,688 additions and 120 deletions.
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
</head>
<body>
<div id="app"></div>
<script>
// Global node polyfill.
window.global = window;
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@
"@argent/get-starknet": "^5.3.1",
"@better-scroll/core": "^2.5.0",
"@better-scroll/scroll-bar": "^2.5.0",
"@coral-xyz/anchor": "^0.29.0",
"@metaplex-foundation/mpl-token-metadata": "^3.1.0",
"@metaplex-foundation/umi": "^0.8.10",
"@metaplex-foundation/umi-bundle-defaults": "^0.8.10",
"@metaplex-foundation/umi-signer-wallet-adapters": "^0.8.10",
"@cfx-kit/wallet-avatar": "0.0.5",
"@mysten/sui.js": "^0.31.0",
"@mysten/wallet-adapter-wallet-standard": "^0.7.1",
"@openzeppelin/contracts": "^4.8.1",
"@openzeppelin/contracts-upgradeable": "^4.8.1",
"@openzeppelin/wizard": "^0.2.0",
"@rollup/plugin-inject": "^5.0.5",
"@solana/spl-token": "^0.3.8",
"@solana/wallet-adapter-wallets": "^0.19.23",
"@solana/web3.js": "^1.87.5",
"@vueuse/core": "^9.13.0",
"@web3-onboard/core": "^2.16.0",
"@web3-onboard/injected-wallets": "^2.4.0",
Expand All @@ -34,18 +43,24 @@
"date-fns-tz": "^2.0.0",
"dayjs": "^1.11.6",
"echarts": "^5.4.0",
"esbuild-plugin-polyfill-node": "^0.3.0",
"eth-crypto": "^2.6.0",
"ethers": "^5.7.2",
"https-browserify": "^1.0.0",
"ic0": "^0.2.7",
"md-editor-v3": "^2.7.2",
"monaco-editor": "^0.34.1",
"near-api-js": "^2.1.4",
"openai": "^3.1.0",
"petra-plugin-wallet-adapter": "^0.1.3",
"pinia": "^2.0.23",
"prismjs": "^1.29.0",
"qrcode.vue": "^3.4.0",
"rpc-websockets": "^7.5.1",
"socket.io-client": "^2.3.1",
"solana-wallets-vue": "^0.6.0",
"starknet": "^4.21.0",
"stream-http": "^3.2.0",
"uuid": "^9.0.1",
"vue": "^3.2.41",
"vue-fullscreen": "^3.1.1",
Expand All @@ -68,7 +83,9 @@
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.0",
"@vue/tsconfig": "^0.1.3",
"assert": "^2.1.0",
"autoprefixer": "^10.4.13",
"crypto-browserify": "^3.12.0",
"eslint": "^8.22.0",
"eslint-plugin-vue": "^9.3.0",
"jest": "^29.3.1",
Expand All @@ -81,6 +98,7 @@
"tailwindcss": "^3.2.3",
"ts-jest": "^29.1.0",
"typescript": "~4.7.4",
"util": "^0.12.5",
"vite": "^3.1.8",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-prismjs": "^0.0.8",
Expand Down
Binary file added src/assets/icons/solana-logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/solana-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/enums/frameTypeEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum ContractFrameTypeEnum {
'Sui' = 5,
'Chainlink' = 6,
'IC' = 7,
'Solana' = 8,
}
export enum FrontEndFrameTypeEnum {

Expand Down
4 changes: 2 additions & 2 deletions src/router/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const projectsRoute = [
path: "/projects/templates/details",
name: "FilecoinDetail",
component: () => import('@/views/projects/FilecoinDetail/index.vue'),
},
}
]
},
{
Expand Down Expand Up @@ -159,4 +159,4 @@ const projectsRoute = [
]
}
]
export default projectsRoute
export default projectsRoute
55 changes: 47 additions & 8 deletions src/views/projects/projectsArtifactsContractDeploy/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
</div>
</div>
<div class="text-center mt-[16px]">
<a-button class="btn" @click="deployClick" :loading="loading">{{
<DeploySolana @Validate="solanaValidata" :solanaAbi="solanaAbi" :network="chainName" @setProjectsContractDeploy="setProjectsContractDeploy" v-if="frameType === 8" />

<a-button v-else class="btn" @click="deployClick" :loading="loading">{{
loading ? 'Deploying' : 'Deploy'
}}</a-button>
</div>
<!-- <div>
<a-button @click="deployContract">test deploy</a-button>
</div> -->

</div>
<SelectWallet :visible="visible" @cancelModal="cancelModal"></SelectWallet>
<Wallets ref="showWallets"></Wallets>
Expand Down Expand Up @@ -118,11 +118,17 @@ import {WalletCore} from '@aptos-labs/wallet-adapter-core'
import {AptosClient, BCS, HexString, TxnBuilderTypes} from 'aptos'
import {sleep} from "@/utils/tool"
import {type Chain, ChainList, getChain} from "@/utils/chainlist"
import DeploySolana from "./solana/deploySolana.vue";
import {fromB64, JsonRpcProvider, normalizeSuiObjectId, testnetConnection, TransactionBlock,} from '@mysten/sui.js';
import {WalletStandardAdapterProvider} from "@mysten/wallet-adapter-wallet-standard"
import {initWallet} from "solana-wallets-vue";
import {PhantomWalletAdapter} from "@solana/wallet-adapter-wallets";
const formRef = ref<FormInstance>();
const modalFormRef = ref<FormInstance>();
const theme = useThemeStore();
Expand Down Expand Up @@ -158,6 +164,7 @@ const chainName = ref('');
const rpcUrl = ref('');
const currencySymbol = ref('');
// aptos
const arr = [new PetraWallet()]
const aptosWallet: any = new WalletCore(arr)
Expand All @@ -174,9 +181,25 @@ const breadCrumbInfo = ref<any>([])
// sui
const suiWallet = new WalletStandardAdapterProvider()
const workflowsDetailsData = ref<any>({})
//solana
const solanaAbi = ref('');
const initSolana = () =>{
const walletOptions = {
wallets: [
new PhantomWalletAdapter()
],
autoConnect: true,
};
initWallet(walletOptions);
}
initSolana()
const workflowsDetailsData = ref<any>({})
const formState = reactive({
version: router.currentRoute.value.params?.version,
nameData: [],
Expand Down Expand Up @@ -282,6 +305,7 @@ const deploySuiContract = async (item: any)=> {
);
tx.transferObjects([upgradeCap], tx.pure(accountAddress));
let digest = ""
try{
Expand Down Expand Up @@ -356,24 +380,29 @@ const getVersion = async () => {
const getProjectsContract = async () => {
const { data } = await apiGetProjectsContract({ id: queryParams.id, version: queryParams.version });
data.map((item: any) => {
console.log(item);
item.label = item.name;
item.value = item.id;
item.modalFormData = reactive({});
item.abiInfoData = YAML.parse(item.abiInfo);
petraMv.value.push(item.aptosMv);
petraBsc.value.push(item.byteCode)
aptosContractId.value.push(item.id)
// aptos abi不走之前的那一套
if (frameType.value !== 2 && frameType.value !== 5) {
if (frameType.value !== 2 && frameType.value !== 5 && frameType.value !== 8) {
setAbiInfo(item);
}else if(frameType.value === 8){
solanaAbi.value = item
console.log(item)
}
})
Object.assign(projectsContractData, data)
}
// 创建合约
const contractFactory = async (abi: any, bytecode: any, argsMapData: any, contractId: number) => {
loading.value = true
Expand Down Expand Up @@ -589,6 +618,10 @@ const getAptosAbi = (name:string) => {
}
return abi
}
const solanaValidata = async() =>{
await formRef?.value.validateFields();
}
const deployClick = async () => {
// frameType 1.evm 2.aptos 3.ton 4.starknet,5: sui
if (frameType.value === 4) {
Expand Down Expand Up @@ -786,6 +819,10 @@ const getProjectsDetail = async () => {
Object.assign(chainData, ['Sui'])
networkData.value= [{name: 'Devnet', id: 'devnet', networkName: 'Devnet'},{name: 'Testnet',id:'testnet',networkName: 'Testnet'}]
break;
case 8:
Object.assign(chainData, ['Solana'])
networkData.value= [{name: 'Mainnet', id: 'Mainnet', networkName: 'mainnet-beta'},{name: 'Devnet', id: 'devnet', networkName: 'devnet'},{name: 'Testnet',id:'testnet',networkName: 'testnet'}]
break;
default: break;
}
} catch (err: any) {
Expand All @@ -811,13 +848,15 @@ const judgeOrigin = ()=>{
},
]
}
onMounted(async () => {
localStorage.removeItem('deplayPath')
projectName.value = localStorage.getItem("projectName") || '';
getVersion()
await getProjectsDetail();
await getProjectsContract()
await judgeOrigin()
let lastDeployChain = localStorage.getItem("lastDeployChain")
if(lastDeployChain) {
try {
Expand Down
Loading

0 comments on commit e39c594

Please sign in to comment.