# Embedded Wallet JS SDK

The Embedded Wallet JS SDK allows you to integrate wallet functionalities into your application seamlessly.

## Installation

To install the SDK, use npm or yarn:

```bash
npm install @fireblocks/embedded-wallet-js-sdk
```

or

```bash
yarn add @fireblocks/embedded-wallet-js-sdk
```

## Usage

### Importing the SDK

First, import the SDK into your project:

```javascript
import { EmbeddedWallet } from "@fireblocks/embedded-wallet-sdk";
```

### Initializing the Wallet

Initialize the wallet with your configuration:

```javascript
const ew = new EmbeddedWallet({
	env: "production",
	authClientId: process.env.AUTH_CLIENT_ID,
	authTokenRetriever: {
		getAuthToken: () => authManager.getAccessToken(),
	},
});
```

### Creating New Account

```javascript
const { accountId } = await ew.createAccount();
```

### Adding New Asset

To add a new asset

```javascript
const { address } = await ew.addAsset(accountId, "BTC");
```

### Making a Transaction

To make a transaction:

```javascript
import { getFireblocksNCWInstance } from "@fireblocks/ncw-js-sdk";

const { id } = await ew.createTransaction({
	assetId: "BTC",
	source: {
		id: "0",
	},
	destination: {
		type: "VAULT_ACCOUNT",
		id: "0",
	},
	amount: "8",
});

const core = getFireblocksNCWInstance(deviceId);
await core.signTransaction(id);
```
