From 728385c37883b55110f4d80c24b1152ce479f737 Mon Sep 17 00:00:00 2001 From: Luphia Chang Date: Tue, 20 Jun 2023 17:17:44 +0800 Subject: [PATCH] add @walletconnect/core --- index.d.ts | 2 ++ package.json | 3 ++- src/index.ts | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 24cbd92..31f1ef6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -3,6 +3,7 @@ import IBlockchain from "./src/interfaces/iblockchain"; import IConnector from "./src/interfaces/iconnector"; import IEnv from "./src/interfaces/ienv"; import IJSON from "./src/interfaces/ijson"; +import WalletConnect from "@walletconnect/core"; declare class Lunar { private static instance: Lunar; @@ -19,6 +20,7 @@ declare class Lunar { public isConnected: boolean; public address: string; public blockchain: IBlockchain; + public walletConnect: WalletConnect | undefined; public constructor(); public resetEvents(): void; diff --git a/package.json b/package.json index e2cd46a..2677f03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cafeca/lunar", - "version": "0.5.7", + "version": "0.5.8", "description": "Blockchain Connect Module", "main": "dist/index.js", "files": [ @@ -38,6 +38,7 @@ "homepage": "https://github.com/CAFECA-IO/Lunar#readme", "dependencies": { "@cafeca/keccak": "^0.8.8", + "@walletconnect/core": "^2.8.1", "bignumber.js": "^9.1.1", "elliptic": "^6.5.4", "ethereumjs-util": "^7.1.5" diff --git a/src/index.ts b/src/index.ts index aeae223..88b20a3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,6 +9,7 @@ import { recoverAddress } from './libs/common'; import IJSON from './interfaces/ijson'; import { EventEmitter } from 'events'; import { keccak256 } from '@cafeca/keccak'; +import WalletConnect from "@walletconnect/core"; // import { version } from '../package.json'; declare global { @@ -23,10 +24,11 @@ declare global { export class Lunar { private static instance: Lunar; // static version = `v${version}`; - public static version = `v0.5.7`; + public static version = `v0.5.8`; public static Blockchains = Blockchains; public static Wallets = Wallets; public static keccak256 = keccak256; + public walletConnect: WalletConnect|undefined; public static getInstance(): Lunar { if (!Lunar.instance) { @@ -58,6 +60,7 @@ export class Lunar { constructor() { this.connector = ConnectorFactory.create(); + this.walletConnect = new WalletConnect(); } public resetEvents() {