New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mysten/kiosk

Package Overview
Dependencies
Maintainers
4
Versions
362
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mysten/kiosk - npm Package Compare versions

Comparing version 0.0.0-experimental-20230721193149 to 0.0.0-experimental-20230721193246

5

CHANGELOG.md
# @mysten/kiosk
## 0.0.0-experimental-20230721193149
## 0.0.0-experimental-20230721193246

@@ -18,6 +18,7 @@ ### Minor Changes

- Updated dependencies [0f06d593a]
- Updated dependencies [83d0fb734]
- Updated dependencies [09f4ed3fc]
- Updated dependencies [6d41059c7]
- Updated dependencies [001148443]
- @mysten/sui.js@0.0.0-experimental-20230721193149
- @mysten/sui.js@0.0.0-experimental-20230721193246

@@ -24,0 +25,0 @@ ## 0.3.3

@@ -1,5 +0,4 @@

import { SuiAddress } from '@mysten/sui.js';
import { FetchKioskOptions, OwnedKiosks, PagedKioskData } from '../types';
import { SuiClient, PaginationArguments } from '@mysten/sui.js/client';
export declare function fetchKiosk(client: SuiClient, kioskId: SuiAddress, pagination: PaginationArguments<string>, options: FetchKioskOptions): Promise<PagedKioskData>;
export declare function fetchKiosk(client: SuiClient, kioskId: string, pagination: PaginationArguments<string>, options: FetchKioskOptions): Promise<PagedKioskData>;
/**

@@ -11,4 +10,4 @@ * A function to fetch all the user's kiosk Caps

*/
export declare function getOwnedKiosks(client: SuiClient, address: SuiAddress, options?: {
export declare function getOwnedKiosks(client: SuiClient, address: string, options?: {
pagination?: PaginationArguments<string>;
}): Promise<OwnedKiosks>;

17

dist/tx/kiosk.d.ts

@@ -1,2 +0,1 @@

import { SuiAddress } from '@mysten/sui.js';
import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions';

@@ -31,3 +30,3 @@ import { ObjectArgument, PurchaseAndResolvePoliciesResponse, PurchaseOptionalParams, RulesEnvironmentParam, TransferPolicy } from '../types';

*/
export declare function take(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: SuiAddress): TransactionArgument;
export declare function take(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: string): TransactionArgument;
/**

@@ -37,3 +36,3 @@ * Call the `kiosk::list<T>(Kiosk, KioskOwnerCap, ID, u64)` function.

*/
export declare function list(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: SuiAddress, price: string | bigint): void;
export declare function list(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: string, price: string | bigint): void;
/**

@@ -43,3 +42,3 @@ * Call the `kiosk::list<T>(Kiosk, KioskOwnerCap, ID, u64)` function.

*/
export declare function delist(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: SuiAddress): void;
export declare function delist(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: string): void;
/**

@@ -54,3 +53,3 @@ * Call the `kiosk::place_and_list<T>(Kiosk, KioskOwnerCap, Item, u64)` function.

*/
export declare function purchase(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, itemId: SuiAddress, payment: ObjectArgument): [TransactionArgument, TransactionArgument];
export declare function purchase(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, itemId: string, payment: ObjectArgument): [TransactionArgument, TransactionArgument];
/**

@@ -65,3 +64,3 @@ * Call the `kiosk::withdraw(Kiosk, KioskOwnerCap, Option<u64>)` function and receive a Coin<SUI>.

*/
export declare function borrow(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: SuiAddress): TransactionArgument;
export declare function borrow(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: string): TransactionArgument;
/**

@@ -71,3 +70,3 @@ * Call the `kiosk::borrow_mut<T>(Kiosk, KioskOwnerCap, ID): &mut T` function.

*/
export declare function borrowMut(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: SuiAddress): TransactionArgument;
export declare function borrowMut(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: string): TransactionArgument;
/**

@@ -79,3 +78,3 @@ * Call the `kiosk::borrow_value<T>(Kiosk, KioskOwnerCap, ID): T` function.

*/
export declare function borrowValue(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: SuiAddress): [TransactionArgument, TransactionArgument];
export declare function borrowValue(tx: TransactionBlock, itemType: string, kiosk: ObjectArgument, kioskCap: ObjectArgument, itemId: string): [TransactionArgument, TransactionArgument];
/**

@@ -95,2 +94,2 @@ * Call the `kiosk::return_value<T>(Kiosk, Item, Borrow)` function.

*/
export declare function purchaseAndResolvePolicies(tx: TransactionBlock, itemType: string, price: string, kiosk: ObjectArgument, itemId: SuiAddress, policy: TransferPolicy, environment: RulesEnvironmentParam, extraParams?: PurchaseOptionalParams): PurchaseAndResolvePoliciesResponse;
export declare function purchaseAndResolvePolicies(tx: TransactionBlock, itemType: string, price: string, kiosk: ObjectArgument, itemId: string, policy: TransferPolicy, environment: RulesEnvironmentParam, extraParams?: PurchaseOptionalParams): PurchaseAndResolvePoliciesResponse;

@@ -1,2 +0,1 @@

import { SuiAddress } from '@mysten/sui.js';
export type Environment = 'mainnet' | 'testnet' | 'devnet' | 'custom';

@@ -6,3 +5,3 @@ /** A Parameter to support environments for rules. */

env: Environment;
address?: SuiAddress;
address?: string;
};

@@ -9,0 +8,0 @@ /** A default Testnet Environment object */

@@ -1,2 +0,2 @@

import { ObjectDigest, ObjectId, ObjectType, PaginatedObjectsResponse } from '@mysten/sui.js';
import { ObjectDigest, ObjectType, PaginatedObjectsResponse } from '@mysten/sui.js';
import { TransactionArgument } from '@mysten/sui.js/transactions';

@@ -60,3 +60,3 @@ import { ObjectArgument } from '.';

/** The ID of the Item */
objectId: ObjectId;
objectId: string;
/**

@@ -70,3 +70,3 @@ * Whether or not there's a `PurchaseCap` issued. `true` means that

/** The ID of the listing */
listingId: ObjectId;
listingId: string;
price?: string;

@@ -80,3 +80,3 @@ };

