0.0.11 • Published 5 months ago

@jimii/soundwork-sdk v0.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

Soundwork SDK

Table of Contents

Getting Started

# yarn
yarn add @jimii/soundwork-sdk
# npm
npm install @jimii/soundwork-sdk
# pnpm
pnpm install @jimii/soundwork-sdk

Examples

Check out the extensive list of methods you can call in the tests directory for both bid and list programs.

List Program

// import the SDK
import { SoundworkListSDK } from "@jimii/soundwork-sdk";

// Initialize the list program SDK
let listSDK = new SoundworkListSDK(provider, connection);

// list an NFT
let ix = await listSDK.createListing(nftMint, 1);
let tx = new Transaction().add(ix);

await sendAndConfirmTransaction(provider.connection, tx, [userKeypair]);

Bid Program

// import the SDK
import { SoundworkBidSDK } from "@jimii/soundwork-sdk";

// Initialize the list program SDK
let bidSDK = new SoundworkBidSDK(provider, connection);

// Place a bid for an NFT
let now = new Date();
let expire_ts = now.setFullYear(now.getFullYear() + 1); // ! should default to a year

let ix = await bidSDK.placeBid(
	nftMint,
	new BN(1 * LAMPORTS_PER_SOL),
	new BN(expire_ts)
);
let tx = new Transaction().add(ix);

await sendAndConfirmTransaction(provider.connection, tx, [
	buyerKeypair,
]);

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

0.0.11

5 months ago

0.0.10

5 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago