0.0.1-76b25b3.0 • Published 2 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
initializePair
Initialize a pairdeposit
/withdraw
manage the lamports stored in the pair authority of a pair your owndepositNft
/withdrawNft
manage the NFTs in a pair you ownswapNftForToken
Sell a NFT to a pair for SOLswapTokenForNft
Buy 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
2 years ago
0.0.1-99718b.0
2 years ago
0.0.1-76b25b3.0
2 years ago
0.0.1-b9da21.0
2 years ago
0.0.1-3b9da21.1
2 years ago
0.0.1-5581701.0
2 years ago
0.0.1-1f24ad.0
2 years ago
0.0.1-c9ef431.3
2 years ago
0.0.1-c9ef431.2
2 years ago
0.0.1-c9ef431.1
2 years ago
0.0.1-c9ef431.0
2 years ago
0.0.1-67c5bf36.3
2 years ago
0.0.1-67c5bf36.2
2 years ago
0.0.1-67c5bf36.1
2 years ago
0.0.1-67c5bf36
2 years ago