Skip to content

Commit

Permalink
implement basic sdk version
Browse files Browse the repository at this point in the history
# Conflicts:
#	nix/npmdeps.nix
#	wallet-extension/README.md
#	wallet-extension/package.json
#	wallet-extension/src/features/blockchain/smartAccount.ts
#	wallet-extension/src/router/Wallet.tsx
#	wallet-extension/src/router/routes.ts
  • Loading branch information
0xAleksaOpacic committed Mar 4, 2025
1 parent 9549a10 commit b420902
Show file tree
Hide file tree
Showing 51 changed files with 3,730 additions and 4,441 deletions.
2 changes: 1 addition & 1 deletion nix/npmdeps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ in
../uniswap/package.json
];
};
hash = "sha256-MauIU4VV8nGDVoTnrnjFjBOs8TAGjdw+bOmDroyIWL0=";
hash = "sha256-QjSqwUDZeMmratoR1hl89Kfr9dNWJPshflggM3hfMYk=";
})
6,056 changes: 1,741 additions & 4,315 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wallet-extension/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VITE_GET_ENDPOINT_URL=https://t.me/NilDevnetTokenBot
VITE_APP_VERSION=0.0.1
VITE_APP_VERSION=0.0.2
VITE_APP_SUPPORT=https://t.me/+PT-6HyWK_LBmMmIx
VITE_APP_FEEDBACK=https://form.typeform.com/to/hnXGd5AJ
VITE_APP_COMMUNITY=https://t.me/+c6dyPtmz63g5NmUx
Expand Down
41 changes: 40 additions & 1 deletion wallet-extension/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <p align="center">=nil; Wallet Extension 🔐</p>

Welcome to the **=nil; Wallet Extension** — a user-friendly way to manage accounts on the **=nil;** blockchain. This extension provides essential tools for interacting with the network or connecting with decentralized applications (dApps). Give it a spin and let us know what you think! 🚀
Welcome to the **=nil; Wallet Extension** — a user-friendly way to manage accounts on the **=nil;** blockchain. This extension provides essential tools for interacting with the network or connecting with dApps. Give it a spin and let us know what you think! 🚀

---

Expand All @@ -23,6 +23,21 @@ By default, everything is in **English**. However, we plan to support multiple l

---

## Wallet SDK 🚀

