Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Wallet sdk and example wallet #2716

Merged
merged 91 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
3ad4f02
chore(wallet-sdk): initial commit
alber70g Sep 12, 2024
7e9afee
feat(wallet-sdk): add initial api specification
barthuijgen Oct 3, 2024
7d9155b
wip: work on wallet sdk interface
barthuijgen Oct 8, 2024
cbf8e11
feat(kadena-wallet-sdk) some tweaks -kdn support
nillo Oct 11, 2024
9909e21
feat: add more logic to wallet-sdk
barthuijgen Oct 11, 2024
0e5ecee
chore(wallet-sdk) cleanup
nillo Oct 14, 2024
9c35681
fix(wallet-sdk): Finish api interfaces
barthuijgen Oct 14, 2024
6e5ad34
feat(wallet-sdk): account details support (#2578)
nillo Oct 15, 2024
059112b
fix(wallet-sdk): improve file structure
barthuijgen Oct 15, 2024
fe876c0
feat(wallet-sdk-example): add example app for wallet sdk
barthuijgen Oct 15, 2024
7f2be6f
fix(wallet-sdk): build and wallet-example build
barthuijgen Oct 17, 2024
33b894d
feat(wallet-sdk): add graphql codegen and transfers query
barthuijgen Oct 22, 2024
d5f4f6f
updates to wallet sdk
barthuijgen Nov 4, 2024
8ad18f9
update builds for sdk wallet lib and app
barthuijgen Nov 4, 2024
139b335
add functionality to sdk wallet example
barthuijgen Nov 5, 2024
6917600
chore(wallet-sdk): tests/cleanup
nillo Nov 5, 2024
94f84d0
fix(wallet-sdk): split up logic in example wallet
barthuijgen Nov 6, 2024
4b17622
feat(wallet-sdk-example): added kadenanames / ui cleanup
nillo Nov 6, 2024
e73c459
feat(wallet-sdk): documentation for key gen (#2596)
nillo Nov 6, 2024
35d0930
fix(wallet-sdk): styling in example wallet
barthuijgen Nov 6, 2024
55b8118
chore(wallet-sdk): cleanup
nillo Nov 6, 2024
704355d
chore(wallet-sdk): cleanup
nillo Nov 6, 2024
e98b93e
chore(wallet-sdk-example): names support
nillo Nov 8, 2024
e206bb7
chore(wallet-sdk-example): names support
nillo Nov 8, 2024
2e3204e
feat(wallet-sdk) added support for registering and some cleanup
nillo Nov 11, 2024
e76ed13
chore(wallet-sdk) cleanup
nillo Nov 11, 2024
d1874cc
chore(wallet-sdk-example) cleanup
nillo Nov 11, 2024
f6602d7
add logic to getTransfers
barthuijgen Nov 11, 2024
493b9e2
feat(wallet-sdk-example) accordion/cleanup
nillo Nov 12, 2024
f83e4d7
feat(wallet-sdk-example) gas limit
nillo Nov 12, 2024
4701f93
chore(wallet-sdk-example) cleanup
nillo Nov 12, 2024
d97c989
chore(wallet-sdk-example) throw error instead of duplicating code
nillo Nov 12, 2024
d9051dd
chore(wallet-sdk-example) updated readme
nillo Nov 12, 2024
13d014d
chore(wallet-sdk-cleanup) fix readme
nillo Nov 12, 2024
e2e5fad
feat(wallet-sdk): refactor get transfers, and small wallet example fixes
barthuijgen Nov 21, 2024
e81acb9
fixed UI to match kadena kode-ui
nillo Nov 24, 2024
36ecd88
feat(wallet-sdk-example) added nicely formatted markdown support for …
nillo Nov 25, 2024
d120df7
chore(wallet-sdk-example): cleanup readme docs
nillo Nov 25, 2024
be0729c
chore(wallet-sdk-example): cleanup readme docs
nillo Nov 25, 2024
6f8e74c
chore(wallet-sdk-example): balance indication color
nillo Nov 25, 2024
39257d7
chore(wallet-sdk-example): cleanup
nillo Nov 25, 2024
bb12443
feat(wallet-example-app) added network selector, and prevention for t…
nillo Nov 25, 2024
103a5d8
chore(wallet-sdk-example) cleanup
nillo Nov 25, 2024
99871b6
feat(wallet-sdk-example): code highlighter / indicator
nillo Nov 27, 2024
12a205a
chore(wallet-sdk-example) typo
nillo Nov 27, 2024
b656139
chore(wallet-sdk-example) folder cleanup / added sticky header
nillo Nov 27, 2024
ab38ed0
feat(wallet-sdk): add wip cross chain finish command
barthuijgen Nov 27, 2024
7a6c56c
feat(wallet-sdk): add display of cross chain in transaction list
barthuijgen Nov 27, 2024
e2f5784
chore(wallet-sdk-example): cleanup
nillo Nov 27, 2024
b5b393e
chore(wallet-sdk-example): cleanup / fix for highlighting fail
nillo Nov 27, 2024
108c769
chore(wallet-sdk-example): refactoring / cleanup
nillo Nov 27, 2024
c36f5eb
feat(wallet-sdk-example) added tooltip with (popper) support
nillo Nov 27, 2024
92faf0f
minor fix
nillo Nov 27, 2024
f32765d
feat(wallet-sdk): add cross chain complete subscribe method
barthuijgen Dec 3, 2024
4b9198f
feat(wallet-sdk): added network call, and tests
nillo Dec 4, 2024
60d00a0
chore(wallet-sdk): added tests for network
nillo Dec 4, 2024
976fb5a
feat(wallet-sdk): query getTrasnfer per chain
barthuijgen Dec 4, 2024
d015653
chore(wallet-sdk): added tests for accountdetail / gastlimitestimat /…
nillo Dec 4, 2024
61171f1
feat(wallet-sdk): cross chain send, improve tracking logic
barthuijgen Dec 4, 2024
4de6048
feat(wallet-sdk-example): added notifications.
nillo Dec 4, 2024
52fc39b
chore(wallet-sdk-example): fixed styling for modal
nillo Dec 4, 2024
b10c97b
fix(wallet-sdk-example): fixed chain selection on fund
nillo Dec 4, 2024
62ec99f
removed console logs
barthuijgen Dec 5, 2024
b2b7a5c
feat(wallet-sdk): add pagination for getTransfer and other fixes
barthuijgen Dec 5, 2024
998a95a
updated readme
nillo Dec 5, 2024
cbc8894
chore(wallet-sdk): updated readme
nillo Dec 5, 2024
0fa98b9
chore(wallet-sdk/walletsdk-example): updated readme
nillo Dec 5, 2024
18ad631
Update README.md
nillo Dec 5, 2024
a93c8a8
chore(wallet-sdk-example): bug fix showing wrong data / updated in ap…
nillo Dec 5, 2024
7bdb76e
feat(wallet-sdk): add crosschain data to pending transaction
barthuijgen Dec 6, 2024
543bf7f
fix: sync package versions for wallet-sdk
barthuijgen Dec 6, 2024
680001f
fix: Removed unused code in client-utils
barthuijgen Dec 6, 2024
7806939
feat(wallet-sdk): set up api extractor docs and export all required i…
barthuijgen Dec 6, 2024
ebba61e
fix(wallet-sdk): update tests
barthuijgen Dec 6, 2024
433cbf5
fix(wallet-sdk): update tests
barthuijgen Dec 6, 2024
d78d891
chore(wallet-sdk) pact-utils test
nillo Dec 6, 2024
13c674c
fix(wallet-sdk): test coverage
barthuijgen Dec 6, 2024
39142d6
fix(wallet-sdk): linting issues
barthuijgen Dec 6, 2024
03c0045
chore(wallet-sdk): added exchange test
nillo Dec 6, 2024
4a2524e
chore(wallet-sdk): added exchange test fix
nillo Dec 6, 2024
53c7834
chore(wallet-sdk): string util test added
nillo Dec 6, 2024
f41ff04
chore(wallet-sdk): test create cross chain finish command
barthuijgen Dec 6, 2024
e164f8e
chore(wallet-sdk): kadenanames test update
nillo Dec 6, 2024
2279568
fix(wallet-sdk-example): fix typescript issue
barthuijgen Dec 6, 2024
588c3d2
fix(wallet-sdk-example): add to packages
barthuijgen Dec 6, 2024
73fc204
fix(wallet-sdk): set type to module
barthuijgen Dec 6, 2024
6176ffe
chore(wallet-sdk-example): remove unused code
barthuijgen Dec 6, 2024
27b5680
chore(wallet-sdk-example): attempt to fix ci build
barthuijgen Dec 6, 2024
b844b59
chore(wallet-sdk): fix turbo output
barthuijgen Dec 9, 2024
2b0b87d
chore(wallet-sdk): add changeset for 0.1.0
barthuijgen Dec 9, 2024
8615d09
chore(hd-wallet): changeset for updated readme
barthuijgen Dec 9, 2024
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
9 changes: 9 additions & 0 deletions .changeset/nervous-pears-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@kadena/wallet-sdk': minor
---

The Kadena Wallet SDK provides a simple and unified interface to integrate
Kadena blockchain functionalities into your wallet applications. It abstracts
the complexities of interacting with the Kadena network, allowing you to focus
on building feature-rich wallet experiences without re-implementing common
integrations.
5 changes: 5 additions & 0 deletions .changeset/pink-camels-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kadena/hd-wallet': patch
---

Improved documentation in readme
6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,9 @@ e2e-proof-of-us:
'@kadena/snap':
- changed-files:
- any-glob-to-any-file: packages/libs/snap/*
'@kadena/wallet-sdk':
- changed-files:
- any-glob-to-any-file: packages/libs/wallet-sdk/*
wallet-sdk-example-app:
- changed-files:
- any-glob-to-any-file: packages/apps/wallet-sdk-example/*
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ Overview of the main packages maintained in this repository:
| [@kadena/pactjs-generator][56] | [![version][58]][57] |
| [@kadena/snap][59] | [![version][61]][60] |
| [@kadena/types][62] | [![version][64]][63] |
| [@kadena/wallet-sdk][65] | [![version][67]][66] |

<!--packageTable end -->

## Contributors

Special thanks to the wonderful people who have contributed to this project:

[![Contributors][66]][65]
[![Contributors][69]][68]

[1]: https://docs.kadena.io
[2]: https://discord.io/kadena
Expand Down Expand Up @@ -138,5 +139,9 @@ Special thanks to the wonderful people who have contributed to this project:
https://github.com/kadena-community/kadena.js/tree/main/packages/libs/types
[63]: packages/libs/types/CHANGELOG.md
[64]: https://img.shields.io/npm/v/@kadena/types.svg
[65]: https://github.com/kadena-community/kadena.js/graphs/contributors
[66]: https://contrib.rocks/image?repo=kadena-community/kadena.js
[65]:
https://github.com/kadena-community/kadena.js/tree/main/packages/libs/wallet-sdk
[66]: packages/libs/wallet-sdk/CHANGELOG.md
[67]: https://img.shields.io/npm/v/@kadena/wallet-sdk.svg
[68]: https://github.com/kadena-community/kadena.js/graphs/contributors
[69]: https://contrib.rocks/image?repo=kadena-community/kadena.js
12 changes: 12 additions & 0 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@
"private": false,
"path": "packages/libs/types"
},
{
"name": "@kadena/wallet-sdk",
"version": "0.0.1",
"private": false,
"path": "packages/libs/wallet-sdk"
},
{
"name": "@kadena-dev/e2e-base",
"version": "0.0.2",
Expand Down Expand Up @@ -256,5 +262,11 @@
"version": "0.0.2",
"private": true,
"path": "packages/e2e/e2e-tools"
},
{
"name": "wallet-sdk-example-app",
"version": "0.0.1",
"private": true,
"path": "packages/apps/wallet-sdk-example"
}
]
4 changes: 2 additions & 2 deletions packages/apps/dev-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@
"@types/react-dom": "^18.2.25",
"@vanilla-extract/esbuild-plugin": "^2.3.11",
"@vanilla-extract/vite-plugin": "4.0.17",
"@vitejs/plugin-react-swc": "^3.3.2",
"@vitejs/plugin-react-swc": "^3.2.2",
"chokidar-cli": "^3.0.0",
"concurrently": "^8.2.2",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"typescript": "5.4.5",
"vite": "^5.2.11",
"vite": "^5.4.8",
"vite-plugin-static-copy": "^1.0.0",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "^1.6.0"
Expand Down
24 changes: 24 additions & 0 deletions packages/apps/wallet-sdk-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
148 changes: 148 additions & 0 deletions packages/apps/wallet-sdk-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Wallet SDK Example App

The Wallet SDK Example App is a comprehensive showcase of the features and
capabilities of the
[Kadena Wallet SDK](https://github.com/kadena-community/kadena.js/blob/main/packages/libs/wallet-sdk).
This app is designed to provide developers with an interactive platform to
explore, understand, and experiment with every function of the SDK.

## **Features**

- **Function Demonstrations**: Every function of the Wallet SDK is demonstrated,
including examples of:

- Transaction creation.
- Account querying.
- Transfers
- Cross-chain transfers.
- Gas estimation.
- Human Readible Name Resolving

- **Live Code Execution**: Each function displays:
- The code being executed.
- The real-time response from the Kadena network.
- The real-time response from the Kadena Graph
- **Code Highlighter**: Interactive code snippets are highlighted for better
understanding.
- **Step-by-Step Guidance**: Navigate the app to learn how to implement each
feature of the Wallet SDK.

---

## **Getting Started**

### **Prerequisites**

Ensure you have the following installed:

- **Node.js** (v16 or later)
- **Yarn** or **npm**
- A modern browser (Chrome, Firefox, etc.)

### **Installation**

1. Clone the repository:

```bash
git clone https://github.com/kadena-community/kadena.js.git
cd kadena.js/packages/apps/wallet-sdk-example
```

2. Install dependencies:

```bash
npm install
# or
yarn install
# or
pnpm install
```

3. Start the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm run dev
```

4. Open the app in your browser:
```bash
http://localhost:3000
```

---

## **Usage**

1. Launch the app in your browser.
2. Explore the features:
- Select a option from the navigation menu.
- View the code example and corresponding response.
- Modify inputs (where applicable) to test custom scenarios.
3. Use the app as a guide to integrate Wallet SDK functions into your own
projects.

---

## **Technical Details**

This app is built using:

- **React** for the UI.
- **TypeScript** for type safety.
- **Vite** for fast builds and development.
- **Kadena Wallet SDK** for blockchain interactions.

---

## **Development**

To extend or modify or play with the app:

1. Open the project in your favorite IDE.
2. Navigate to the `src` folder to explore the codebase:
- `components/`: Reusable React components.
- `pages/`: Main pages showcasing the SDK functions.
- `utils/`: Utility functions for interacting with the SDK.
3. Add new features or update existing examples as needed.

---

## **Contributing**

Contributions are welcome! If you'd like to improve the app or add new features,
please:

1. Fork the repository.
2. Create a new branch:
```bash
git checkout -b feature/your-feature-name
```
3. Commit your changes:
```bash
git commit -m "Add your feature"
```
4. Push your changes and create a pull request.

---

## **License**

This project is licensed under the BSD 3-Clause License. See the
[LICENSE](https://github.com/kadena-community/kadena.js/LICENSE) file for
details.

---

## **Resources**

- [Kadena Wallet SDK Documentation](https://github.com/kadena-community/kadena.js/tree/feat/wallet-sdk-interface/packages/libs/wallet-sdk/README.md)
- [Kadena Official Documentation](https://docs.kadena.io/)
- [Kadena GitHub Repository](https://github.com/kadena-io/)

---

Happy coding! 🎉
29 changes: 29 additions & 0 deletions packages/apps/wallet-sdk-example/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from '@eslint/js';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/no-explicit-any': 'warn',
},
},
);
23 changes: 23 additions & 0 deletions packages/apps/wallet-sdk-example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Kode+Mono:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions packages/apps/wallet-sdk-example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "wallet-sdk-example-app",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"build": "tsc -b && vite build",
"dev": "vite",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@kadena/client": "workspace:*",
"@kadena/hd-wallet": "workspace:*",
"@kadena/kode-icons": "workspace:*",
"@kadena/kode-ui": "workspace:*",
"@kadena/wallet-sdk": "workspace:*",
"@popperjs/core": "^2.11.8",
"@tanstack/react-query": "^5.32.0",
"@vanilla-extract/css": "1.14.2",
"@vanilla-extract/vite-plugin": "4.0.17",
"clsx": "^2.1.1",
"dompurify": "^3.2.1",
"highlight.js": "^11.10.0",
"html-react-parser": "^5.1.18",
"jotai": "^2.10.1",
"markdown-it": "^14.1.0",
"next-themes": "^0.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.26.2"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@kadena-dev/shared-config": "workspace:*",
"@types/markdown-it": "^14.1.2",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@types/react-router-dom": "^5.3.3",
"@types/react-syntax-highlighter": "^15.5.13",
"@vitejs/plugin-react-swc": "^3.2.2",
"autoprefixer": "^10.4.20",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"globals": "^15.9.0",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "5.4.5",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8",
"vite-plugin-node-polyfills": "^0.22.0"
}
}
6 changes: 6 additions & 0 deletions packages/apps/wallet-sdk-example/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
1 change: 1 addition & 0 deletions packages/apps/wallet-sdk-example/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading