Skip to content

Commit

Permalink
build: bump ReactiveDOT (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
tien authored Oct 25, 2024
1 parent d6a6733 commit 2d3f70f
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-vans-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dot-connect": patch
---

Bumped ReactiveDOT.
4 changes: 2 additions & 2 deletions apps/docs/components/_WalletConnectionButton.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script lang="ts" type="module">
import {
InjectedWalletAggregator,
InjectedWalletProvider,
initializeWallets,
} from "@reactive-dot/core/wallets.js";
import { LedgerWallet } from "@reactive-dot/wallet-ledger";
import { WalletConnect } from "@reactive-dot/wallet-walletconnect";
import { registerDotConnect } from "dot-connect";
const wallets = [
new InjectedWalletAggregator(),
new InjectedWalletProvider(),
new LedgerWallet(),
new WalletConnect({
projectId: "6089356d0a4448aeda421a025cc286c9",
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Configure your project by adding the following code:

```ts
import { defineConfig } from "@reactive-dot/core";
import { InjectedWalletAggregator } from "@reactive-dot/core/wallets.js";
import { InjectedWalletProvider } from "@reactive-dot/core/wallets.js";
import { LedgerWallet } from "@reactive-dot/wallet-ledger";
import { WalletConnect } from "@reactive-dot/wallet-walletconnect";
import { registerDotConnect } from "dot-connect";
Expand All @@ -45,7 +45,7 @@ import { registerDotConnect } from "dot-connect";
export const config = defineConfig({
// ...
wallets: [
new InjectedWalletAggregator(),
new InjectedWalletProvider(),
new LedgerWallet(),
new WalletConnect({
projectId: "WALLET_CONNECT_PROJECT_ID",
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"preview": "vitepress preview"
},
"dependencies": {
"@reactive-dot/core": "^0.22.0",
"@reactive-dot/wallet-ledger": "^0.16.11",
"@reactive-dot/wallet-walletconnect": "^0.16.11",
"@reactive-dot/core": "^0.24.0",
"@reactive-dot/wallet-ledger": "^0.16.13",
"@reactive-dot/wallet-walletconnect": "^0.16.13",
"dot-connect": "workspace:^",
"polkadot-api": "^1.6.2",
"vue": "^3.5.12"
Expand Down
6 changes: 3 additions & 3 deletions packages/dot-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@reactive-dot/core": "^0.22.0",
"@reactive-dot/wallet-ledger": "^0.16.11",
"@reactive-dot/core": "^0.24.0",
"@reactive-dot/wallet-ledger": "^0.16.13",
"@tsconfig/recommended": "^1.0.7",
"@tsconfig/strictest": "^2.0.5",
"@types/eslint__js": "^8.42.3",
Expand All @@ -57,7 +57,7 @@
"typescript-eslint": "^8.8.0"
},
"peerDependencies": {
"@reactive-dot/core": "*",
"@reactive-dot/core": ">= 0.24.x",
"react": ">= 18"
},
"peerDependenciesMeta": {
Expand Down
8 changes: 4 additions & 4 deletions packages/dot-connect/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import "./elements/connection-button.js";
import "./elements/connection-dialog.js";
import "./elements/ledger/ledger-dialog.js";
import { walletsOrAggregators } from "./stores.js";
import type { Wallet, WalletAggregator } from "@reactive-dot/core/wallets.js";
import { walletsOrProviders } from "./stores.js";
import type { Wallet, WalletProvider } from "@reactive-dot/core/wallets.js";

export type Options = {
wallets: ReadonlyArray<Wallet | WalletAggregator>;
wallets: ReadonlyArray<Wallet | WalletProvider>;
};

export function registerDotConnect(options: Options) {
walletsOrAggregators.value = options.wallets;
walletsOrProviders.value = options.wallets;
}
31 changes: 14 additions & 17 deletions packages/dot-connect/src/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,40 @@ import {
getAccounts,
getConnectedWallets,
} from "@reactive-dot/core";
import { Wallet, WalletAggregator } from "@reactive-dot/core/wallets.js";
import { Wallet, WalletProvider } from "@reactive-dot/core/wallets.js";
import { Observable, combineLatest } from "rxjs";
import { map } from "rxjs/operators";

export const walletsOrAggregators = signal<
ReadonlyArray<Wallet | WalletAggregator>
export const walletsOrProviders = signal<
ReadonlyArray<Wallet | WalletProvider>
>([]);

const directWallets = computed(() =>
walletsOrAggregators.value.filter(
(walletOrAggregator) => walletOrAggregator instanceof Wallet,
walletsOrProviders.value.filter(
(walletOrProvider) => walletOrProvider instanceof Wallet,
),
);

const directWallets$ = new Observable<Wallet[]>((subscriber) =>
directWallets.subscribe(subscriber.next.bind(subscriber)),
);

const aggregators = computed(() =>
walletsOrAggregators.value.filter(
(walletOrAggregator) => walletOrAggregator instanceof WalletAggregator,
const providers = computed(() =>
walletsOrProviders.value.filter(
(walletOrProvider) => walletOrProvider instanceof WalletProvider,
),
);

const aggregators$ = new Observable<WalletAggregator[]>((subscriber) =>
aggregators.subscribe(subscriber.next.bind(subscriber)),
const providers$ = new Observable<WalletProvider[]>((subscriber) =>
providers.subscribe(subscriber.next.bind(subscriber)),
);

const aggregatorWallets$ = aggregateWallets(aggregators$);
const providerWallets$ = aggregateWallets(providers$);

export const wallets$ = combineLatest([
directWallets$,
aggregatorWallets$,
]).pipe(
map(([directWallets, aggregatorWallets]) => [
export const wallets$ = combineLatest([directWallets$, providerWallets$]).pipe(
map(([directWallets, providerWallets]) => [
...directWallets,
...aggregatorWallets,
...providerWallets,
]),
);

Expand Down
40 changes: 20 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@dot-connect/docs@workspace:apps/docs"
dependencies:
"@reactive-dot/core": "npm:^0.22.0"
"@reactive-dot/wallet-ledger": "npm:^0.16.11"
"@reactive-dot/wallet-walletconnect": "npm:^0.16.11"
"@reactive-dot/core": "npm:^0.24.0"
"@reactive-dot/wallet-ledger": "npm:^0.16.13"
"@reactive-dot/wallet-walletconnect": "npm:^0.16.13"
dot-connect: "workspace:^"
polkadot-api: "npm:^1.6.2"
vitepress: "npm:^1.3.4"
Expand Down Expand Up @@ -2417,14 +2417,14 @@ __metadata:
languageName: node
linkType: hard

"@reactive-dot/core@npm:^0.22.0":
version: 0.22.0
resolution: "@reactive-dot/core@npm:0.22.0"
"@reactive-dot/core@npm:^0.24.0":
version: 0.24.0
resolution: "@reactive-dot/core@npm:0.24.0"
dependencies:
"@reactive-dot/utils": "npm:^0.9.0"
peerDependencies:
polkadot-api: 1.x
checksum: 10c0/d68b8bb434fac7bdbef24ae621d2c505b17963ea1c52518c5afd9b3b3524c6a3c423be83faee1511edfa8fba70ebd2fd65d3a2c0d53b42e299db0b612ebea270
checksum: 10c0/fbee8a5f4d74b3ec6bab5cb17c06990065531eb12222c9c7254085ac4ae845a409b534353f6002386b32780732d2bc4e40c4a7a043995be77a07863b7107e99b
languageName: node
linkType: hard

Expand All @@ -2435,26 +2435,26 @@ __metadata:
languageName: node
linkType: hard

"@reactive-dot/wallet-ledger@npm:^0.16.11":
version: 0.16.11
resolution: "@reactive-dot/wallet-ledger@npm:0.16.11"
"@reactive-dot/wallet-ledger@npm:^0.16.13":
version: 0.16.13
resolution: "@reactive-dot/wallet-ledger@npm:0.16.13"
dependencies:
"@ledgerhq/hw-transport-webusb": "npm:^6.29.4"
"@polkadot-api/ledger-signer": "npm:^0.1.4"
"@reactive-dot/core": "npm:^0.22.0"
"@reactive-dot/core": "npm:^0.24.0"
buffer: "npm:^6.0.3"
checksum: 10c0/717f9a120c96a141259ed9cd86c7d26d5eaacb72addbb9c6364f402886f751ea5c85705c9f9673ea5a7358aec18b1109d2e67a3ae58d1032b1d7314c8731fb9a
checksum: 10c0/2b7e87d7b62744e74a6cf883d2743e5b31b4366bab248a515336b17acf47be0f6b3244681fa4a0f8d852168c3202805456b4cc90f323ab1b0cdc8520deae605b
languageName: node
linkType: hard

"@reactive-dot/wallet-walletconnect@npm:^0.16.11":
version: 0.16.11
resolution: "@reactive-dot/wallet-walletconnect@npm:0.16.11"
"@reactive-dot/wallet-walletconnect@npm:^0.16.13":
version: 0.16.13
resolution: "@reactive-dot/wallet-walletconnect@npm:0.16.13"
dependencies:
"@reactive-dot/core": "npm:^0.22.0"
"@reactive-dot/core": "npm:^0.24.0"
"@walletconnect/modal": "npm:^2.7.0"
"@walletconnect/universal-provider": "npm:^2.17.1"
checksum: 10c0/232124f7b7b3a2692dd041f7cbf3e8a0ace1c6447d09db60e8c9828474a8ce3b3b182e15d9016c2568e34abca5888a384e0e834a6339e356f096dc585655f3b1
checksum: 10c0/2e1a993a4341c0c52318e284a1113adca635d7d18286dc5a3534eaf377570dcb7ba4da0395a15d32cde366133f75c332e1093ea8f3f08b4519ef921848f38494
languageName: node
linkType: hard

Expand Down Expand Up @@ -4804,8 +4804,8 @@ __metadata:
"@lit-labs/preact-signals": "npm:^1.0.2"
"@lit/react": "npm:^1.0.6"
"@lit/task": "npm:^1.0.1"
"@reactive-dot/core": "npm:^0.22.0"
"@reactive-dot/wallet-ledger": "npm:^0.16.11"
"@reactive-dot/core": "npm:^0.24.0"
"@reactive-dot/wallet-ledger": "npm:^0.16.13"
"@tsconfig/recommended": "npm:^1.0.7"
"@tsconfig/strictest": "npm:^2.0.5"
"@types/eslint__js": "npm:^8.42.3"
Expand All @@ -4819,7 +4819,7 @@ __metadata:
typescript: "npm:^5.6.2"
typescript-eslint: "npm:^8.8.0"
peerDependencies:
"@reactive-dot/core": "*"
"@reactive-dot/core": ">= 0.24.x"
react: ">= 18"
peerDependenciesMeta:
react:
Expand Down

0 comments on commit 2d3f70f

Please sign in to comment.