@wallet01/core
Advanced tools
Comparing version 0.5.5 to 0.6.0
# @wallet01/core | ||
## 0.6.0 | ||
### Minor Changes | ||
- added package for tezos | ||
## 0.5.5 | ||
@@ -4,0 +10,0 @@ |
import { | ||
Client | ||
} from "../chunk-A65LNWIU.js"; | ||
import "../chunk-PH6OAS5D.js"; | ||
import "../chunk-OBYFS5IT.js"; | ||
} from "../chunk-HIMGLJDE.js"; | ||
import "../chunk-PLYCLVEK.js"; | ||
import "../chunk-CAM3JWNB.js"; | ||
import "../chunk-4A3ZCJ3K.js"; | ||
import "../chunk-MNEXFLDY.js"; | ||
import "../chunk-AJYURY7F.js"; | ||
import "../chunk-W7E5PEDQ.js"; | ||
@@ -9,0 +9,0 @@ import "../chunk-XXPGZHWZ.js"; |
@@ -1,3 +0,4 @@ | ||
import { BaseConnector } from '../types'; | ||
import { BaseConnector } from "../types"; | ||
export declare class Wallet01Store { | ||
getActiveChain(): "ethereum" | "solana" | "cosmos" | "tezos" | null; | ||
getAddress(): string | null; | ||
@@ -12,2 +13,3 @@ getDid(): string | null; | ||
getIsAutoConnecting(): boolean; | ||
setActiveChain(activeChain: "ethereum" | "solana" | "cosmos" | "tezos" | null): void; | ||
setAddress(address: string | null): void; | ||
@@ -14,0 +16,0 @@ setDid(did: string | null): void; |
import { | ||
Wallet01Store | ||
} from "../chunk-PH6OAS5D.js"; | ||
import "../chunk-OBYFS5IT.js"; | ||
} from "../chunk-PLYCLVEK.js"; | ||
import "../chunk-CAM3JWNB.js"; | ||
import "../chunk-4A3ZCJ3K.js"; | ||
import "../chunk-MNEXFLDY.js"; | ||
import "../chunk-AJYURY7F.js"; | ||
import "../chunk-W7E5PEDQ.js"; | ||
@@ -8,0 +8,0 @@ import "../chunk-XXPGZHWZ.js"; |
@@ -0,17 +1,17 @@ | ||
import { | ||
util_default | ||
} from "./chunk-DUPRLLUL.js"; | ||
import "./chunk-RZMIDZ2N.js"; | ||
import { | ||
BaseConnector | ||
} from "./chunk-YGTQYFXZ.js"; | ||
} from "./chunk-KIV25KVU.js"; | ||
import { | ||
util_default | ||
} from "./chunk-DUPRLLUL.js"; | ||
import { | ||
Client | ||
} from "./chunk-A65LNWIU.js"; | ||
import "./chunk-PH6OAS5D.js"; | ||
} from "./chunk-HIMGLJDE.js"; | ||
import "./chunk-PLYCLVEK.js"; | ||
import { | ||
useStore | ||
} from "./chunk-OBYFS5IT.js"; | ||
} from "./chunk-CAM3JWNB.js"; | ||
import "./chunk-4A3ZCJ3K.js"; | ||
import "./chunk-MNEXFLDY.js"; | ||
import "./chunk-AJYURY7F.js"; | ||
import "./chunk-W7E5PEDQ.js"; | ||
@@ -18,0 +18,0 @@ import "./chunk-XXPGZHWZ.js"; |
@@ -1,3 +0,3 @@ | ||
import { StateCreator } from 'zustand'; | ||
import { IClientState } from './storeTypes'; | ||
import { StateCreator } from "zustand"; | ||
import { IClientState } from "./storeTypes"; | ||
declare const createClientSlice: StateCreator<IClientState, [ | ||
@@ -4,0 +4,0 @@ ], [ |
import { | ||
createClientSlice_default | ||
} from "../chunk-MNEXFLDY.js"; | ||
} from "../chunk-AJYURY7F.js"; | ||
import "../chunk-XXPGZHWZ.js"; | ||
@@ -5,0 +5,0 @@ export { |
import { | ||
rootStore_default, | ||
useStore | ||
} from "../chunk-OBYFS5IT.js"; | ||
} from "../chunk-CAM3JWNB.js"; | ||
import "../chunk-4A3ZCJ3K.js"; | ||
import "../chunk-MNEXFLDY.js"; | ||
import "../chunk-AJYURY7F.js"; | ||
import "../chunk-W7E5PEDQ.js"; | ||
@@ -8,0 +8,0 @@ import "../chunk-XXPGZHWZ.js"; |
@@ -1,2 +0,2 @@ | ||
import { BaseConnector } from '../types'; | ||
import { BaseConnector } from "../types"; | ||
export interface IAccountState { | ||
@@ -15,2 +15,3 @@ address: string | null; | ||
export interface IClientState { | ||
activeChain: "ethereum" | "solana" | "cosmos" | "tezos" | null; | ||
autoConnect: boolean; | ||
@@ -21,2 +22,3 @@ connectors: BaseConnector[]; | ||
isAutoConnecting: boolean; | ||
setActiveChain: (val: "ethereum" | "solana" | "cosmos" | "tezos" | null) => void; | ||
setAutoConnect: (val: boolean) => void; | ||
@@ -23,0 +25,0 @@ setConnectors: (connectors: BaseConnector[]) => void; |
export declare abstract class BaseConnector<Provider = any> { | ||
chain: string; | ||
readonly name: string; | ||
readonly activeChain: "ethereum" | "solana" | "cosmos" | "tezos"; | ||
abstract provider?: Provider; | ||
constructor(chain: string, name: string); | ||
constructor(chain: string, name: string, activeChain: "ethereum" | "solana" | "cosmos" | "tezos"); | ||
abstract connect({ chainId, }: { | ||
@@ -7,0 +8,0 @@ chainId?: string | undefined; |
import { | ||
BaseConnector | ||
} from "../chunk-YGTQYFXZ.js"; | ||
} from "../chunk-KIV25KVU.js"; | ||
import "../chunk-XXPGZHWZ.js"; | ||
@@ -5,0 +5,0 @@ export { |
import "../chunk-RZMIDZ2N.js"; | ||
import { | ||
BaseConnector | ||
} from "../chunk-YGTQYFXZ.js"; | ||
} from "../chunk-KIV25KVU.js"; | ||
import "../chunk-XXPGZHWZ.js"; | ||
@@ -6,0 +6,0 @@ export { |
{ | ||
"name": "@wallet01/core", | ||
"version": "0.5.5", | ||
"version": "0.6.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs", |
@@ -53,3 +53,3 @@ import { BaseConnector } from "../types"; | ||
if (this.activeConnector) { | ||
this.activeConnector.connect({}); | ||
await this.activeConnector.connect({}); | ||
const addresses = await this.activeConnector.getAccount(); | ||
@@ -62,12 +62,5 @@ | ||
this.setAddress(address); | ||
try { | ||
if ( | ||
this.activeConnector.getChainId && | ||
(await this.activeConnector.getChainId()) === "1" | ||
) | ||
this.setDid(await this.activeConnector.resolveDid(address)); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
this.setDid(await this.activeConnector.resolveDid(address)); | ||
this.activeConnector.getChainId | ||
@@ -77,2 +70,3 @@ ? this.setChainId(await this.activeConnector.getChainId()) | ||
this.setActiveChain(this.activeConnector.activeChain); | ||
this.setIsAutoConnecting(false); | ||
@@ -79,0 +73,0 @@ this.setIsConnected(true); |
@@ -1,5 +0,10 @@ | ||
import getState from '../store/rootStore'; | ||
import { BaseConnector } from '../types'; | ||
import getState from "../store/rootStore"; | ||
import { BaseConnector } from "../types"; | ||
export class Wallet01Store { | ||
getActiveChain(): "ethereum" | "solana" | "cosmos" | "tezos" | null { | ||
const { activeChain } = getState(); | ||
return activeChain; | ||
} | ||
getAddress(): string | null { | ||
@@ -50,2 +55,9 @@ const { address } = getState(); | ||
setActiveChain( | ||
activeChain: "ethereum" | "solana" | "cosmos" | "tezos" | null | ||
): void { | ||
const { setActiveChain } = getState(); | ||
setActiveChain(activeChain); | ||
} | ||
setAddress(address: string | null): void { | ||
@@ -52,0 +64,0 @@ const { setAddress } = getState(); |
@@ -1,3 +0,3 @@ | ||
import { StateCreator } from 'zustand'; | ||
import { IClientState } from './storeTypes'; | ||
import { StateCreator } from "zustand"; | ||
import { IClientState } from "./storeTypes"; | ||
@@ -10,2 +10,3 @@ const createClientSlice: StateCreator< | ||
> = set => ({ | ||
activeChain: null, | ||
autoConnect: false, | ||
@@ -16,2 +17,5 @@ connectors: [], | ||
isAutoConnecting: false, | ||
setActiveChain: activeChain => { | ||
set(() => ({ activeChain })); | ||
}, | ||
setAutoConnect: autoConnect => { | ||
@@ -18,0 +22,0 @@ set(() => ({ autoConnect })); |
@@ -1,2 +0,2 @@ | ||
import { BaseConnector } from '../types'; | ||
import { BaseConnector } from "../types"; | ||
@@ -18,2 +18,3 @@ export interface IAccountState { | ||
export interface IClientState { | ||
activeChain: "ethereum" | "solana" | "cosmos" | "tezos" | null; | ||
autoConnect: boolean; | ||
@@ -24,2 +25,5 @@ connectors: BaseConnector[]; | ||
isAutoConnecting: boolean; | ||
setActiveChain: ( | ||
val: "ethereum" | "solana" | "cosmos" | "tezos" | null | ||
) => void; | ||
setAutoConnect: (val: boolean) => void; | ||
@@ -26,0 +30,0 @@ setConnectors: (connectors: BaseConnector[]) => void; |
export abstract class BaseConnector<Provider = any> { | ||
chain: string; | ||
readonly name: string; | ||
readonly activeChain: "ethereum" | "solana" | "cosmos" | "tezos"; | ||
abstract provider?: Provider; | ||
constructor(chain: string, name: string) { | ||
constructor( | ||
chain: string, | ||
name: string, | ||
activeChain: "ethereum" | "solana" | "cosmos" | "tezos" | ||
) { | ||
this.chain = chain; | ||
this.name = name; | ||
this.activeChain = activeChain; | ||
} | ||
@@ -10,0 +16,0 @@ |
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
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
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
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
50151
87
1133
0
1