https://github.com/soundworklabs/soundwork-sdk
TS SDK to interact with soundwork programs
https://github.com/soundworklabs/soundwork-sdk
sdk solana typescript
Last synced: 10 months ago
JSON representation
TS SDK to interact with soundwork programs
- Host: GitHub
- URL: https://github.com/soundworklabs/soundwork-sdk
- Owner: SoundWorkLabs
- Created: 2023-10-17T15:50:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T13:10:10.000Z (almost 2 years ago)
- Last Synced: 2025-08-01T13:12:54.974Z (11 months ago)
- Topics: sdk, solana, typescript
- Language: TypeScript
- Homepage: https://soundwork.io/
- Size: 115 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Soundwork SDK
## Table of Contents
- [Installation](#getting-started)
- [Examples](#examples)
- [Contributing](#contributing)
## Getting Started
```bash
# 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](./tests/) for both bid and list programs.
## List Program
```ts
// 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
```ts
// 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.