-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from yadavnarun/main
misc edits beta
- Loading branch information
Showing
4 changed files
with
30 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
frizzle_version=0.1.0-beta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
import { computed } from 'vue' | ||
import { useAnchorWallet } from 'solana-wallets-vue' | ||
import { Connection, PublicKey } from '@solana/web3.js' | ||
import { Provider, Program } from '@project-serum/anchor' | ||
import idl from '@/idl/solana_twitter.json' | ||
import { computed } from "vue"; | ||
import { useAnchorWallet } from "solana-wallets-vue"; | ||
import { Connection, PublicKey } from "@solana/web3.js"; | ||
import { Provider, Program } from "@project-serum/anchor"; | ||
import idl from "@/idl/solana_frizzle.json"; | ||
|
||
const clusterUrl = process.env.VUE_APP_CLUSTER_URL | ||
const preflightCommitment = 'processed' | ||
const commitment = 'processed' | ||
const programID = new PublicKey(idl.metadata.address) | ||
let workspace = null | ||
const clusterUrl = process.env.VUE_APP_CLUSTER_URL; | ||
const preflightCommitment = "processed"; | ||
const commitment = "processed"; | ||
const programID = new PublicKey(idl.metadata.address); | ||
let workspace = null; | ||
|
||
export const useWorkspace = () => workspace | ||
export const useWorkspace = () => workspace; | ||
|
||
export const initWorkspace = () => { | ||
const wallet = useAnchorWallet() | ||
const connection = new Connection(clusterUrl, commitment) | ||
const provider = computed(() => new Provider(connection, wallet.value, { preflightCommitment, commitment })) | ||
const program = computed(() => new Program(idl, programID, provider.value)) | ||
const wallet = useAnchorWallet(); | ||
const connection = new Connection(clusterUrl, commitment); | ||
const provider = computed( | ||
() => | ||
new Provider(connection, wallet.value, { | ||
preflightCommitment, | ||
commitment, | ||
}) | ||
); | ||
const program = computed(() => new Program(idl, programID, provider.value)); | ||
|
||
workspace = { | ||
wallet, | ||
connection, | ||
provider, | ||
program, | ||
} | ||
} | ||
workspace = { | ||
wallet, | ||
connection, | ||
provider, | ||
program, | ||
}; | ||
}; |
File renamed without changes.