@polkadot-onboard/core
Advanced tools
Comparing version 0.2.0 to 1.0.0
@@ -15,3 +15,3 @@ import type { Signer } from '@polkadot/types/types'; | ||
export interface BaseWalletProvider { | ||
getWallets: () => BaseWallet[]; | ||
getWallets: () => Promise<BaseWallet[]>; | ||
} | ||
@@ -18,0 +18,0 @@ export interface WalletMetadata { |
@@ -5,4 +5,4 @@ import type { BaseWallet, BaseWalletProvider } from './types.js'; | ||
constructor(providers: BaseWalletProvider[]); | ||
getWallets(): BaseWallet[]; | ||
getWallets(): Promise<BaseWallet[]>; | ||
} | ||
//# sourceMappingURL=walletAggregator.d.ts.map |
export class WalletAggregator { | ||
walletProviders; | ||
constructor(providers) { | ||
this.walletProviders = providers; | ||
} | ||
getWallets() { | ||
let wallets = []; | ||
for (let provider of this.walletProviders) { | ||
wallets.push(...provider.getWallets()); | ||
async getWallets() { | ||
const wallets = []; | ||
for (const provider of this.walletProviders) { | ||
const providedWallets = await provider.getWallets(); | ||
wallets.push(...providedWallets); | ||
} | ||
@@ -10,0 +12,0 @@ return wallets; |
{ | ||
"name": "@polkadot-onboard/core", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"author": "Parity Team <admin@parity.io>", | ||
@@ -29,5 +29,5 @@ "maintainers": [ | ||
"@polkadot/types": "10.9.1", | ||
"prettier": "3.0.0", | ||
"prettier": "3.0.3", | ||
"typescript": "5.1.6" | ||
} | ||
} |
@@ -19,3 +19,3 @@ import type { Signer } from '@polkadot/types/types'; | ||
export interface BaseWalletProvider { | ||
getWallets: () => BaseWallet[]; | ||
getWallets: () => Promise<BaseWallet[]>; | ||
} | ||
@@ -22,0 +22,0 @@ |
@@ -5,9 +5,14 @@ import type { BaseWallet, BaseWalletProvider } from './types.js'; | ||
walletProviders: BaseWalletProvider[]; | ||
constructor(providers: BaseWalletProvider[]) { | ||
this.walletProviders = providers; | ||
} | ||
getWallets(): BaseWallet[] { | ||
let wallets: BaseWallet[] = []; | ||
for (let provider of this.walletProviders) { | ||
wallets.push(...provider.getWallets()); | ||
async getWallets(): Promise<BaseWallet[]> { | ||
const wallets: BaseWallet[] = []; | ||
for (const provider of this.walletProviders) { | ||
const providedWallets = await provider.getWallets(); | ||
wallets.push(...providedWallets); | ||
} | ||
@@ -14,0 +19,0 @@ return wallets; |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7232
127
0