@mysten/kiosk
Advanced tools
Comparing version 0.0.0-experimental-20230727221645 to 0.0.0-experimental-20230728041723
@@ -39,3 +39,3 @@ "use strict"; | ||
attachLockedItems: () => attachLockedItems, | ||
bcs: () => import_sui.bcs, | ||
bcs: () => import_bcs.bcs, | ||
borrow: () => borrow, | ||
@@ -78,7 +78,4 @@ borrowMut: () => borrowMut, | ||
// src/utils.ts | ||
var import_sui2 = require("@mysten/sui.js"); | ||
// src/bcs.ts | ||
var import_sui = require("@mysten/sui.js"); | ||
var import_bcs = require("@mysten/sui.js/bcs"); | ||
@@ -110,3 +107,3 @@ // src/types/kiosk.ts | ||
// src/bcs.ts | ||
import_sui.bcs.registerStructType(KIOSK_TYPE, { | ||
import_bcs.bcs.registerStructType(KIOSK_TYPE, { | ||
id: "address", | ||
@@ -118,3 +115,3 @@ profits: "u64", | ||
}); | ||
import_sui.bcs.registerStructType(KIOSK_PURCHASE_CAP, { | ||
import_bcs.bcs.registerStructType(KIOSK_PURCHASE_CAP, { | ||
id: "address", | ||
@@ -125,6 +122,6 @@ kioskId: "address", | ||
}); | ||
import_sui.bcs.registerStructType(TRANSFER_POLICY_CREATED_EVENT, { | ||
import_bcs.bcs.registerStructType(TRANSFER_POLICY_CREATED_EVENT, { | ||
id: "address" | ||
}); | ||
import_sui.bcs.registerStructType(TRANSFER_POLICY_TYPE, { | ||
import_bcs.bcs.registerStructType(TRANSFER_POLICY_TYPE, { | ||
id: "address", | ||
@@ -169,3 +166,3 @@ balance: "u64", | ||
} | ||
return import_sui.bcs.de(KIOSK_TYPE, queryRes.data.bcs.bcsBytes, "base64"); | ||
return import_bcs.bcs.de(KIOSK_TYPE, queryRes.data.bcs.bcsBytes, "base64"); | ||
} | ||
@@ -211,3 +208,4 @@ function extractKioskData(data, listings, lockedItemIds) { | ||
return acc; | ||
const data = (0, import_sui2.getObjectFields)(listingObjects[idx]); | ||
const content = listingObjects[idx].data?.content; | ||
const data = content?.dataType === "moveObject" ? content?.fields : null; | ||
if (!data) | ||
@@ -480,3 +478,2 @@ return acc; | ||
// src/query/kiosk.ts | ||
var import_sui3 = require("@mysten/sui.js"); | ||
var import_utils3 = require("@mysten/sui.js/utils"); | ||
@@ -523,3 +520,6 @@ async function fetchKiosk(client, kioskId, pagination, options) { | ||
}); | ||
const kioskIdList = data?.map((x) => (0, import_sui3.getObjectFields)(x)?.for); | ||
const kioskIdList = data?.map((x) => { | ||
const fields = x.data?.content?.dataType === "moveObject" ? x.data.content.fields : null; | ||
return fields?.for; | ||
}); | ||
const filteredData = data.filter((x) => "data" in x).map((x) => x.data); | ||
@@ -555,3 +555,3 @@ return { | ||
} | ||
let parsed = import_sui.bcs.de(TRANSFER_POLICY_TYPE, policy.bcs.bcsBytes, "base64"); | ||
let parsed = import_bcs.bcs.de(TRANSFER_POLICY_TYPE, policy.bcs.bcsBytes, "base64"); | ||
return { | ||
@@ -558,0 +558,0 @@ id: policy?.objectId, |
# @mysten/kiosk | ||
## 0.0.0-experimental-20230727221645 | ||
## 0.0.0-experimental-20230728041723 | ||
@@ -23,3 +23,3 @@ ### Minor Changes | ||
- Updated dependencies [001148443] | ||
- @mysten/sui.js@0.0.0-experimental-20230727221645 | ||
- @mysten/sui.js@0.0.0-experimental-20230728041723 | ||
@@ -26,0 +26,0 @@ ## 0.3.3 |
@@ -1,2 +0,2 @@ | ||
import { bcs } from '@mysten/sui.js'; | ||
import { bcs } from '@mysten/sui.js/bcs'; | ||
export { bcs }; |
@@ -39,3 +39,3 @@ "use strict"; | ||
attachLockedItems: () => attachLockedItems, | ||
bcs: () => import_sui.bcs, | ||
bcs: () => import_bcs.bcs, | ||
borrow: () => borrow, | ||
@@ -78,7 +78,4 @@ borrowMut: () => borrowMut, | ||
// src/utils.ts | ||
var import_sui2 = require("@mysten/sui.js"); | ||
// src/bcs.ts | ||
var import_sui = require("@mysten/sui.js"); | ||
var import_bcs = require("@mysten/sui.js/bcs"); | ||
@@ -110,3 +107,3 @@ // src/types/kiosk.ts | ||
// src/bcs.ts | ||
import_sui.bcs.registerStructType(KIOSK_TYPE, { | ||
import_bcs.bcs.registerStructType(KIOSK_TYPE, { | ||
id: "address", | ||
@@ -118,3 +115,3 @@ profits: "u64", | ||
}); | ||
import_sui.bcs.registerStructType(KIOSK_PURCHASE_CAP, { | ||
import_bcs.bcs.registerStructType(KIOSK_PURCHASE_CAP, { | ||
id: "address", | ||
@@ -125,6 +122,6 @@ kioskId: "address", | ||
}); | ||
import_sui.bcs.registerStructType(TRANSFER_POLICY_CREATED_EVENT, { | ||
import_bcs.bcs.registerStructType(TRANSFER_POLICY_CREATED_EVENT, { | ||
id: "address" | ||
}); | ||
import_sui.bcs.registerStructType(TRANSFER_POLICY_TYPE, { | ||
import_bcs.bcs.registerStructType(TRANSFER_POLICY_TYPE, { | ||
id: "address", | ||
@@ -169,3 +166,3 @@ balance: "u64", | ||
} | ||
return import_sui.bcs.de(KIOSK_TYPE, queryRes.data.bcs.bcsBytes, "base64"); | ||
return import_bcs.bcs.de(KIOSK_TYPE, queryRes.data.bcs.bcsBytes, "base64"); | ||
} | ||
@@ -211,3 +208,4 @@ function extractKioskData(data, listings, lockedItemIds) { | ||
return acc; | ||
const data = (0, import_sui2.getObjectFields)(listingObjects[idx]); | ||
const content = listingObjects[idx].data?.content; | ||
const data = content?.dataType === "moveObject" ? content?.fields : null; | ||
if (!data) | ||
@@ -480,3 +478,2 @@ return acc; | ||
// src/query/kiosk.ts | ||
var import_sui3 = require("@mysten/sui.js"); | ||
var import_utils3 = require("@mysten/sui.js/utils"); | ||
@@ -523,3 +520,6 @@ async function fetchKiosk(client, kioskId, pagination, options) { | ||
}); | ||
const kioskIdList = data?.map((x) => (0, import_sui3.getObjectFields)(x)?.for); | ||
const kioskIdList = data?.map((x) => { | ||
const fields = x.data?.content?.dataType === "moveObject" ? x.data.content.fields : null; | ||
return fields?.for; | ||
}); | ||
const filteredData = data.filter((x) => "data" in x).map((x) => x.data); | ||
@@ -555,3 +555,3 @@ return { | ||
} | ||
let parsed = import_sui.bcs.de(TRANSFER_POLICY_TYPE, policy.bcs.bcsBytes, "base64"); | ||
let parsed = import_bcs.bcs.de(TRANSFER_POLICY_TYPE, policy.bcs.bcsBytes, "base64"); | ||
return { | ||
@@ -558,0 +558,0 @@ id: policy?.objectId, |
@@ -1,2 +0,3 @@ | ||
import { SharedObjectRef, SuiObjectRef } from '@mysten/sui.js'; | ||
import { SharedObjectRef } from '@mysten/sui.js/bcs'; | ||
import { SuiObjectRef } from '@mysten/sui.js/client'; | ||
import { TransactionArgument } from '@mysten/sui.js/transactions'; | ||
@@ -3,0 +4,0 @@ export * from './kiosk'; |
@@ -1,2 +0,2 @@ | ||
import { ObjectDigest, ObjectType, PaginatedObjectsResponse } from '@mysten/sui.js'; | ||
import { PaginatedObjectsResponse } from '@mysten/sui.js/client'; | ||
import { TransactionArgument } from '@mysten/sui.js/transactions'; | ||
@@ -80,3 +80,3 @@ import { ObjectArgument } from '.'; | ||
/** The type of the Item */ | ||
type: ObjectType; | ||
type: string; | ||
/** Whether the item is Locked (there must be a `Lock` Dynamic Field) */ | ||
@@ -113,4 +113,4 @@ isLocked: boolean; | ||
kioskId: string; | ||
digest: ObjectDigest; | ||
digest: string; | ||
version: string; | ||
}; |
@@ -1,2 +0,3 @@ | ||
import { SharedObjectRef, SuiObjectRef, SuiObjectResponse } from '@mysten/sui.js'; | ||
import { SharedObjectRef } from '@mysten/sui.js/bcs'; | ||
import { SuiObjectRef, SuiObjectResponse } from '@mysten/sui.js/client'; | ||
import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions'; | ||
@@ -3,0 +4,0 @@ import { type DynamicFieldInfo } from '@mysten/sui.js/client'; |
@@ -5,3 +5,3 @@ { | ||
"description": "Sui Kiosk library", | ||
"version": "0.0.0-experimental-20230727221645", | ||
"version": "0.0.0-experimental-20230728041723", | ||
"license": "Apache-2.0", | ||
@@ -28,3 +28,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@mysten/sui.js": "0.0.0-experimental-20230727221645" | ||
"@mysten/sui.js": "0.0.0-experimental-20230728041723" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { bcs } from '@mysten/sui.js'; | ||
import { bcs } from '@mysten/sui.js/bcs'; | ||
import { | ||
@@ -6,0 +6,0 @@ KIOSK_PURCHASE_CAP, |
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { SuiObjectData, SuiObjectResponse, getObjectFields } from '@mysten/sui.js'; | ||
import { SuiObjectData, SuiObjectResponse } from '@mysten/sui.js/client'; | ||
import { isValidSuiAddress } from '@mysten/sui.js/utils'; | ||
@@ -100,3 +100,6 @@ import { | ||
// get kioskIds from the OwnerCaps. | ||
const kioskIdList = data?.map((x: SuiObjectResponse) => getObjectFields(x)?.for); | ||
const kioskIdList = data?.map((x: SuiObjectResponse) => { | ||
const fields = x.data?.content?.dataType === 'moveObject' ? x.data.content.fields : null; | ||
return fields?.for; | ||
}); | ||
@@ -103,0 +106,0 @@ // clean up data that might have an error in them. |
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { SharedObjectRef, SuiObjectRef } from '@mysten/sui.js'; | ||
import { SharedObjectRef } from '@mysten/sui.js/bcs'; | ||
import { SuiObjectRef } from '@mysten/sui.js/client'; | ||
import { TransactionArgument } from '@mysten/sui.js/transactions'; | ||
@@ -6,0 +7,0 @@ |
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { ObjectDigest, ObjectType, PaginatedObjectsResponse } from '@mysten/sui.js'; | ||
import { PaginatedObjectsResponse } from '@mysten/sui.js/client'; | ||
import { TransactionArgument } from '@mysten/sui.js/transactions'; | ||
@@ -96,3 +96,3 @@ import { ObjectArgument } from '.'; | ||
/** The type of the Item */ | ||
type: ObjectType; | ||
type: string; | ||
/** Whether the item is Locked (there must be a `Lock` Dynamic Field) */ | ||
@@ -133,4 +133,4 @@ isLocked: boolean; | ||
kioskId: string; | ||
digest: ObjectDigest; | ||
digest: string; | ||
version: string; | ||
}; |
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { SharedObjectRef, SuiObjectRef, SuiObjectResponse, getObjectFields } from '@mysten/sui.js'; | ||
import { SharedObjectRef } from '@mysten/sui.js/bcs'; | ||
import { SuiObjectRef, SuiObjectResponse } from '@mysten/sui.js/client'; | ||
import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions'; | ||
@@ -125,3 +126,5 @@ import { type DynamicFieldInfo } from '@mysten/sui.js/client'; | ||
const data = getObjectFields(listingObjects[idx]); | ||
const content = listingObjects[idx].data?.content; | ||
const data = content?.dataType === 'moveObject' ? content?.fields : null; | ||
if (!data) return acc; | ||
@@ -128,0 +131,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
214136
3097
+ Added@mysten/sui.js@0.0.0-experimental-20230728041723(transitive)
- Removed@mysten/sui.js@0.0.0-experimental-20230727221645(transitive)