0.0.22 • Published 11 months ago

@soundwork-oss/soundwork-sdk v0.0.22

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Soundwork SDK

Table of Contents

Getting Started

# yarn
yarn add @soundwork-oss/soundwork-sdk
# npm
npm install @soundwork-oss/soundwork-sdk
# pnpm
pnpm install @soundwork-oss/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 "@soundwork-oss/soundwork-sdk";

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

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

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

Bid Program

// import the SDK
import { SoundworkBidSDK } from "@soundwork-oss/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.20

11 months ago

0.0.21

11 months ago

0.0.22

11 months ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

12 months ago

0.0.18

12 months ago

0.0.19

12 months ago

0.0.14

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.11

2 years ago