Skip to content

Commit

Permalink
remove support for native holochain
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiecarlton committed Aug 1, 2024
1 parent a748c12 commit fd5c5aa
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/stores/useHolochainStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { inspect } from 'util'
import { AdminWebsocket, AppWebsocket, generateSigningKeyPair, setSigningCredentials } from '@holochain/client'
import { AppWebsocket } from '@holochain/client'
import { defineStore } from 'pinia'
import { presentHcSignal, listify } from '../utils'
import useIsLoadingStore from './useIsLoadingStore'
Expand All @@ -11,12 +11,10 @@ const HC_APP_TIMEOUT = 35_000

const __HC_LAUNCHER_ENV__ = "__HC_LAUNCHER_ENV__";
const isLauncher = () => globalThis.window && __HC_LAUNCHER_ENV__ in globalThis.window;
const getLauncherEnvironment = () => isLauncher() ? globalThis.window[__HC_LAUNCHER_ENV__] : undefined;

const makeUseHolochainStore = ({ installed_app_id, app_ws_url, hc_admin_port }) => defineStore('holochain', {
const makeUseHolochainStore = ({ app_ws_url }) => defineStore('holochain', {
state: () => ({
client: null,
signingCredentials: null,
// These two values are subscribed to by clientStore
appInfo: null,
isReady: false,
Expand Down Expand Up @@ -102,12 +100,6 @@ const makeUseHolochainStore = ({ installed_app_id, app_ws_url, hc_admin_port })
throw new Error(`Couldn't find provisioned cell with role_name ${role_name}`)
}

if(!this.isLauncher && !this.signingCredentials) {
this.setCredentials(cellId)
}

await this.signingCredentials

let result = null

const cell_id = [new Uint8Array(listify(cellId[0], (_, value) => (Number(value)))), new Uint8Array(listify(cellId[1], (_, value) => (Number(value))))]
Expand All @@ -129,19 +121,6 @@ const makeUseHolochainStore = ({ installed_app_id, app_ws_url, hc_admin_port })

return result
},
setCredentials(cellId) {
this.signingCredentials = new Promise(async (resolve, reject) => {
try {
const adminWs = await AdminWebsocket.connect(`ws:localhost:${hc_admin_port}`)
await adminWs.authorizeSigningCredentials(cellId)
} catch(e) {
console.log(`holochainCallZome error authorizeSigningCredentials AdminWebsocket: ws:localhost:${hc_admin_port}`, e)
reject()
}

resolve()
})
},
async fetchAgentKycLevel(_, __) {
const kycLevel = await hposHolochainCall({path: 'host/kyc_level', headers: {}, params: {}, method: 'get'})
return kycLevel ? (kycLevel === kycLevel2) ? 2 : 1 : null
Expand Down

0 comments on commit fd5c5aa

Please sign in to comment.