Comparing version 0.0.6-alpha to 0.0.7-alpha
{ | ||
"name": "@ignt/vue", | ||
"version": "0.0.6-alpha", | ||
"version": "0.0.7-alpha", | ||
"description": "Autogenerated Vue API", | ||
@@ -5,0 +5,0 @@ "author": "Ignite Codegen <hello@ignt.com>", |
// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. | ||
import { OfflineDirectSigner } from '@cosmjs/proto-signing' | ||
import { SigningStargateClient } from '@cosmjs/stargate' | ||
import { createIgnite, Environment, Ignite, registry } from '@ignt/client' | ||
import { Ref, ref } from 'vue' | ||
import { createIgnite, Ignite, registry } from '@ignt/client' | ||
import { reactive, } from 'vue' | ||
@@ -14,3 +14,3 @@ // defaults | ||
// singleton state | ||
const ignite = ref<Ignite>( | ||
const ignite = reactive( | ||
createIgnite({ | ||
@@ -27,3 +27,3 @@ env: { | ||
type Response = { | ||
ignite: Ref<Ignite> | ||
ignite: Ignite | ||
signIn: (offlineSigner: OfflineDirectSigner) => void | ||
@@ -34,18 +34,2 @@ signOut: () => void | ||
export default function(): Response { | ||
let initIgnite = !ignite.value | ||
console.log("useIgnite", initIgnite) | ||
if (initIgnite) { | ||
let env: Environment = { | ||
apiURL, | ||
rpcURL, | ||
wsURL, | ||
prefix | ||
} | ||
ignite.value = createIgnite({ | ||
env | ||
}).connectWS() | ||
} | ||
let signIn = async (offlineSigner: OfflineDirectSigner) => { | ||
@@ -55,3 +39,3 @@ let [acc] = await offlineSigner.getAccounts() | ||
let stargateClient = await SigningStargateClient.connectWithSigner( | ||
ignite.value?.env.rpcURL, | ||
ignite.env.rpcURL, | ||
offlineSigner, | ||
@@ -61,11 +45,11 @@ { registry } | ||
ignite.value?.signIn(stargateClient, acc.address) | ||
ignite.signIn(stargateClient, acc.address) | ||
} | ||
let signOut = () => { | ||
ignite.value?.signOut() | ||
ignite.signOut() | ||
} | ||
return { | ||
ignite, | ||
ignite: ignite as Ignite, | ||
signIn, | ||
@@ -72,0 +56,0 @@ signOut |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39865
896