The =nil; Wallet Extension comes with a built-in SDK that follows the [EIP-1193 Standard](https://eips.ethereum.org/EIPS/eip-1193)

We are also actively working on supporting the [EIP-6963 Standard](https://eips.ethereum.org/EIPS/eip-6963) to further improve multi-provider support.

The extension injects the `window.nil` object into the browser. Currently, we support the following two methods:

1. **eth_sendTransaction:** Send transactions directly from the wallet.
2. **eth_requestAccounts:** Request user wallet addresses.

To learn more about how to use the SDK, visit the [SDK Documentation](#)

---

## How to Use ⚙️

1. **Clone** this repository to your local machine
Expand All @@ -49,3 +64,27 @@ By default, everything is in **English**. However, we plan to support multiple l
- Load the generated folder as an **unpacked extension**

That’s it! Enjoy managing your tokens and exploring dApps on the **=nil;** blockchain. If you have questions or suggestions, feel free to open an issue or reach out. 💡

## Contribution 🤝

We welcome contributions from the community! To view all issues, visit the [GitHub Issues page](https://github.com/NilFoundation/nil/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22wallet%20extension%22) and filter by the `wallet extension` label.

We also use the [good first issue](https://github.com/NilFoundation/nil/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22%20label%3A%22wallet%20extension%22) label for tasks that are beginner-friendly and open to outside contributors.

If you find a bug or want to request a new feature, please open a new issue and fill out the following template:

### Issue Template 📝

```sh
## Description:
// Briefly describe the issue or feature request

## Acceptance Criteria:
// Outline what must be true for the issue to be considered complete

## Technical Notes:
// Add any technical details or implementation considerations

## Figma/Design:
// Link to any relevant designs or wireframes
```
3 changes: 3 additions & 0 deletions wallet-extension/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"rules": {
"complexity": {
"noBannedTypes": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion wallet-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"type": "module",
"scripts": {
"build:general": "vite build",
"build": "tsc && npm run build:general",
"build:content-injected": "vite build --config vite.contentScript-injected.ts",
"build:content-nil": "vite build --config vite.contentScript-nil.ts",
"build": "tsc && npm run build:general && npm run build:content-injected && npm run build:content-nil",
"lint": "biome check .",
"lint:all": "npm run lint && npm run lint:types",
"lint:fix": "biome check --write .",
Expand All @@ -14,11 +16,13 @@
"interface": "i18next-resources-for-ts interface -i public/locales/en -o src/@types/resources.d.ts"
},
"dependencies": {
"@metamask/rpc-errors": "^7.0.2",
"@nilfoundation/niljs": "0.24.0",
"@nilfoundation/ui-kit": "^2.5.28",
"baseui": "^13.0.0",
"effector": "^22.8.6",
"effector-react": "^22.5.3",
"eventemitter3": "^5.0.1",
"i18next": "^24.2.1",
"i18next-resources-for-ts": "^1.5.0",
"react": "^18.3.1",
Expand All @@ -29,8 +33,11 @@
"react-router-dom": "^7.1.1",
"styletron-engine-atomic": "^1.6.2",
"styletron-react": "^6.1.1",
"uuid": "^11.0.5",
"vite-plugin-singlefile": "^2.1.0",
"vite-plugin-svgr": "^4.3.0",
"vitest": "^1.6.0",
"zod": "^3.24.2",
"effector-storage": "^6.1.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions wallet-extension/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
height: 100%;
}
html, body {
width: 400px;
height: 600px;
min-width: 400px;
min-height: 600px;
background-color: #212121;
overflow: hidden;
}
Expand Down
5 changes: 5 additions & 0 deletions wallet-extension/public/icons/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions wallet-extension/public/icons/linked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions wallet-extension/public/icons/website.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions wallet-extension/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"copiedButton": "Copied",
"getEndpointButton": "Open RPC Bot"
},
"connectionPage": {
"title": "Manage DApps"
},
"sendPage": {
"title": "Send",
"fromSection": {
Expand All @@ -95,6 +98,7 @@
"title": "Settings",
"endpointSection": "View endpoint",
"getSupport": "Get support",
"manageConnection": "Manage DApps",
"feedback": "Share Feedback",
"community": "Join community",
"footerVersion": "Version"
Expand Down Expand Up @@ -129,5 +133,22 @@
"addressError": "Invalid address or token already added"
}
}
},
"requests": {
"connect": {
"title": "Connect Request",
"requestedLabel": "Requested:",
"walletLabel": "Connect to",
"walletName": "Main Wallet",
"notification": "This DApp will view your wallet and suggest transactions.",
"cancelButton": "Cancel",
"connectButton": "Connect"
},
"sendSign": {
"title": "Transaction request",
"requestedLabel": "Requested:",
"confirmButton": "Confirm",
"cancelButton": "Cancel"
}
}
}
96 changes: 0 additions & 96 deletions wallet-extension/public/locales/ru/transalation.json

This file was deleted.

33 changes: 31 additions & 2 deletions wallet-extension/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "=nil; Wallet",
"version": "1.0",
"version": "1.0.1",
"description": "An easy-to-use wallet extension for the =nil; blockchain, designed for secure asset management and seamless transactions",
"permissions": ["storage", "tabs"],
"background": {
Expand All @@ -24,5 +24,34 @@
"16": "./img/logo-square.png",
"48": "./img/logo-square.png",
"128": "./img/logo-square.png"
}
},
"content_scripts": [
{
"id": "injected",
"run_at": "document_start",
"matches": [
"http://127.0.0.1/*",
"http://localhost/*",
"https://*/*"
],
"js": [
"content_injected/injected.js"
],
"type": "module"
},
{
"id": "nil",
"run_at": "document_start",
"matches": [
"http://127.0.0.1/*",
"http://localhost/*",
"https://*/*"
],
"js": [
"content_nil/nil.js"
],
"world": "MAIN",
"type": "module"
}
]
}
Loading

0 comments on commit b420902

Please sign in to comment.