Skip to content

Commit

Permalink
fix: update window.rei.ckb (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
wendychaung authored Feb 5, 2025
1 parent 45c9292 commit 7bed665
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-countries-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ckb-ccc/rei": patch
---

fix: update window.rei.ckb
12 changes: 6 additions & 6 deletions packages/rei/src/signersFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { ReiSigner } from "./signer.js";

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

if (typeof windowRef.ckb === "undefined") {
if (typeof windowRef?.rei?.ckb === "undefined") {
return [];
}

return [
{
signer: new ReiSigner(client, windowRef.ckb),
signer: new ReiSigner(client, windowRef.rei.ckb),
name: "CKB",
},
];
Expand Down

0 comments on commit 7bed665

Please sign in to comment.