0.19.2 • Published 4 months ago

@quartz-labs/sdk v0.19.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Typescript SDK for interacting with the Quartz Protocol.

Install using:

yarn add @quartz-labs/sdk
# or
npm install @quartz-labs/sdk

There is currently an issue with dependancy resolutions, so add the following to your package.json to fix:

"resolutions": {
  "rpc-websockets": "9.0.4",
  "@solana/web3.js": "1.98.0"
}

If you want to use this SDK in a front-end, note that some Node modules don't work in the browser. Because of this, you'll normally want to import the SDK in your client side code like this:

import * from "@quartz-labs/sdk/browser";

Server-side code can still be imported without the /browser path at the end, but you may need to set up your config so your web app doesn't try to bundle the problematic Node modules with the and client side code.

Basic setup

Create a Quartz Client with:

import { QuartzClient } from "@quartz-labs/sdk";
import { Connection } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const client = QuartzClient.fetchClient(connection);

The majority of this SDK can then be accessed through the client, eg:

import { LAMPORTS_PER_SOL } from "@solana/web3.js";

const depositApy = client.getDepositRate(marketIndex);
const createAccountInstructions = client.makeInitQuartzUserIxs(address);

const user = client.getQuartzAccount(address);
const health = user.getHealth();
const stablecoinBalances = user.getMultipleTokenBalances(stablecoinIndices);
const depositInstructions = user.makeDepositIx(
  LAMPORTS_PER_SOL,
  marketIndexSol,
  true // true = can change position from loan <-> collateral, false = will limit amount deposited to prevent this
);

Links

Website and waitlist: quartzpay.io

Docs: docs.quartzpay.io

X: @quartzpay

Contact: iarla@quartzpay.io

0.19.2

4 months ago

0.19.1

5 months ago

0.19.0

5 months ago

0.18.3

6 months ago

0.18.2

6 months ago

0.18.1

6 months ago

0.18.0

6 months ago

0.17.0

6 months ago

0.16.12

6 months ago

0.16.11

6 months ago

0.16.10

6 months ago

0.16.9

6 months ago

0.16.8

6 months ago

0.16.7

6 months ago

0.16.6

6 months ago

0.16.5

6 months ago

0.16.4

6 months ago

0.16.3

6 months ago

0.16.2

6 months ago

0.16.1

6 months ago

0.16.0

6 months ago

0.15.2

6 months ago

0.15.1

6 months ago

0.15.0

6 months ago

0.14.2

6 months ago

0.14.1

6 months ago

0.14.0

6 months ago

0.13.8

7 months ago

0.13.7

7 months ago

0.13.6

7 months ago

0.13.5

7 months ago

0.13.4

7 months ago

0.13.3

7 months ago

0.13.2

7 months ago

0.13.1

7 months ago

0.13.0

7 months ago

0.12.9

7 months ago

0.12.8

7 months ago

0.12.7

7 months ago

0.12.6

7 months ago

0.12.5

7 months ago

0.12.4

7 months ago

0.12.3

7 months ago

0.12.2

7 months ago

0.12.1

7 months ago

0.12.0

7 months ago

0.11.2

7 months ago

0.11.1

7 months ago

0.11.0

7 months ago

0.10.2

7 months ago

0.10.1

7 months ago

0.10.0

8 months ago

0.9.6

8 months ago

0.9.5

8 months ago

0.9.4

8 months ago

0.9.3

8 months ago

0.9.2

8 months ago

0.9.1

8 months ago

0.9.0

8 months ago

0.8.2

8 months ago

0.8.1

8 months ago

0.8.0

8 months ago

0.7.1

8 months ago

0.7.0

8 months ago

0.6.5

8 months ago

0.6.4-beta

8 months ago

0.6.4

8 months ago

0.6.3

8 months ago

0.6.2

8 months ago

0.6.1

8 months ago

0.6.0

8 months ago

0.5.0

8 months ago

0.4.3

9 months ago

0.4.2

9 months ago

0.4.1

9 months ago

0.4.0

9 months ago

0.3.8

9 months ago

0.3.7

9 months ago

0.3.6

9 months ago

0.3.5

9 months ago

0.3.4

9 months ago

0.3.3

10 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.3.0

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago