# aux-ts

> ## Quickstart

Latest version **0.1.0** (published 2022-11-15) · 0 weekly downloads

## Install

```sh
npm install aux-ts
pnpm add aux-ts
yarn add aux-ts
bun add aux-ts
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-11-15 |
| First published | 2022-11-15 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 25 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | East Rock Labs |
| Maintainers | lidatong |

## Links

- npm: https://www.npmjs.com/package/aux-ts
- npm.io page: https://npm.io/package/aux-ts

## Dependencies (25)

- [ws](https://npm.io/package/ws.md) ^8.9.0
- [cors](https://npm.io/package/cors.md) ^2.8.5
- [yaml](https://npm.io/package/yaml.md) ^2.1.1
- [aptos](https://npm.io/package/aptos.md) 1.3.16
- [axios](https://npm.io/package/axios.md) ^1.1.3
- [bn.js](https://npm.io/package/bn.js.md) ^5.2.1
- [redis](https://npm.io/package/redis.md) ^4.3.1
- [tslog](https://npm.io/package/tslog.md) ^3.3.4
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [express](https://npm.io/package/express.md) ^4.18.1
- [graphql](https://npm.io/package/graphql.md) ^16.6.0
- [js-sha3](https://npm.io/package/js-sha3.md) ^0.8.0
- [graphql-ws](https://npm.io/package/graphql-ws.md) ^5.11.0
- [@apollo/client](https://npm.io/package/@apollo/client.md) ^3.7.0
- [@solana/web3.js](https://npm.io/package/@solana/web3.js.md) ^1.66.1
- [graphql-scalars](https://npm.io/package/graphql-scalars.md) ^1.19.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [apollo-server-core](https://npm.io/package/apollo-server-core.md) ^3.10.2
- [@pythnetwork/client](https://npm.io/package/@pythnetwork/client.md) ^2.8.0
- [@graphql-tools/schema](https://npm.io/package/@graphql-tools/schema.md) ^9.0.4
- [apollo-server-express](https://npm.io/package/apollo-server-express.md) ^3.10.2
- [graphql-subscriptions](https://npm.io/package/graphql-subscriptions.md) ^2.0.0
- [@graphql-tools/load-files](https://npm.io/package/@graphql-tools/load-files.md) ^6.6.1
- [graphql-redis-subscriptions](https://npm.io/package/graphql-redis-subscriptions.md) ^2.5.0

## Recent versions

- 0.1.0 (latest) — 2022-11-15

## README

# aux-ts

## Quickstart

```typescript
import { AptosClient, FaucetClient } from "aptos";
import { AuxClient } from "../src/client";
import { USDC_ETH_WH } from "../src/coin";

const auxClient = new AuxClient("mainnet", new AptosClient("https://fullnode.mainnet.aptoslabs.com"))

const poolClient = auxClient.pool({
  coinTypeX: "0x1::aptos_coin::AptosCoin",
  coinTypeY: USDC_ETH_WH,
});
let pool = poolClient.query();
await poolClient.swap({
    coinTypeIn: auxCoin,
    exactAmountIn: DU(2),
    parameters: { slippage: new Bps(50) },
});
pool = poolClient.query();
```


## Walkthrough

Let's breakdown the walkthrough above and showcase some additional features.

```typescript
import { AptosClient, FaucetClient } from "aptos";

const auxClient = new AuxClient("mainnet", new AptosClient("https://fullnode.devnet."))

// You can optionally attach a faucet client. We use devnet because there is no faucet on mainnet.
const auxClient = new AuxClient("devnet", new AptosClient("https://"))

// Initialize your account (only needed if sending txs).
const sender = AptosAccount.fromAptosAccountObject({privateKeyHex: "0xAUXUSER"})

// Set the sender for all future txs to this account. Note you can override this for individual txs
// by passing in `options` or you can set the sender to something else.
auxClient.sender = sender

// Simulate the transaction.
auxClient.simulate = true;

// Change the account you use to simulate transactions. Note, AUX has a default simulator on every
// network, but it will not have coin balances, etc. so you should set this to your own account.
auxClient.simulator = {
   address: "0xAUXSIMULATOR,
   publicKey: new TxnBuilderTypes.Ed25519PublicKey(new HexString("0x...").toUint8Array()) // Ed2551
}

// AuxClientOptions has additional options such as max gas, etc.

// Create a pool client
const poolClient = auxClient.pool({
  coinTypeX: "0x1::aptos_coin::AptosCoin",
  coinTypeY: USDC_ETH_WH,
});

// Alternatively
const poolClient = new PoolClient(auxClient, {
  coinTypeX: "0x1::aptos_coin::AptosCoin",
  coinTypeY: USDC_ETH_WH,
})
```

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