0.0.1-76b25b3.0 • Published 3 years ago
@raccoonsdev/goatswap-sdk v0.0.1-76b25b3.0
@raccoonsdev/goatswap-sdk
Use createReadonlyProgram or createProgram to get an anchor Program<Goatswap> to interact with the Goatswap program.
import { createProgram } from '@raccoonsdev/goatswap-sdk';
import { NodeWallet } from '@project-serum/anchor';
// ... Load your @solana/web3.js keypair
const nodeWallet = new NodeWallet(keypair);
const provider = new AnchorProvider(connection, anchorWallet, {});
const program = createProgram(anchorProvider);Program methods
- initializePairInitialize a pair
- deposit/- withdrawmanage the lamports stored in the pair authority of a pair your own
- depositNft/- withdrawNftmanage the NFTs in a pair you own
- swapNftForTokenSell a NFT to a pair for SOL
- swapTokenForNftBuy a NFT from a pair for SOL
Helpers
getPairMetasForCollection uses getProgramAccounts to find all the pairs for a given collection and fetches all the associated pair lamports and NFTs
pairMetasIntoOrderBooks Transform the pairs given their available liquidities into Asks and Bids orders, to allow order book like visualization
0.0.1-b094681.1
3 years ago
0.0.1-99718b.0
3 years ago
0.0.1-76b25b3.0
3 years ago
0.0.1-b9da21.0
3 years ago
0.0.1-3b9da21.1
3 years ago
0.0.1-5581701.0
3 years ago
0.0.1-1f24ad.0
3 years ago
0.0.1-c9ef431.3
3 years ago
0.0.1-c9ef431.2
3 years ago
0.0.1-c9ef431.1
3 years ago
0.0.1-c9ef431.0
3 years ago
0.0.1-67c5bf36.3
3 years ago
0.0.1-67c5bf36.2
3 years ago
0.0.1-67c5bf36.1
3 years ago
0.0.1-67c5bf36
3 years ago