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: utility wallet connector #305

Merged
merged 80 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
06622d8
feat: initial commit
apskhem Mar 13, 2024
fee9cba
feat: wallet card
apskhem Mar 13, 2024
a39822a
feat: cardano types
apskhem Mar 13, 2024
b6ab6d6
feat: wallet info view
apskhem Mar 13, 2024
e598d98
feat: secitons
apskhem Mar 14, 2024
4ca2825
refactor: move wallet info section
apskhem Mar 14, 2024
6676b91
feat: stricter checks
apskhem Mar 14, 2024
3f07cae
feat: panels
apskhem Mar 14, 2024
f9571e0
feat: cbor editor
apskhem Mar 14, 2024
592268b
feat: hex2diag
apskhem Mar 14, 2024
8fb36c9
feat: reactive cbor editor
apskhem Mar 14, 2024
80e21ec
feat: response
apskhem Mar 15, 2024
4c3f313
feat: submit tx function
apskhem Mar 15, 2024
c8c2517
feat: clean hex
apskhem Mar 15, 2024
3f8ac97
feat: to be implemented
apskhem Mar 15, 2024
2e7bed0
feat: enable all wallets
apskhem Mar 15, 2024
1aef0c5
feat: json mode
apskhem Mar 15, 2024
a1e61ba
feat: json editor
apskhem Mar 15, 2024
7ccb117
fix: extract api data handling
apskhem Mar 15, 2024
e818cc5
refactor: move components to common
apskhem Mar 15, 2024
6ee8c1e
feat: file upload
apskhem Mar 15, 2024
bb63a66
feat: extension field
apskhem Mar 18, 2024
67c77e7
fix: types
apskhem Mar 18, 2024
836d98b
feat: linters
apskhem Mar 18, 2024
ccd917a
chore: lintfix
apskhem Mar 18, 2024
37eccb1
chore: lintfix
apskhem Mar 18, 2024
f25c506
chore: remove lint issues
apskhem Mar 18, 2024
5f4d9dd
chore: fmt
apskhem Mar 18, 2024
77ef29b
chore: lintfix
apskhem Mar 18, 2024
3f5f225
ci: build local
apskhem Mar 18, 2024
3e50875
docs: earthfile
apskhem Mar 18, 2024
0ca95b8
fix: copied
apskhem Mar 18, 2024
4d377fe
feat: re-enable
apskhem Mar 18, 2024
ce7bdf6
chore: remove console.log
apskhem Mar 18, 2024
8e08fab
docs: readme
apskhem Mar 20, 2024
a886bb3
feat: decoder
apskhem Mar 21, 2024
e08697f
feat: unsigned tx function
apskhem Mar 21, 2024
bbf18a8
feat: tx builder interaction
apskhem Mar 21, 2024
51c06a9
feat: advanced config
apskhem Mar 22, 2024
0493fda
chore: lintfix
apskhem Mar 22, 2024
90dd87f
feat: badge
apskhem Mar 22, 2024
e096ef8
feat: complete sign tx
apskhem Mar 22, 2024
21e7fe9
chore: lint
apskhem Mar 22, 2024
b3b906a
feat: badge variant
apskhem Mar 22, 2024
8ce840d
fix: selection state
apskhem Mar 22, 2024
81ed33f
fix: submit status
apskhem Mar 22, 2024
b2ac953
chore: remove unused pkgs
apskhem Mar 22, 2024
d96514e
fix: lint
apskhem Mar 22, 2024
60c04ce
feat: col fmt
apskhem Mar 22, 2024
163a2a6
chore: lintfix
apskhem Mar 22, 2024
bfe1d45
fix: change title
apskhem Mar 22, 2024
1aa3836
refactor: rename to wallet tester
apskhem Mar 22, 2024
f28d382
refactor: fix words
apskhem Mar 22, 2024
9abd5e7
fix: markdown lint docs
apskhem Mar 22, 2024
6725543
chore: remove tanstack
apskhem Mar 22, 2024
52513b5
feat: builder fields
apskhem Mar 26, 2024
b83ca02
chore: lintfix
apskhem Mar 26, 2024
6e4d005
feat: certificate stake delegation
apskhem Mar 26, 2024
75cf9a9
feat: apply builder fields to builder function
apskhem Mar 28, 2024
8df9adc
feat: certs build
apskhem Mar 28, 2024
2cd1035
feat: selection
apskhem Mar 29, 2024
497319c
feat: complete tx builder
apskhem Mar 29, 2024
e21df91
feat: reward network field
apskhem Apr 1, 2024
0de3bbc
feat: cbor metadata
apskhem Apr 1, 2024
f68d63e
feat: input display amount
apskhem Apr 1, 2024
c14e841
fix: minor
apskhem Apr 2, 2024
fe4bff7
feat: cleanup
apskhem Apr 2, 2024
1a66d60
chore: remove unused comment
apskhem Apr 2, 2024
361d7ed
fix: cspell
apskhem Apr 2, 2024
1b08a52
fixซ: mdlint
apskhem Apr 2, 2024
0adc5a8
Merge branch 'main' into feat/utils-wallet-connector
apskhem Apr 2, 2024
aea30b7
fix: cert fields len
apskhem Apr 2, 2024
90db959
fix: docs: earthfile
apskhem Apr 3, 2024
6a1e75b
Merge branch 'main' into feat/utils-wallet-connector
apskhem Apr 3, 2024
d176e02
Merge branch 'main' into feat/utils-wallet-connector
minikin Apr 4, 2024
426e787
Merge branch 'main' into feat/utils-wallet-connector
apskhem Apr 8, 2024
dff0e09
chore: remove empty switch button component
apskhem Apr 8, 2024
49831e7
Merge branch 'main' into feat/utils-wallet-connector
apskhem Apr 8, 2024
61f13cd
Merge branch 'main' into feat/utils-wallet-connector
apskhem Apr 8, 2024
62a138c
Merge branch 'main' into feat/utils-wallet-connector
minikin Apr 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
12 changes: 12 additions & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ androidx
appspot
Arbritrary
ARGB
asmjs
asyncio
asyncpg
auditability
Expand All @@ -17,6 +18,8 @@ BROTLI
canvaskit
cardano
Catalyst
CBOR
cborg
CEST
cfbundle
chromedriver
Expand All @@ -42,6 +45,7 @@ drep
dreps
earthfile
Edgedriver
emurgo
encryptor
endfunction
endfunction
Expand All @@ -59,6 +63,7 @@ genhtml
gethostname
gmtime
gradlew
headlessui
icudtl
ideascale
idents
Expand Down Expand Up @@ -104,6 +109,7 @@ pg_isready
plpgsql
podfile
podhelper
postcss
preprod
projectcatalyst
Prokhorenko
Expand Down Expand Up @@ -143,12 +149,18 @@ testunit
thiserror
thollander
timelike
toastify
Toastify
tojunit
Traceback
TXNZD
Typer
unmanaged
UTXO
utxo
Utxos
utxos
vite
vitss
vkey
voteplan
Expand Down
84 changes: 84 additions & 0 deletions utilities/wallet-tester/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
parser: "@typescript-eslint/parser"
root: true
env:
es2021: true
browser: true
node: true
extends:
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:react/recommended
- plugin:react/jsx-runtime
- plugin:react-hooks/recommended
- plugin:jsx-a11y/strict
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: latest
sourceType: module
tsconfigRootDir: ./
project:
- ./tsconfig.json
- ./tsconfig.node.json
plugins:
- "@typescript-eslint"
- react
- react-hooks
- jsx-a11y
- import
- react-refresh
overrides:
- files:
- "*.yaml"
- "*.yml"
parser: yaml-eslint-parser
extends:
- plugin:yml/standard
settings:
react:
version: detect
ignorePatterns:
- node_modules
rules:
# import
import/order:
- warn
- newlines-between: always
alphabetize:
order: asc
caseInsensitive: false
pathGroups:
# internal
- pattern: "common/**"
group: parent
- pattern: "modules/**"
group: parent
- pattern: "styles/**"
group: parent
- pattern: "types/**"
group: parent
# sibling
- pattern: "../**"
group: sibling
# styles
- pattern: "./*.css"
group: sibling
position: after
pathGroupsExcludedImportTypes: []

