Skip to content

Commit 7bed665

Browse files
authored
fix: update window.rei.ckb (#155)
1 parent 45c9292 commit 7bed665

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.changeset/strong-countries-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ckb-ccc/rei": patch
3+
---
4+
5+
fix: update window.rei.ckb

packages/rei/src/signersFactory.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { ReiSigner } from "./signer.js";
44

55
/**
66
* Retrieves the Rei signer if available.
7-
* @param client - The client instance.
8-
* @returns The Signer instance if the Rei provider is available, otherwise undefined.
7+
* @param {ccc.Client} client - The client instance.
8+
* @returns {Signer | undefined} The Signer instance if the Rei provider is available, otherwise undefined.
9+
910
*/
1011
export function getReiSigners(client: ccc.Client): ccc.SignerInfo[] {
11-
const windowRef = window as { ckb?: Provider };
12+
const windowRef = window as { rei?:{ckb: Provider} };
1213

13-
if (typeof windowRef.ckb === "undefined") {
14+
if (typeof windowRef?.rei?.ckb === "undefined") {
1415
return [];
1516
}
16-
1717
return [
1818
{
19-
signer: new ReiSigner(client, windowRef.ckb),
19+
signer: new ReiSigner(client, windowRef.rei.ckb),
2020
name: "CKB",
2121
},
2222
];

0 commit comments

Comments
 (0)