Socket
Socket
Sign inDemoInstall

@ignt/vue

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ignt/vue - npm Package Compare versions

Comparing version 0.0.3-alpha to 0.0.4-alpha

useIgnite.ts

63

index.ts

@@ -1,61 +0,1 @@

// 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'
// defaults
let apiURL = process.env.API_COSMOS || 'http://localhost:1317'
let rpcURL = process.env.API_TENDERMINT || 'http://localhost:26657'
let wsURL = process.env.WS_TENDERMINT || 'ws://localhost:26657/websocket'
let prefix = process.env.ADDRESS_PREFIX || 'cosmos'
// singleton state
let ignite: Ref<Ignite | undefined> = ref<Ignite>()
type Response = {
ignite: Ref<Ignite | undefined>
signIn: (offlineSigner: OfflineDirectSigner) => void
signOut: () => void
}
function useIgnite(): Response {
let initIgnite = !ignite.value
if (initIgnite) {
let env: Environment = {
apiURL,
rpcURL,
wsURL,
prefix
}
ignite.value = createIgnite({
env
}).connectWS()
}
let signIn = async (offlineSigner: OfflineDirectSigner) => {
let [acc] = await offlineSigner.getAccounts()
let stargateClient = await SigningStargateClient.connectWithSigner(
ignite.value?.env.rpcURL,
offlineSigner,
{ registry }
)
ignite.value?.signIn(stargateClient, acc.address)
}
let signOut = () => {
ignite.value?.signOut()
}
return {
ignite,
signIn,
signOut
}
}
export { useModule as useCosmosAuthV1Beta1Module } from './cosmos.auth.v1beta1'

@@ -80,3 +20,2 @@ export { useModule as useCosmosBankV1Beta1Module } from './cosmos.bank.v1beta1'

export { useModule as useIbcCorePortV1Module } from './ibc.core.port.v1'
export { useIgnite }
export * from './useIgnite'
{
"name": "@ignt/vue",
"version": "0.0.3-alpha",
"version": "0.0.4-alpha",
"description": "Autogenerated Vue API",

@@ -5,0 +5,0 @@ "author": "Ignite Codegen <hello@ignt.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc