diff --git a/.changeset/grumpy-kangaroos-march.md b/.changeset/grumpy-kangaroos-march.md new file mode 100644 index 00000000..06571237 --- /dev/null +++ b/.changeset/grumpy-kangaroos-march.md @@ -0,0 +1,5 @@ +--- +"@starknet-react/core": patch +--- + +Remove Buffer usage diff --git a/packages/core/src/connectors/injected.ts b/packages/core/src/connectors/injected.ts index ab59f38a..be348b48 100644 --- a/packages/core/src/connectors/injected.ts +++ b/packages/core/src/connectors/injected.ts @@ -19,19 +19,12 @@ export interface InjectedConnectorOptions { icon?: ConnectorIcons; } -// Icon used when the injected wallet is not found and no icon is provided. -// question-mark-circle from heroicons -function walletNotFoundIcon(color: string): string { - const encoded = Buffer.from(` - - - - `).toString("base64"); - return `data:image/svg+xml;base64,${encoded}`; -} - -const WALLET_NOT_FOUND_ICON_LIGHT = walletNotFoundIcon("black"); -const WALLET_NOT_FOUND_ICON_DARK = walletNotFoundIcon("white"); +// Icons used when the injected wallet is not found and no icon is provided. +// question-mark-circle from heroicons with color changed to black/white. +const WALLET_NOT_FOUND_ICON_LIGHT = + "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iYmxhY2siPgogIDxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTkuODc5IDcuNTE5YzEuMTcxLTEuMDI1IDMuMDcxLTEuMDI1IDQuMjQyIDAgMS4xNzIgMS4wMjUgMS4xNzIgMi42ODcgMCAzLjcxMi0uMjAzLjE3OS0uNDMuMzI2LS42Ny40NDItLjc0NS4zNjEtMS40NS45OTktMS40NSAxLjgyN3YuNzVNMjEgMTJhOSA5IDAgMTEtMTggMCA5IDkgMCAwMTE4IDB6bS05IDUuMjVoLjAwOHYuMDA4SDEydi0uMDA4eiIgLz4KPC9zdmc"; +const WALLET_NOT_FOUND_ICON_DARK = + "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0id2hpdGUiPgogIDxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTkuODc5IDcuNTE5YzEuMTcxLTEuMDI1IDMuMDcxLTEuMDI1IDQuMjQyIDAgMS4xNzIgMS4wMjUgMS4xNzIgMi42ODcgMCAzLjcxMi0uMjAzLjE3OS0uNDMuMzI2LS42Ny40NDItLjc0NS4zNjEtMS40NS45OTktMS40NSAxLjgyN3YuNzVNMjEgMTJhOSA5IDAgMTEtMTggMCA5IDkgMCAwMTE4IDB6bS05IDUuMjVoLjAwOHYuMDA4SDEydi0uMDA4eiIgLz4KPC9zdmc+Cg=="; export class InjectedConnector extends Connector { private _wallet?: StarknetWindowObject;