Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@mysten/kiosk
Advanced tools
This package is still in active development. Use at your own risk. Currently, the only supported environment is Sui Testnet.
This Kiosk SDK library provides different utilities to interact/create/manage a Kiosk.
To install, add @mysten/kiosk
package to your project
npm i @mysten/kiosk
You can also use your preferred package manager, such as yarn or pnpm.
Here are some indicative examples on how to use the kiosk SDK.
import { fetchKiosk } from '@mysten/kiosk';
import { Connection, JsonRpcProvider } from '@mysten/sui.js';
const provider = new JsonRpcProvider(
new Connection({ fullnode: 'https://fullnode.testnet.sui.io:443' }),
);
const getKiosk = async () => {
const kioskAddress = `0xSomeKioskAddress`;
const {
data: res,
nextCursor,
hasNextPage,
} = await fetchKiosk(provider, kioskAddress, { limit: 100 }); // could also add `cursor` for pagination
console.log(res); // { listings: [], items: [], itemIds: [], listingIds: [] }
console.log(nextCursor); // null
console.log(hasNextPage); // false
};
import { createKioskAndShare } from '@mysten/kiosk';
import { TransactionBlock } from '@mysten/sui.js';
const createKiosk = async () => {
const accountAddress = '0xSomeSuiAddress';
const tx = new TransactionBlock();
const kiosk_cap = createKioskAndShare(tx);
tx.transferObjects([kiosk_cap], tx.pure(accountAddress, 'address'));
// ... continue to sign and execute the transaction
// ...
};
import { placeAndList } from '@mysten/kiosk';
import { TransactionBlock } from '@mysten/sui.js';
const placeAndListToKiosk = async () => {
const kiosk = 'SomeKioskId';
const kioskCap = 'KioskCapObjectId';
const itemType = '0xItemAddr::some:ItemType';
const item = 'SomeItemId';
const price = '100000';
const tx = new TransactionBlock();
placeAndList(tx, itemType, kiosk, kioskCap, item, price);
// ... continue to sign and execute the transaction
// ...
};
import { withdrawFromKiosk } from '@mysten/kiosk';
import { TransactionBlock } from '@mysten/sui.js';
const withdraw = async () => {
const kiosk = 'SomeKioskId';
const kioskCap = 'KioskCapObjectId';
const amount = '100000';
const tx = new TransactionBlock();
withdrawFromKiosk(tx, kiosk, kioskCap, amount);
// ... continue to sign and execute the transaction
// ...
};
FAQs
Sui Kiosk library
We found that @mysten/kiosk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.