Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/wallets-use-sdk-logger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@crossmint/wallets-sdk": patch
---

Replace direct console.* calls with walletsLogger to respect consoleLogLevel setting

Category: improvements
Product Area: wallets
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IFrameWindow, SignersWindowTransport, type HandshakeParent } from "@crossmint/client-sdk-window";
import { environmentUrlConfig, signerInboundEvents, signerOutboundEvents } from "@crossmint/client-signers";
import type { APIKeyEnvironmentPrefix } from "@crossmint/common-sdk-base";
import { walletsLogger } from "../../logger";

export type IframeConfig = {
environment: APIKeyEnvironmentPrefix;
Expand All @@ -16,7 +17,7 @@ export class NcsIframeManager {
return this.handshakeParent;
}

console.info("Initializing signers frame for the first time");
walletsLogger.info("Initializing signers frame for the first time");
const t0 = Date.now();
const iframeUrl = new URL(environmentUrlConfig[this.config.environment]);
iframeUrl.searchParams.set("targetOrigin", window.location.origin);
Expand All @@ -36,7 +37,7 @@ export class NcsIframeManager {
SignersWindowTransport
);
await this.handshakeParent.handshakeWithChild();
console.info(`Signers frame initialized in ${Date.now() - t0}ms`);
walletsLogger.info(`Signers frame initialized in ${Date.now() - t0}ms`);
return this.handshakeParent;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/wallets/src/wallets/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export class Wallet<C extends Chain> {
*/
// TODO: Remove this method in the next major version
public async approveTransaction(params: ApproveParams) {
console.warn(
walletsLogger.warn(
"approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."
);
return await this.approve(params);
Expand Down