Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
70 changes: 15 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,70 +7,30 @@ on:
pull_request:

jobs:
build-typescript:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.18
node-version: 22
check-latest: true

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci --include dev

- name: Validate TypeScript
run: npm run build
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm build
- run: pnpm link
- run: mywallet --help

lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18
check-latest: true

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci --include dev

- name: Lint
run: npm run lint

test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.18
node-version: 22
check-latest: true

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci --include dev

- name: Run tests
run: npm run test
env:
BLOCKFROST_API_KEY: ${{ secrets.BLOCKFROST__PREVIEW_API_KEY }}
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
dist
node_modules
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Mynth
Copyright (c) 2024-2025 Mynth

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
114 changes: 57 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
# Cardano Wallet

This project is a reference implementation for a simple Cardano wallet
interacting with Mynth. It consists of a CLI written in TypeScript
illustrating basic functions such as sending transactions with embedded
encrypted messages.

A Cardano wallet is a critical tool for interacting with Cardano,
allowing users to store, send, receive, and stake tokens. The foundation
of a Cardano wallet is the **seed phrase** (also known as a recovery
phrase or mnemonic phrase). This is a series of 12, 15, or 24 words
generated when the wallet is created. Every wallet has a unique seed
phrase. The seed phrase is the master key to the wallet, allowing the
user to recover the associated private keys and, therefore, all funds
and staking rights.

A Cardano wallet consists of two main types of private keys:

1. **Payment Private Key:** Used for transactions, such as sending or
receiving tokens.
2. **Staking Private Key:** Used for delegating ADA to a staking pool
or managing staking rewards.

From each private key, a corresponding **public key** is derived. The
public key is then used to generate a **Cardano address**, which others
can use to send tokens to your wallet.
# Mynth Wallet

A simple CLI-based multi-chain wallet for interacting with Mynth wallets
(intents).

## About Mynth

Mynth is an intent-based, multi‑chain, layer zero protocol designed to
simplify and secure cross‑chain token transfers. By encoding user
intentions (or “intents”) into on‑chain contracts, Mynth enables
seamless value movement between disparate blockchains without requiring
trust in centralized bridges or custodians. Key characteristics of Mynth
include:

- **Protocol‑level Intents**: Users express desired transfers as
intents, which are recorded in a contract and can be fulfilled or
canceled according to protocol rules.
- **Decentralized Execution**: Executors monitor and fulfill intents on
behalf of users, unlocking funds only upon valid proof of execution.
- **Secure Key Exposure**: When an intent is fulfilled or expired, the
associated private key is revealed in a verifiable way, ensuring that
only authorized parties can claim funds.
- **Multi‑Chain Interoperability**: Mynth operates agnostically across
chains, enabling transfers between any compatible network.

## Purpose

`mywallet` is a CLI companion utility for interacting with multi-chain
wallets. When a user wants to perform a swap between two blockchains,
Mynth encodes an intent within a contract, and these contracts act as
wallets that are controlled by the Mynth Lizard network. Once an intent
is fulfilled, it can be unlocked by an executor. If an intent expires,
it can be canceled by its owner. In either case of unlocking or
cancellation, the associated private key is exposed. To obtain this
private key, a user must verify that they have the authority to request
it.

One of the functionalities of the `mywallet` tool is to allow a user to
sign an intent to verify that they are one of the authorized
representatives for interacting with that intent. This signed
verification enables communicating with the Lizard network to retrieve
the underlying private key. Once the private key is obtained, `mywallet`
can be used to withdraw funds, transfer funds, or retrieve the addresses
associated with the intent.

## Prerequisites

To use this project, ensure you have the following installed:

- **Node.js** (v18.8 or later)
- **npm** (Node Package Manager)
- [Node.js](https://nodejs.org/en/download)
- [pnpm](https://pnpm.io/)

## Installation

To install and set up the Cardano Wallet CLI project, follow these
steps:

1. **Clone the repository:**

``` bash
git clone https://github.com/MynthAI/wallet.git
```
To install and set up the `mywallet`, follow these steps:

2. **Navigate to the project directory:**

``` bash
cd wallet
```

3. **Install the dependencies:**

``` bash
npm install
```
``` bash
git clone https://github.com/MynthAI/wallet.git
cd wallet
pnpm install
pnpm build
pnpm link
```

After completing these steps, the Cardano Wallet CLI should be ready for
use. You can test this by running:
After completing these steps, the `mywallet` should be ready for use.
You can test this by running:

``` bash
npx wallet
mywallet --help
```

## License

This project is licensed under the MIT License. By using or contributing
to this project, you agree to the terms and conditions of MIT.

## Support

If you encounter any issues or have questions, feel free to reach out
for support.

Happy encrypting and decrypting\!
66 changes: 66 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import path from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import parser from "@typescript-eslint/parser";
import importPlugin from "eslint-plugin-import";

const here = path.dirname(fileURLToPath(import.meta.url));
const base = path.join(here, process.argv[2] || "");

const compat = new FlatCompat({
baseDirectory: base,
recommendedConfig: js.configs.recommended,
});

export default [
{
ignores: ["dist", "eslint.config.js"],
},
...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
),
{
files: ["**/*.{ts,tsx,mjs,cjs,js}"],
languageOptions: {
parser,
parserOptions: {
project: path.resolve(base, "tsconfig.json"),
tsconfigRootDir: base,
sourceType: "module",
ecmaVersion: "latest",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
import: importPlugin,
},
settings: {
"import/resolver": {
typescript: {
project: path.resolve(base, "tsconfig.json"),
alwaysTryTypes: true,
resolveFullPaths: true,
},
},
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^\\$|_",
argsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"no-empty": "off",
},
},
];
Loading