Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-3-useeosiowallet

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-3-useeosiowallet - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

5

dist/index.js
import { useAnchor } from './anchor';
import { computed, ref } from 'vue';
import { useScatter } from './scatter';
const isSetup = ref(false);

@@ -42,2 +43,6 @@ const applicationName = ref('');

break;
case 'scatter':
await useScatter().setup(applicationName.value, selectedChain.value);
username.value = await useAnchor().login();
break;
default:

@@ -44,0 +49,0 @@ throw new Error('Login failed: Wallet ID not found.');

@@ -0,1 +1,6 @@

import { EosioChain } from './types';
export declare const useScatter: () => {
setup: (appName: string, chain: EosioChain) => Promise<void>;
login: () => Promise<any>;
};
//# sourceMappingURL=scatter.d.ts.map

53

dist/scatter.js

@@ -1,2 +0,53 @@

"use strict";
// @ts-ignore
import ScatterJS from '@scatterjs/core';
// @ts-ignore
import ScatterEOS from '@scatterjs/eosjs2';
import { JsonRpc } from 'eosjs';
import { ref } from 'vue';
ScatterJS.plugins(new ScatterEOS());
const applicationName = ref('');
// @ts-ignore
let rpc = null;
let network = null;
export const useScatter = () => {
const setup = async (appName, chain) => {
applicationName.value = appName;
rpc = new JsonRpc(chain.nodeUrl);
network = ScatterJS.Network.fromJson({
blockchain: 'eos',
chainId: chain.chainId,
host: chain.nodeUrl,
port: 443,
protocol: 'https',
});
};
const connect = async () => {
try {
await ScatterJS.connect(applicationName.value, { network });
console.log('scatter connected');
}
catch (e) {
console.log('scatter connect error', e);
throw e;
}
};
const login = async () => {
try {
await connect();
const id = ScatterJS.login({ accounts: [network] });
if (!id)
throw new Error('Scatter login failed');
const account = id.accounts[0];
if (!account)
throw new Error('Scatter failed to find account');
console.log('scatter logged in');
return account.name;
}
catch (e) {
console.log('scatter login error', e);
throw e;
}
};
return { setup, login };
};
//# sourceMappingURL=scatter.js.map

5

package.json
{
"name": "vue-3-useeosiowallet",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -13,4 +13,7 @@ "main": "dist/index.js",

"dependencies": {
"@scatterjs/core": "^2.7.54",
"@scatterjs/eosjs2": "^1.5.36",
"anchor-link": "^3.2.3",
"anchor-link-browser-transport": "^3.1.3",
"eosjs": "^21.0.4",
"vue": "^3.0.11"

@@ -17,0 +20,0 @@ },

import { useAnchor } from './anchor';
import { computed, ref } from 'vue';
import type { EosioChain } from './types';
import { useScatter } from './scatter';

@@ -49,2 +50,6 @@ const isSetup = ref<boolean>(false);

break;
case 'scatter':
await useScatter().setup(applicationName.value, selectedChain.value);
username.value = await useAnchor().login();
break;
default:

@@ -51,0 +56,0 @@ throw new Error('Login failed: Wallet ID not found.');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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