5.3.0 • Published 3 years ago
@hydraprotocol/sdk v5.3.0
Hydraprotocol Javascript SDK
Overview
A Javascript SDK for inteacting with Hydra Protocol.
Important links:
Disclaimer
This is experimental software all APIs are subject to change.
Installation
Install via your favourite npm client*:
yarn add --dev @hydraprotocol/sdk
* Coming soon!
Basic Usage
import { HydraSDK, Network } from "@hydraprotocol/sdk";
import { Wallet } from "@project-serum/anchor";
import { Connection } from "@solana/web3.js";
import { loadKeypair } from "./helpers";
// Setup configuration
const keypair = loadKeypair("./path/to/keypair");
const wallet = new Wallet(keypair);
const connection = new Connection("https://api.devnet.solana.com");
// Create the client
const hydra = HydraSDK.create(Network.DEVNET, connection, wallet);
// Call a contract method
const txHash = await hydra.liquidityPools.addLiquidity(
tokenXMint,
tokenYMint,
poolId,
tokenXAmount,
tokenYAmount,
slippage
);
console.log(`Your transaction hash: ${txHash}`);
5.5.2
3 years ago
5.5.1
3 years ago
5.5.0
3 years ago
5.4.0
3 years ago
5.3.1
3 years ago
5.3.0
3 years ago
5.2.6
3 years ago
5.2.5
3 years ago
5.2.4
3 years ago
4.1.3
3 years ago
5.2.2
3 years ago
5.2.1
3 years ago
5.2.0
3 years ago
5.1.0
3 years ago
5.0.3
3 years ago
1.4.1
3 years ago
1.1.2
3 years ago
1.1.1
3 years ago
5.0.2
3 years ago
1.0.0
3 years ago