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
9 changes: 9 additions & 0 deletions .changeset/sharp-seas-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@sei-js/create-sei": patch
"@sei-js/ledger": patch
"@sei-js/mcp-server": patch
"@sei-js/precompiles": patch
"@sei-js/sei-global-wallet": patch
---

Update README files in NPM
41 changes: 16 additions & 25 deletions packages/create-sei/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
# Create Sei App
<div align="center">

This repository contains various templates for kick-starting a Sei application out of the box, as well as a CLI (Command Line Interface) tool that can be used to create projects using the given templates.
# @sei-js/create-sei

You can use either:
- Next.js
- Vite.js
[![npm version](https://badge.fury.io/js/@sei-js%2Fcreate-sei.svg)](https://badge.fury.io/js/@sei-js%2Fcreate-sei)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Sei Network](https://img.shields.io/badge/Sei-Network-red)](https://sei.io)

to scaffold your project.
**Scaffold new Sei applications with pre-configured templates and tooling**

## Scaffold your project
Simply run `npx @sei-js/create-sei app` to run the setup wizard and choose the template you want to use.
[Documentation](https://sei-js.docs.sei.io/create-sei/welcome) • [GitHub](https://github.com/sei-protocol/sei-js) • [NPM](https://www.npmjs.com/package/@sei-js/create-sei) • [Telegram](https://t.me/+LPW_1djQwRQwMzlk)

## EVM Applications (Recommended)
Building on our EVM (Ethereum Virtual Machine) is the easiest way to get your dApp kick-started on Sei! The mature EVM ecosystem provides many tools out of the box to help developers build faster, including deploying smart contracts and other helpful connection libraries.
</div>

This tool will offer multiple variants of EVM tooling, including
- [Wagmi](https://wagmi.sh/core/getting-started) ([Viem](https://viem.sh/)): Recommended
- [Ethers](https://docs.ethers.org/v6/)
## 🚀 Quick Start

Both variants use [@sei-js/evm](https://sei-protocol.github.io/sei-js/modules/evm.html)
```bash
npx @sei-js/create-sei app -n my-sei-app
```

If you are new to Web3 development, we recommend using Wagmi since it provides helpful hooks out of the box.
## 📚 Documentation

## Cosmos Applications
Cosmos based Sei Applications interact with the CosmWasm VM on the chain. Use this if you are a seasoned CosmWasm developer, or if you intend to interact with CosmWasm Smart Contracts, as well as other chains in the Cosmos ecosystem.
For complete documentation, examples, and guides, visit:
**[sei-js.docs.sei.io/create-sei](https://sei-js.docs.sei.io/create-sei/welcome)**

If you think your app might require interaction with native Cosmos modules, you should check the list of [precompiles](https://www.docs.sei.io/dev-interoperability/precompiles/addr) to determine if the same support can be offered by the EVM.

Cosmos Applications use
- [CosmosKit](https://hyperweb.io/stack/cosmos-kit)
- [@sei-js/cosmjs](https://sei-protocol.github.io/sei-js/modules/cosmjs.html)
- [Cosmjs](https://github.com/cosmos/cosmjs)

## Contributing
We love contributions from the amazing Sei community! If you have a dApp template to contribute, do make a Pull Request into the [sei-js](https://github.com/sei-protocol/sei-js) repository.
154 changes: 15 additions & 139 deletions packages/ledger/README.md
Original file line number Diff line number Diff line change
@@ -1,151 +1,27 @@
# @sei-js/ledger

## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [createTransportAndApp](#createtransportandapp)
- [Parameters](#createTransportAndApp-parameters)
- [getAddresses](#getaddresses)
- [Parameters](#getAddresses-parameters)
- [SeiLedgerOfflineAminoSigner](#seiledgerofflineaminosigner)
- [Constructor](#SeiLedgerOfflineAminoSigner-constructor)
- [getAccounts](#SeiLedgerOfflineAminoSigner-getAccounts)
- [signAmino](#SeiLedgerOfflineAminoSigner-signAmino)
- [removeLeadingZeros](#removeleadingzeros)
- [Parameters](#removeLeadingZeros-parameters)

## Installation
```bash
yarn add @sei-js/ledger
```

## Example Usage
```typescript
import {
coins,
SigningStargateClient,
StdFee
} from "@cosmjs/stargate";

import {
createTransportAndApp,
getAddresses,
SeiLedgerOfflineAminoSigner
} from "@sei-js/ledger";

const testApp = async () => {
const validatorAddress = "seivaloper1sq7x0r2mf3gvwr2l9amtlye0yd3c6dqa4th95v";
const rpcUrl = "https://rpc-testnet.sei-apis.com/";
const memo = "Delegation";
const path = "m/44'/60'/0'/0/0";

const {app} = await createTransportAndApp();
const {nativeAddress} = await getAddresses(app, path);
const ledgerSigner = new SeiLedgerOfflineAminoSigner(app, path)
const signingStargateClient = await SigningStargateClient.connectWithSigner(rpcUrl, ledgerSigner)

const msgDelegate = {
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: {
delegatorAddress: nativeAddress.address,
validatorAddress: validatorAddress,
amount: coins(500, "usei"),
},
};

const fee: StdFee = {
amount: [{denom: "usei", amount: "20000"}],
gas: "200000",
};

const result = await signingStargateClient.signAndBroadcast(nativeAddress.address, [msgDelegate], fee, memo)
console.log("Broadcast result:", result);
};

testApp();
```


## createTransportAndApp

### Parameters:
- None.

### Returns:
- `Promise<{transport: Transport, app: SeiApp}>`: A promise that resolves to an object containing the `transport` and `app` instances.
<div align="center">

### Usage:
```typescript
import { createTransportAndApp } from '@sei-js/ledger';

const { transport, app } = await createTransportAndApp();
console.log(transport, app);
```

## getAddresses

### Parameters:
- `app` (`SeiApp`): An instance of the Ledger Sei app.
- `path` (`string`): The HD derivation path (e.g., `"m/44'/60'/0'/0/0"`).

### Returns:
- `Promise<{evmAddress: string, nativeAddress: string}>`: A promise that resolves to an object containing the EVM and Cosmos addresses.

### Usage:
```typescript
import { getAddresses } from '@sei-js/ledger';

const { evmAddress, nativeAddress } = await getAddresses(app, "m/44'/60'/0'/0/0");
console.log(evmAddress, nativeAddress);
```

## SeiLedgerOfflineAminoSigner

### Constructor

```typescript
new SeiLedgerOfflineAminoSigner(app: SeiApp, path: string)
```
# @sei-js/ledger

#### Parameters:
- `app` (`SeiApp`): An instance of the Ledger Sei app.
- `path` (`string`): The HD derivation path (e.g., `"m/44'/60'/0'/0/0"`).
[![npm version](https://badge.fury.io/js/@sei-js%2Fledger.svg)](https://badge.fury.io/js/@sei-js%2Fledger)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Sei Network](https://img.shields.io/badge/Sei-Network-red)](https://sei.io)

#### Usage:
```typescript
import { SeiLedgerOfflineAminoSigner } from '@sei-js/ledger';
**Hardware wallet integration for secure transaction signing**

const ledgerSigner = new SeiLedgerOfflineAminoSigner(app, "m/44'/60'/0'/0/0");
```
[Documentation](https://sei-js.docs.sei.io/ledger/introduction) • [GitHub](https://github.com/sei-protocol/sei-js) • [NPM](https://www.npmjs.com/package/@sei-js/ledger) • [Telegram](https://t.me/+LPW_1djQwRQwMzlk)

### getAccounts
</div>

#### Returns:
- `Promise<readonly AccountData[]>`: A promise that resolves to an array of `AccountData` objects containing the address and public key.
## 🚀 Quick Start

#### Usage:
```typescript
import { SeiLedgerOfflineAminoSigner } from '@sei-js/ledger';

const accounts = await ledgerSigner.getAccounts();
console.log(accounts); // { address: 'sei1...', pubkey: { type: 'tendermint/PubKeySecp256k1', value: '...' } }
```bash
npm install @sei-js/ledger
```

### signAmino
## 📚 Documentation

#### Parameters:
- `_signerAddress` (`string`): The address of the signer (unused in this method).
- `signDoc` (`StdSignDoc`): The sign document to be signed.
For complete documentation, examples, and guides, visit:
**[sei-js.docs.sei.io/ledger](https://sei-js.docs.sei.io/ledger/introduction)**

#### Returns:
- `Promise<AminoSignResponse>`: A promise that resolves to an object containing the signed document and the signature.

#### Usage:
```typescript
import { SeiLedgerOfflineAminoSigner } from '@sei-js/ledger';
import { StdSignDoc } from '@cosmjs/amino';

const signDoc: StdSignDoc = { /* your StdSignDoc object */ };
const signResponse = await ledgerSigner.signAmino('sei123...', signDoc);
console.log(signResponse.signed, signResponse.signature);
```
Loading