# @okxweb3/coin-stacks

> A stacks SDK for building Web3 wallets and applications.

Latest version **2.4.10** (published 2026-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @okxweb3/coin-stacks
pnpm add @okxweb3/coin-stacks
yarn add @okxweb3/coin-stacks
bun add @okxweb3/coin-stacks
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.4.10 |
| Published | 2026-06-03 |
| First published | 2023-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 385 |
| Author | okx |
| Maintainers | xiao.xu, moxixii, martynyan, toringona, linus.wang, debuggor, jjay98, shisilu, npm-okx |
| Keywords | stacks, wallet, web3, crypto, blockchain, sdk, transaction, signing, address, private-key |

## Links

- npm: https://www.npmjs.com/package/@okxweb3/coin-stacks
- Repository: https://github.com/okx/js-wallet-sdk
- Homepage: https://github.com/okx/js-wallet-sdk#readme
- Issues: https://github.com/okx/js-wallet-sdk/issues
- npm.io page: https://npm.io/package/@okxweb3/coin-stacks

## Dependencies (2)

- [@okxweb3/coin-base](https://npm.io/package/@okxweb3/coin-base.md) ^2.0.7
- [@okxweb3/crypto-lib](https://npm.io/package/@okxweb3/crypto-lib.md) 2.0.6

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 2.4.10 (latest) — 2026-06-03
- 2.4.0-beta.0 (beta) — 2025-09-30
- 2.4.9 — 2026-01-05
- 2.4.0 — 2025-10-09
- 1.1.0 — 2025-01-15
- 1.0.6-beta.20 — 2024-12-30
- 1.0.6-beta.10 — 2024-12-23
- 1.0.6-beta.6 — 2024-12-19
- 1.0.6-beta.5 — 2024-12-17
- 1.0.6-beta.4 — 2024-12-16
- 1.0.7 — 2024-11-18
- 1.0.6 — 2024-10-22
- 1.0.5 — 2024-09-04
- 1.0.4 — 2024-08-21
- 1.0.3 — 2024-08-06
- … 4 more at https://npm.io/package/@okxweb3/coin-stacks/versions

## README

# @okxweb3/coin-stacks
Stacks SDK is used to interact with the Stacks blockchain, it contains various functions can be used to web3 wallet.

## Installation

### Npm

To obtain the latest version, simply require the project using npm :

```shell
npm install @okxweb3/coin-stacks
```

## Usage

### Generate private key

```typescript
import {StxWallet} from "@okxweb3/coin-stacks";

let wallet = new StxWallet()
// private key
let privateKey = await wallet.getRandomPrivateKey();

// address
let params: NewAddressParams = {
    privateKey: privateKey
};
let address = await wallet.getNewAddress(params);
```

### Private key derivation

```typescript
import {StxWallet} from "@okxweb3/coin-stacks";

let wallet = new StxWallet()
let param = {
    mnemonic: `gaze supreme human audit aisle entry galaxy shy lock time such auto`,
    hdPath: "m/44'/5757'/0'/0/0"
};
let privateKey = await wallet.getDerivedPrivateKey(param);
```

### Generate address

```typescript
import {StxWallet} from "@okxweb3/coin-stacks";

let wallet = new StxWallet()
let params: NewAddressParams = {
     privateKey: "33c4ad314d494632a36c27f9ac819e8d2986c0e26ad63052879f631a417c8adf"
};
let address = await wallet.getNewAddress(params);
```

### Verify address
```typescript
import {StxWallet} from "@okxweb3/coin-stacks";

let wallet = new StxWallet()
let param = {
    address: "SP1BJMEXW9J908SGBCNWQXKCHRGC4H4YYAE0EAVDW"
} 
const ok = await wallet.validAddress(param)
```

### Transfer Stx
```typescript
import {StxWallet} from "@okxweb3/coin-stacks";

let wallet = new StxWallet()
const secretKey = '//your private key';
const to = 'SP2P58SJY1XH6GX4W3YGEPZ2058DD3JHBPJ8W843Q';
const amount = 3000;
const memo = '20';
const nonce = 56;
const fee = 300;
let params: SignTxParams = {
    privateKey: secretKey,
    data: {
        type: 'transfer',
        data: {
            to: to,
            amount: amount,
            memo: memo,
            nonce: nonce,
            fee: fee,
        }
    },
}
const tx = await wallet.signTransaction(params);
```

### Transfer token
```typescript
import {StxWallet} from "@okxweb3/coin-stacks";

let wallet = new StxWallet()
const key = "33c4ad314d494632a36c27f9ac819e8d2986c0e26ad63052879f631a417c8adf";
const from = "SP2XYBM8MD5T50WAMQ86E8HKR85BAEKBECNE1HHVY";
const to = "SP3HXJJMJQ06GNAZ8XWDN1QM48JEDC6PP6W3YZPZJ";
const memo = "110317";
const contract = "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27";
const contract_name = "miamicoin-token";
const function_name = "transfer";
const token_name = "miamicoin";

const amount = 21;
const nonce = 21;
const fee = 200000;
let params: SignTxParams = {
    privateKey: key,
    data: {
        type: 'tokenTransfer',
        data: {
            from: from,
            to: to,
            memo: memo,
            contract: contract,
            contractName: contract_name,
            functionName: function_name,
            tokenName: token_name,
            amount: amount,
            nonce: nonce,
            fee: fee
        }
    }
}
const tx = await wallet.signTransaction(, params);
```

### Sign message
```typescript
import {StxWallet} from "@okxweb3/coin-stacks";

let wallet = new StxWallet()
const privateKey = "bcf62fdd286f9b30b2c289cce3189dbf3b502dcd955b2dc4f67d18d77f3e73c7"
const param: SignTxParams = {
    privateKey: privateKey,
    data: {
        type: "signMessage",
        message: "Hello World"
    }
}
const sig = await wallet.signMessage(param);
```


## License
Current package is [MIT](<https://github.com/okx/js-wallet-sdk/blob/main/LICENSE>) licensed.

---
_Source: https://npm.io/package/@okxweb3/coin-stacks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
