# @sifi/sdk

> 🛸 SDK for integrating with Sifi.org

Latest version **1.12.0** (published 2024-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sifi/sdk
pnpm add @sifi/sdk
yarn add @sifi/sdk
bun add @sifi/sdk
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.12.0 |
| Published | 2024-01-13 |
| First published | 2023-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 127.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Maintainers | agent_mcallister, bill2a, boriskubrik, ntx03, abrkn |
| Keywords | sifi, sifi.org, ethereum, swap |

## Links

- npm: https://www.npmjs.com/package/@sifi/sdk
- Repository: https://github.com/sifiorg/sifi
- Homepage: https://github.com/sifiorg/sifi#readme
- Issues: https://github.com/sifiorg/sifi/issues
- npm.io page: https://npm.io/package/@sifi/sdk

## Recent versions

- 1.12.0 (latest) — 2024-01-13
- 1.11.0 — 2023-11-09
- 1.10.0 — 2023-10-09
- 1.9.0 — 2023-09-26
- 1.8.0 — 2023-09-20
- 1.7.0 — 2023-09-13
- 1.6.0 — 2023-08-29
- 1.5.0 — 2023-08-18
- 1.4.0 — 2023-08-15
- 1.2.0 — 2023-08-11
- 1.1.0 — 2023-08-10
- 1.0.0 — 2023-08-09

## README

# Sifi.org SDK

SDK for integrating with Sifi.org 🛸

## Install

```bash
npm install @sifi/sdk
```

## Usage

```typescript
import { Sifi } from '@sifi/sdk';

// Get a quote to swap 100 USDC to WETH
const quote = await sifi.getQuote({
  fromToken: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  toToken: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
  fromAmount: '100000000',
});

// TODO: Approve `quote.approveAddress` to send `quote.fromAmount` of `quote.fromToken`

const swap = await sifi.getSwap({
  fromAddress: '0xyourwalletaddress',
  quote,
});

const tx = {
  from: swap.tx.from,
  to: swap.tx.to,
  value: swap.tx.value, // When swapping from ETH
  data: swap.tx.data,
  chainId: swap.tx.chainId,
  gasLimit: swap.tx.gasLimit,
};

const res = await sendTransaction(tx);
```

## Notes

For swaps to/from ETH, use the address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`

## License

MIT

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