# vanilla js
quotes:
- error
- double

# react-refresh
react-refresh/only-export-components:
- error
- allowConstantExport: true

# typescript
"@typescript-eslint/semi": error
"@typescript-eslint/member-delimiter-style":
- error
- singleline:
requireLast: true
24 changes: 24 additions & 0 deletions utilities/wallet-tester/.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?
6 changes: 6 additions & 0 deletions utilities/wallet-tester/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
printWidth: 100
trailingComma: es5
useTabs: false
tabWidth: 2
semi: true
singleQuote: false
37 changes: 37 additions & 0 deletions utilities/wallet-tester/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
VERSION --try --global-cache 0.7

# builder - Installs node packages.
builder:
FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json .
COPY index.html postcss.config.js tailwind.config.js tsconfig* vite.config.ts .eslintrc.yaml .prettierrc.yaml .
COPY src ./src

RUN npm i

# check - Runs checks against the source code including type checks and linting.
check:
FROM +builder

RUN npm run check

# build - Builds the source code for deployment
build:
FROM +builder

RUN npm run build

SAVE ARTIFACT dist

# local - Makes a docker image that can serve the app for development purposes.
local:
FROM nginx:1.25-alpine

COPY +build/dist /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

SAVE IMAGE cat-wallet-connector:latest
42 changes: 42 additions & 0 deletions utilities/wallet-tester/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Cardano Utility Wallet Connector

## Setup Project

1. Make sure you have the version of Node.js 18 or 20 on your current machine as the requirement to run Vite.
2. Install all dependencies via `npm i`.
3. Done.
You can develop the project via the `npm run dev` command, and build the project by running the `npm run build` command.
See more scripts in `package.json`.

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

## Tools

* **Scripting**: TypeScript 5
* **UI Framework**: React 18
* **Styling**: Tailwind CSS
* **UI Components**: Headless UI
* **Utilities**: Lodash
* **Icons**: Material UI Icons
* **Build Tool**: Vite

## Runs with Earthly

Type command `earthly +local` to build the app with Nginx wrapped as a web server.

And run with docker:

```sh
docker run -p ...:80 -t cat-wallet-connector
```

## What it can do

First step, the tool will scan all accessible wallets installed as browser extensions.
It executes fundamental wallet actions as outlined in [CIP30](https://cips.cardano.org/cip/CIP-30/) including:

* Retrieving wallet details
* Simultaneously signing transactions using multiple wallets
* (WIP) Simultaneously signing data with multiple wallets
* (WIP) Simultaneously submitting transactions using multiple wallets
14 changes: 14 additions & 0 deletions utilities/wallet-tester/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="module" src="/src/main.tsx"></script>
<title>Cardano Wallet Tester</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
Loading
Loading