Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ storybook-static

tsconfig.tsbuildinfo
.vercel


app/next/certificates/*
app/next/.env
app/next/node_modules
*.pem
3 changes: 1 addition & 2 deletions app/demo-playground/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import { ConnectKitProvider, getDefaultConfig } from 'starkwebkit';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { AppProps } from 'next/app';
import { StarkwebProvider, createConfig } from 'starkweb/react';

const config = createConfig(
getDefaultConfig({
walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!,
appName: 'My ConnectKit App',
})
}),
);
const queryClient = new QueryClient();
export default function App({ Component, pageProps }: AppProps) {
Expand Down
4 changes: 4 additions & 0 deletions app/next/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.next
.env
certificates
node_modules
17 changes: 17 additions & 0 deletions app/next/components/Web3Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import {
argentX,
braavos,
catridge,
keplr,
metamask,
} from 'starkweb/connectors';
Expand All @@ -23,6 +24,7 @@
QueryClient,
QueryClientProvider,
} from '@tanstack/react-query';
import { env } from 'process';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import env.

Copilot Autofix

AI about 1 year ago

To fix the problem, we need to remove the unused import statement. This will clean up the code and eliminate any confusion about the purpose of the import. The change should be made in the file app/next/components/Web3Provider.tsx by removing the line that imports env from the process module.

Suggested changeset 1
app/next/components/Web3Provider.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/app/next/components/Web3Provider.tsx b/app/next/components/Web3Provider.tsx
--- a/app/next/components/Web3Provider.tsx
+++ b/app/next/components/Web3Provider.tsx
@@ -25,3 +25,3 @@
 } from '@tanstack/react-query';
-import { env } from 'process';
+
 
EOF
@@ -25,3 +25,3 @@
} from '@tanstack/react-query';
import { env } from 'process';


Copilot is powered by AI and may make mistakes. Always verify output.
@WiseMrMusa WiseMrMusa committed this autofix suggestion about 1 year ago.

export function getConfig() {
return createConfig({
Expand All @@ -32,6 +34,21 @@
braavos(),
keplr(),
metamask(),
catridge({
defaultChainId: '0x534e5f5345504f4c4941',
chains: [
{
id: '0x534e5f5345504f4c4941',
name: 'Sepolia',
rpcUrl: 'https://api.cartridge.gg/x/starknet/sepolia',
},
{
id: '0x534e5f4d41494e',
name: 'Mainnet',
rpcUrl: 'https://api.cartridge.gg/x/starknet/mainnet',
},
],
}),
],
storage: createStorage({
storage: cookieStorage,
Expand Down
2 changes: 1 addition & 1 deletion app/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --experimental-https --hostname wisemrmusa.fun",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand Down
5 changes: 3 additions & 2 deletions packages/starkweb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starkweb",
"version": "0.0.17",
"version": "0.0.18",
"private": false,
"type": "module",
"main": "./dist/cjs/exports/starkweb.js",
Expand Down Expand Up @@ -195,6 +195,7 @@
"prompts": "^2.4.2",
"use-sync-external-store": "1.2.2",
"ws": "latest",
"zustand": "4.4.1"
"zustand": "4.4.1",
"@cartridge/controller": "0.6.0"
}
}
252 changes: 252 additions & 0 deletions packages/starkweb/src/connectors/catridge.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/starkweb/src/exports/connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export { injected } from "../connectors/injected.js";
export { keplr } from "../connectors/keplr.js";
export { metamask } from "../connectors/metamask.js";
export { createConnector } from "../core/connectors/createConnector.js";

export { catridge } from "../connectors/catridge.js";
6 changes: 6 additions & 0 deletions packages/starkweb/src/types/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ declare global {
enable: () => Promise<string[]>
isConnected: boolean
} & SNIP1193Provider | undefined
starknet_catridge?: {
enable: () => Promise<string[]>
isConnected: boolean
connect: () => Promise<{address: string}>
disconnect: () => Promise<void>
} & SNIP1193Provider | undefined
}
}
Loading
Loading