@tradeport/sui-trading-sdk 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tradeport/sui-trading-sdk",
3
3
  "license": "MIT",
4
- "version": "0.3.4",
4
+ "version": "0.3.5",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -11,11 +11,11 @@ import { addTradeportKioskTransferTx } from '../transferNfts/addTransferNftTx';
11
11
 
12
12
  export type MigrateNftsFromUnsharedToSharedKiosks = {
13
13
  walletAddress: string;
14
- max: number;
14
+ max?: number;
15
15
  };
16
16
 
17
17
  export async function migrateNftsFromUnsharedToSharedKiosks(
18
- { walletAddress, max }: MigrateNftsFromUnsharedToSharedKiosks,
18
+ { walletAddress, max = 5 }: MigrateNftsFromUnsharedToSharedKiosks,
19
19
  context: RequestContext,
20
20
  ): Promise<Transaction> {
21
21
  const tx = new Transaction();
@@ -28,15 +28,14 @@ export async function migrateNftsFromUnsharedToSharedKiosks(
28
28
 
29
29
  const unsharedOBKiosks = res?.kiosks
30
30
  ?.filter((k: any) => !k.is_shared && k.is_origin_byte)
31
- ?.map((k: any) => k.id)
32
- ?.slice(0, 5);
31
+ ?.map((k: any) => k.id);
33
32
 
34
33
  let currentMigrationCount = 0;
35
34
 
36
35
  const sharedOBKiosk = res?.kiosks?.filter((k: any) => k.is_shared && k.is_origin_byte)?.[0]?.id;
37
36
 
38
37
  for (const unsharedOBKiosk of unsharedOBKiosks) {
39
- if (currentMigrationCount >= (max ?? 5)) {
38
+ if (currentMigrationCount >= max) {
40
39
  continue;
41
40
  }
42
41
 
@@ -99,11 +98,10 @@ export async function migrateNftsFromUnsharedToSharedKiosks(
99
98
 
100
99
  const unsharedNativeKiosks = res?.kiosks
101
100
  ?.filter((k: any) => !k.is_shared && !k.is_origin_byte)
102
- ?.map((k: any) => k.id)
103
- ?.slice(0, 5);
101
+ ?.map((k: any) => k.id);
104
102
 
105
103
  for (const unsharedNativeKiosk of unsharedNativeKiosks) {
106
- if (currentMigrationCount >= 5) {
104
+ if (currentMigrationCount >= max) {
107
105
  continue;
108
106
  }
109
107