/** The ID of the Item */
objectId: ObjectId;
objectId: string;
/** The type of the Item */

@@ -94,4 +94,4 @@ type: ObjectType;

items: KioskItem[];
itemIds: ObjectId[];
listingIds: ObjectId[];
itemIds: string[];
listingIds: string[];
kiosk?: Kiosk;

@@ -111,9 +111,9 @@ extensions: any[];

kioskOwnerCaps: KioskOwnerCap[];
kioskIds: ObjectId[];
kioskIds: string[];
} & Omit<PaginatedObjectsResponse, 'data'>;
export type KioskOwnerCap = {
objectId: ObjectId;
kioskId: ObjectId;
objectId: string;
kioskId: string;
digest: ObjectDigest;
version: string;
};

@@ -1,2 +0,2 @@

import { ObjectId, SharedObjectRef, SuiObjectRef, SuiObjectResponse } from '@mysten/sui.js';
import { SharedObjectRef, SuiObjectRef, SuiObjectResponse } from '@mysten/sui.js';
import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions';

@@ -30,3 +30,3 @@ import { type DynamicFieldInfo } from '@mysten/sui.js';

*/
export declare function attachLockedItems(kioskData: KioskData, lockedItemIds: ObjectId[]): void;
export declare function attachLockedItems(kioskData: KioskData, lockedItemIds: string[]): void;
/**

@@ -41,3 +41,3 @@ * A helper to get a rule's environment address.

*/
export declare function getAllDynamicFields(client: SuiClient, parentId: ObjectId, pagination: PaginationArguments<string>): Promise<{
export declare function getAllDynamicFields(client: SuiClient, parentId: string, pagination: PaginationArguments<string>): Promise<{
type: "DynamicField" | "DynamicObject";

@@ -44,0 +44,0 @@ objectType: string;

@@ -5,3 +5,3 @@ {

"description": "Sui Kiosk library",
"version": "0.0.0-experimental-20230721193149",
"version": "0.0.0-experimental-20230721193246",
"license": "Apache-2.0",

@@ -28,3 +28,3 @@ "main": "./dist/index.js",

"dependencies": {
"@mysten/sui.js": "0.0.0-experimental-20230721193149"
"@mysten/sui.js": "0.0.0-experimental-20230721193246"
},

@@ -31,0 +31,0 @@ "devDependencies": {

// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import {
ObjectId,
SuiAddress,
SuiObjectData,
SuiObjectResponse,
getObjectFields,
} from '@mysten/sui.js';
import { SuiObjectData, SuiObjectResponse, getObjectFields } from '@mysten/sui.js';
import { isValidSuiAddress } from '@mysten/sui.js/utils';

@@ -30,3 +24,3 @@ import {

client: SuiClient,
kioskId: SuiAddress,
kioskId: string,
pagination: PaginationArguments<string>,

@@ -42,3 +36,3 @@ options: FetchKioskOptions,

const listings: KioskListing[] = [];
const lockedItemIds: ObjectId[] = [];
const lockedItemIds: string[] = [];

@@ -84,3 +78,3 @@ // extracted kiosk data.

client: SuiClient,
address: SuiAddress,
address: string,
options?: {

@@ -87,0 +81,0 @@ pagination?: PaginationArguments<string>;

// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import { SuiAddress } from '@mysten/sui.js';
import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions';

@@ -100,3 +99,3 @@

kioskCap: ObjectArgument,
itemId: SuiAddress,
itemId: string,
): TransactionArgument {

@@ -121,3 +120,3 @@ let [item] = tx.moveCall({

kioskCap: ObjectArgument,
itemId: SuiAddress,
itemId: string,
price: string | bigint,

@@ -146,3 +145,3 @@ ): void {

kioskCap: ObjectArgument,
itemId: SuiAddress,
itemId: string,
): void {

@@ -183,3 +182,3 @@ tx.moveCall({

kiosk: ObjectArgument,
itemId: SuiAddress,
itemId: string,
payment: ObjectArgument,

@@ -233,3 +232,3 @@ ): [TransactionArgument, TransactionArgument] {

kioskCap: ObjectArgument,
itemId: SuiAddress,
itemId: string,
): TransactionArgument {

@@ -254,3 +253,3 @@ let [item] = tx.moveCall({

kioskCap: ObjectArgument,
itemId: SuiAddress,
itemId: string,
): TransactionArgument {

@@ -277,3 +276,3 @@ let [item] = tx.moveCall({

kioskCap: ObjectArgument,
itemId: SuiAddress,
itemId: string,
): [TransactionArgument, TransactionArgument] {

@@ -321,3 +320,3 @@ let [item, promise] = tx.moveCall({

kiosk: ObjectArgument,
itemId: SuiAddress,
itemId: string,
policy: TransferPolicy,

@@ -324,0 +323,0 @@ environment: RulesEnvironmentParam,

// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import { SuiAddress } from '@mysten/sui.js';
/* A list of environments. */

@@ -10,3 +8,3 @@ export type Environment = 'mainnet' | 'testnet' | 'devnet' | 'custom';

/** A Parameter to support environments for rules. */
export type RulesEnvironmentParam = { env: Environment; address?: SuiAddress };
export type RulesEnvironmentParam = { env: Environment; address?: string };

@@ -13,0 +11,0 @@ /** A default Testnet Environment object */

// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import { ObjectDigest, ObjectId, ObjectType, PaginatedObjectsResponse } from '@mysten/sui.js';
import { ObjectDigest, ObjectType, PaginatedObjectsResponse } from '@mysten/sui.js';
import { TransactionArgument } from '@mysten/sui.js/transactions';

@@ -75,3 +75,3 @@ import { ObjectArgument } from '.';

/** The ID of the Item */
objectId: ObjectId;
objectId: string;
/**

@@ -85,3 +85,3 @@ * Whether or not there's a `PurchaseCap` issued. `true` means that

/** The ID of the listing */
listingId: ObjectId;
listingId: string;
price?: string;

@@ -96,3 +96,3 @@ };

/** The ID of the Item */
objectId: ObjectId;
objectId: string;
/** The type of the Item */

@@ -110,4 +110,4 @@ type: ObjectType;

items: KioskItem[];
itemIds: ObjectId[];
listingIds: ObjectId[];
itemIds: string[];
listingIds: string[];
kiosk?: Kiosk;

@@ -130,10 +130,10 @@ extensions: any[]; // type will be defined on later versions of the SDK.

kioskOwnerCaps: KioskOwnerCap[];
kioskIds: ObjectId[];
kioskIds: string[];
} & Omit<PaginatedObjectsResponse, 'data'>;
export type KioskOwnerCap = {
objectId: ObjectId;
kioskId: ObjectId;
objectId: string;
kioskId: string;
digest: ObjectDigest;
version: string;
};
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import {
ObjectId,
SharedObjectRef,
SuiObjectRef,
SuiObjectResponse,
getObjectFields,
} from '@mysten/sui.js';
import { SharedObjectRef, SuiObjectRef, SuiObjectResponse, getObjectFields } from '@mysten/sui.js';
import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions';

@@ -123,4 +117,4 @@ import { type DynamicFieldInfo } from '@mysten/sui.js';

// for easier mapping on the nex
const itemListings = listings.reduce<Record<ObjectId, KioskListing>>(
(acc: Record<ObjectId, KioskListing>, item, idx) => {
const itemListings = listings.reduce<Record<string, KioskListing>>(
(acc: Record<string, KioskListing>, item, idx) => {
acc[item.objectId] = { ...item };

@@ -149,6 +143,6 @@

*/
export function attachLockedItems(kioskData: KioskData, lockedItemIds: ObjectId[]) {
export function attachLockedItems(kioskData: KioskData, lockedItemIds: string[]) {
// map lock status in an array of type { item_id: true }
const lockedStatuses = lockedItemIds.reduce<Record<ObjectId, boolean>>(
(acc: Record<ObjectId, boolean>, item: string) => {
const lockedStatuses = lockedItemIds.reduce<Record<string, boolean>>(
(acc: Record<string, boolean>, item: string) => {
acc[item] = true;

@@ -186,3 +180,3 @@ return acc;

client: SuiClient,
parentId: ObjectId,
parentId: string,
pagination: PaginationArguments<string>,

@@ -189,0 +183,0 @@ ) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc